Lines 221-226
static MALLOC_DEFINE(M_VLAN, vlanname, "802.1Q Virtual LAN Interface");
Link Here
|
221 |
|
221 |
|
222 |
static eventhandler_tag ifdetach_tag; |
222 |
static eventhandler_tag ifdetach_tag; |
223 |
static eventhandler_tag iflladdr_tag; |
223 |
static eventhandler_tag iflladdr_tag; |
|
|
224 |
static eventhandler_tag ifevent_tag; |
224 |
|
225 |
|
225 |
/* |
226 |
/* |
226 |
* if_vlan uses two module-level locks to allow concurrent modification of vlan |
227 |
* if_vlan uses two module-level locks to allow concurrent modification of vlan |
Lines 347-352
static int vlan_clone_destroy(struct if_clone *, struct ifnet *);
Link Here
|
347 |
|
348 |
|
348 |
static void vlan_ifdetach(void *arg, struct ifnet *ifp); |
349 |
static void vlan_ifdetach(void *arg, struct ifnet *ifp); |
349 |
static void vlan_iflladdr(void *arg, struct ifnet *ifp); |
350 |
static void vlan_iflladdr(void *arg, struct ifnet *ifp); |
|
|
351 |
static void vlan_ifevent(void *arg, struct ifnet *ifp, int event); |
350 |
|
352 |
|
351 |
static void vlan_lladdr_fn(void *arg, int pending); |
353 |
static void vlan_lladdr_fn(void *arg, int pending); |
352 |
|
354 |
|
Lines 651-656
vlan_setmulti(struct ifnet *ifp)
Link Here
|
651 |
return (0); |
653 |
return (0); |
652 |
} |
654 |
} |
653 |
|
655 |
|
|
|
656 |
/* |
657 |
* A handler for interface ifnet events. |
658 |
*/ |
659 |
static void |
660 |
vlan_ifevent(void *arg __unused, struct ifnet *ifp, int event) |
661 |
{ |
662 |
VLAN_LOCK_READER; |
663 |
struct ifvlan *ifv; |
664 |
struct ifvlantrunk *trunk; |
665 |
|
666 |
if (event != IFNET_EVENT_UPDATE_BAUDRATE) |
667 |
return; |
668 |
|
669 |
VLAN_RLOCK(); |
670 |
trunk = ifp->if_vlantrunk; |
671 |
if (trunk == NULL) { |
672 |
VLAN_RUNLOCK(); |
673 |
return; |
674 |
} |
675 |
|
676 |
VLAN_FOREACH(ifv, trunk) { |
677 |
ifv->ifv_ifp->if_baudrate = ifp->if_baudrate; |
678 |
} |
679 |
VLAN_RUNLOCK(); |
680 |
} |
681 |
|
654 |
/* |
682 |
/* |
655 |
* A handler for parent interface link layer address changes. |
683 |
* A handler for parent interface link layer address changes. |
656 |
* If the parent interface link layer address is changed we |
684 |
* If the parent interface link layer address is changed we |
Lines 871-876
vlan_modevent(module_t mod, int type, void *data)
Link Here
|
871 |
vlan_iflladdr, NULL, EVENTHANDLER_PRI_ANY); |
899 |
vlan_iflladdr, NULL, EVENTHANDLER_PRI_ANY); |
872 |
if (iflladdr_tag == NULL) |
900 |
if (iflladdr_tag == NULL) |
873 |
return (ENOMEM); |
901 |
return (ENOMEM); |
|
|
902 |
ifevent_tag = EVENTHANDLER_REGISTER(ifnet_event, |
903 |
vlan_ifevent, NULL, EVENTHANDLER_PRI_ANY); |
904 |
if (ifevent_tag == NULL) |
905 |
return (ENOMEM); |
874 |
VLAN_LOCKING_INIT(); |
906 |
VLAN_LOCKING_INIT(); |
875 |
vlan_input_p = vlan_input; |
907 |
vlan_input_p = vlan_input; |
876 |
vlan_link_state_p = vlan_link_state; |
908 |
vlan_link_state_p = vlan_link_state; |
Lines 900-905
vlan_modevent(module_t mod, int type, void *data)
Link Here
|
900 |
#endif |
932 |
#endif |
901 |
EVENTHANDLER_DEREGISTER(ifnet_departure_event, ifdetach_tag); |
933 |
EVENTHANDLER_DEREGISTER(ifnet_departure_event, ifdetach_tag); |
902 |
EVENTHANDLER_DEREGISTER(iflladdr_event, iflladdr_tag); |
934 |
EVENTHANDLER_DEREGISTER(iflladdr_event, iflladdr_tag); |
|
|
935 |
EVENTHANDLER_DEREGISTER(ifnet_event, ifevent_tag); |
903 |
vlan_input_p = NULL; |
936 |
vlan_input_p = NULL; |
904 |
vlan_link_state_p = NULL; |
937 |
vlan_link_state_p = NULL; |
905 |
vlan_trunk_cap_p = NULL; |
938 |
vlan_trunk_cap_p = NULL; |