Date: Fri, 24 Jul 2009 21:35:52 +0000 (UTC) From: Jack F Vogel <jfv@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r195857 - in head/sys/dev: e1000 ixgbe Message-ID: <200907242135.n6OLZqBs021835@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jfv Date: Fri Jul 24 21:35:52 2009 New Revision: 195857 URL: http://svn.freebsd.org/changeset/base/195857 Log: 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 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Jul 24 21:30:10 2009 (r195856) +++ head/sys/dev/e1000/if_em.c Fri Jul 24 21:35:52 2009 (r195857) @@ -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 *adap * 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 if * 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 */ Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jul 24 21:30:10 2009 (r195856) +++ head/sys/dev/e1000/if_igb.c Fri Jul 24 21:35:52 2009 (r195857) @@ -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 * 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 i * 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 */ Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Jul 24 21:30:10 2009 (r195856) +++ head/sys/dev/ixgbe/ixgbe.c Fri Jul 24 21:35:52 2009 (r195857) @@ -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 mb ** 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 ** 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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907242135.n6OLZqBs021835>