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
This commit is contained in:
parent
254d03c508
commit
45289e2ded
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user