diff options
| author | Ruslan Ermilov <ru@FreeBSD.org> | 2004-04-11 21:01:12 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@FreeBSD.org> | 2004-04-11 21:01:12 +0000 |
| commit | 6707138161597a5c92eb48be3a28f325144b334c (patch) | |
| tree | 556cd2dba8c3941d4e3e0a756b8e9d49c3b76541 | |
| parent | f4ab22c94adfc8556e43b18810e5fc39df707758 (diff) | |
Notes
| -rw-r--r-- | sys/dev/em/if_em.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index 4bbe603efd1a..55e03a136e9a 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -727,11 +727,10 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) case SIOCSIFCAP: IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFCAP (Set Capabilities)"); mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if (mask & IFCAP_POLLING) + ifp->if_capenable ^= IFCAP_POLLING; if (mask & IFCAP_HWCSUM) { - if (IFCAP_HWCSUM & ifp->if_capenable) - ifp->if_capenable &= ~IFCAP_HWCSUM; - else - ifp->if_capenable |= IFCAP_HWCSUM; + ifp->if_capenable ^= IFCAP_HWCSUM; if (ifp->if_flags & IFF_RUNNING) em_init(adapter); } @@ -888,6 +887,10 @@ em_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count) mtx_assert(&adapter->mtx, MA_OWNED); + if (!(ifp->if_capenable & IFCAP_POLLING)) { + ether_poll_deregister(ifp); + cmd = POLL_DEREGISTER; + } if (cmd == POLL_DEREGISTER) { /* final call, enable interrupts */ em_enable_intr(adapter); return; @@ -945,7 +948,8 @@ em_intr(void *arg) return; } - if (ether_poll_register(em_poll, ifp)) { + if ((ifp->if_capenable & IFCAP_POLLING) && + ether_poll_register(em_poll, ifp)) { em_disable_intr(adapter); em_poll_locked(ifp, 0, 1); EM_UNLOCK(adapter); @@ -1864,6 +1868,10 @@ em_setup_interface(device_t dev, struct adapter * adapter) ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; #endif +#ifdef DEVICE_POLLING + ifp->if_capabilities |= IFCAP_POLLING; + ifp->if_capenable |= IFCAP_POLLING; +#endif /* * Specify the media types supported by this adapter and register |
