From 906507dd4c10a83d31ef2a7d04cbb9203a3e3ee8 Mon Sep 17 00:00:00 2001 From: Christian Brueffer Date: Tue, 2 Aug 2005 09:27:42 +0000 Subject: - add missing ether_poll_deregister - add per-device polling - move the setting of if_capenable further down so that the VLAN caps are honored as well Approved by: ru MFC after: 2 weeks --- sys/dev/ixgb/if_ixgb.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'sys/dev/ixgb') diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c index ec925b387b2a..480c8d3079fe 100644 --- a/sys/dev/ixgb/if_ixgb.c +++ b/sys/dev/ixgb/if_ixgb.c @@ -725,6 +725,11 @@ ixgb_poll_locked(struct ifnet * ifp, enum poll_cmd cmd, int count) IXGB_LOCK_ASSERT(adapter); + if (!(ifp->if_capenable & IFCAP_POLLING)) { + ether_poll_deregister(ifp); + cmd = POLL_DEREGISTER; + } + if (cmd == POLL_DEREGISTER) { /* final call, enable interrupts */ ixgb_enable_intr(adapter); return; @@ -783,7 +788,8 @@ ixgb_intr(void *arg) return; } - if (ether_poll_register(ixgb_poll, ifp)) { + if ((ifp->if_capenable & IFCAP_POLLING) && + ether_poll_register(ixgb_poll, ifp)) { ixgb_disable_intr(adapter); ixgb_poll_locked(ifp, 0, 1); IXGB_UNLOCK(adapter); @@ -1345,7 +1351,9 @@ ixgb_setup_interface(device_t dev, struct adapter * adapter) #endif ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_capenable = ifp->if_capabilities; +#ifdef DEVICE_POLLING + ifp->if_capabilities |= IFCAP_POLLING; +#endif /* * Tell the upper layer(s) we support long frames. @@ -1355,6 +1363,9 @@ ixgb_setup_interface(device_t dev, struct adapter * adapter) #if __FreeBSD_version >= 500000 ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; #endif + + ifp->if_capenable = ifp->if_capabilities; + /* * Specify the media types supported by this adapter and register * callbacks to update media and link information -- cgit v1.2.3