diff options
author | ru <ru@FreeBSD.org> | 2004-04-11 19:25:56 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2004-04-11 19:25:56 +0000 |
commit | 3f9b8e99a0f8988f51e816f2970682f0854def1d (patch) | |
tree | 7650ad319be8082488f6a002694677d78ac1a5af /sys | |
parent | 7764e9e2f9a011c4950a736ef60ee0315def73e2 (diff) | |
download | FreeBSD-src-3f9b8e99a0f8988f51e816f2970682f0854def1d.zip FreeBSD-src-3f9b8e99a0f8988f51e816f2970682f0854def1d.tar.gz |
Implemented per-interface polling(4) control.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/nge/if_nge.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index b281e87..01511ce 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -948,6 +948,9 @@ nge_attach(dev) ifp->if_snd.ifq_maxlen = NGE_TX_LIST_CNT - 1; ifp->if_hwassist = NGE_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING; +#ifdef DEVICE_POLLING + ifp->if_capabilities |= IFCAP_POLLING; +#endif ifp->if_capenable = ifp->if_capabilities; /* @@ -1523,6 +1526,10 @@ nge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct nge_softc *sc = ifp->if_softc; + if (!(ifp->if_capenable & IFCAP_POLLING)) { + ether_poll_deregister(ifp); + cmd = POLL_DEREGISTER; + } if (cmd == POLL_DEREGISTER) { /* final call, enable interrupts */ CSR_WRITE_4(sc, NGE_IER, 1); return; @@ -1575,7 +1582,8 @@ nge_intr(arg) #ifdef DEVICE_POLLING if (ifp->if_flags & IFF_POLLING) return; - if (ether_poll_register(nge_poll, ifp)) { /* ok, disable interrupts */ + if ((ifp->if_capenable & IFCAP_POLLING) && + ether_poll_register(nge_poll, ifp)) { /* ok, disable interrupts */ CSR_WRITE_4(sc, NGE_IER, 0); nge_poll(ifp, 0, 1); return; @@ -2156,6 +2164,9 @@ nge_ioctl(ifp, command, data) command); } break; + case SIOCSIFCAP: + ifp->if_capenable = ifr->ifr_reqcap; + break; default: error = ether_ioctl(ifp, command, data); break; |