From 45289e2ded0ec138bd46b0016ada1008d1bc4a0c Mon Sep 17 00:00:00 2001 From: Jack F Vogel Date: Fri, 24 Jul 2009 21:35:52 +0000 Subject: [PATCH] Improvement on the last change, this gives a precise way to tell the one and only interface that a vlan event is for. Thanks to John Baldwin for the patch. Approved by: re --- sys/dev/e1000/if_em.c | 12 ++++++------ sys/dev/e1000/if_igb.c | 12 ++++++------ sys/dev/ixgbe/ixgbe.c | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 35d5fcc39ce0..d1fe7aaa3cb8 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -815,9 +815,9 @@ em_attach(device_t dev) #if __FreeBSD_version >= 700029 /* Register for VLAN events */ adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, - em_register_vlan, 0, EVENTHANDLER_PRI_FIRST); + em_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, - em_unregister_vlan, 0, EVENTHANDLER_PRI_FIRST); + em_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); #endif /* Tell the stack that the interface is not active */ @@ -4713,12 +4713,12 @@ em_receive_checksum(struct adapter *adapter, * config EVENT */ static void -em_register_vlan(void *unused, struct ifnet *ifp, u16 vtag) +em_register_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u32 index, bit; - if (ifp->if_init != em_init) /* Not our event */ + if (ifp->if_softc != arg) /* Not our event */ return; if ((vtag == 0) || (vtag > 4095)) /* Invalid ID */ @@ -4737,12 +4737,12 @@ em_register_vlan(void *unused, struct ifnet *ifp, u16 vtag) * unconfig EVENT */ static void -em_unregister_vlan(void *unused, struct ifnet *ifp, u16 vtag) +em_unregister_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u32 index, bit; - if (ifp->if_init != em_init) + if (ifp->if_softc != arg) return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index 143f6e244db4..ee19b944e779 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -600,9 +600,9 @@ igb_attach(device_t dev) /* Register for VLAN events */ adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, - igb_register_vlan, 0, EVENTHANDLER_PRI_FIRST); + igb_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, - igb_unregister_vlan, 0, EVENTHANDLER_PRI_FIRST); + igb_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); /* Tell the stack that the interface is not active */ adapter->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -4305,12 +4305,12 @@ igb_rx_checksum(u32 staterr, struct mbuf *mp, bool sctp) * config EVENT */ static void -igb_register_vlan(void *unused, struct ifnet *ifp, u16 vtag) +igb_register_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u32 index, bit; - if (ifp->if_init != igb_init) /* Not our event */ + if (ifp->if_softc != arg) /* Not our event */ return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ @@ -4329,12 +4329,12 @@ igb_register_vlan(void *unused, struct ifnet *ifp, u16 vtag) * unconfig EVENT */ static void -igb_unregister_vlan(void *unused, struct ifnet *ifp, u16 vtag) +igb_unregister_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u32 index, bit; - if (ifp->if_init != igb_init) + if (ifp->if_softc != arg) return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index 639676953b10..bd95bdf0a9fa 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c @@ -539,9 +539,9 @@ ixgbe_attach(device_t dev) /* Register for VLAN events */ adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, - ixgbe_register_vlan, 0, EVENTHANDLER_PRI_FIRST); + ixgbe_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, - ixgbe_unregister_vlan, 0, EVENTHANDLER_PRI_FIRST); + ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); /* let hardware know driver is loaded */ ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); @@ -4124,12 +4124,12 @@ ixgbe_rx_checksum(u32 staterr, struct mbuf * mp) ** repopulate the real table. */ static void -ixgbe_register_vlan(void *unused, struct ifnet *ifp, u16 vtag) +ixgbe_register_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u16 index, bit; - if (ifp->if_init != ixgbe_init) /* Not our event */ + if (ifp->if_softc != arg) /* Not our event */ return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ @@ -4149,12 +4149,12 @@ ixgbe_register_vlan(void *unused, struct ifnet *ifp, u16 vtag) ** in the soft vfta. */ static void -ixgbe_unregister_vlan(void *unused, struct ifnet *ifp, u16 vtag) +ixgbe_unregister_vlan(void *arg, struct ifnet *ifp, u16 vtag) { struct adapter *adapter = ifp->if_softc; u16 index, bit; - if (ifp->if_init != ixgbe_init) + if (ifp->if_softc != arg) return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */