diff options
author | brueffer <brueffer@FreeBSD.org> | 2005-08-02 09:27:42 +0000 |
---|---|---|
committer | brueffer <brueffer@FreeBSD.org> | 2005-08-02 09:27:42 +0000 |
commit | e2f34ef2a902e5daca1c6b08949db9cbba22dd2d (patch) | |
tree | f2081a817388d43ad69104f09caf3b7e630bf021 | |
parent | c7592f527da2e73a89e427910d2f415e5b07a190 (diff) | |
download | FreeBSD-src-e2f34ef2a902e5daca1c6b08949db9cbba22dd2d.zip FreeBSD-src-e2f34ef2a902e5daca1c6b08949db9cbba22dd2d.tar.gz |
- 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
-rw-r--r-- | sys/dev/ixgb/if_ixgb.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c index ec925b3..480c8d3 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 |