aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixgb
diff options
context:
space:
mode:
authorChristian Brueffer <brueffer@FreeBSD.org>2005-08-02 09:27:42 +0000
committerChristian Brueffer <brueffer@FreeBSD.org>2005-08-02 09:27:42 +0000
commit906507dd4c10a83d31ef2a7d04cbb9203a3e3ee8 (patch)
treef2081a817388d43ad69104f09caf3b7e630bf021 /sys/dev/ixgb
parentb34b221d77b7fbe68e68830cf48bb33014e4b7df (diff)
downloadsrc-906507dd4c10a83d31ef2a7d04cbb9203a3e3ee8.tar.gz
src-906507dd4c10a83d31ef2a7d04cbb9203a3e3ee8.zip
- 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
Notes
Notes: svn path=/head/; revision=148637
Diffstat (limited to 'sys/dev/ixgb')
-rw-r--r--sys/dev/ixgb/if_ixgb.c15
1 files changed, 13 insertions, 2 deletions
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