summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2004-04-11 16:23:16 +0000
committerru <ru@FreeBSD.org>2004-04-11 16:23:16 +0000
commit88016a0d08657de116deb5107d5fcd235438b30e (patch)
tree8a5c7bb0efb99cf0694764041f073ccceab5acb8 /sys
parent3085115018947f914e9e604cda0253a402928a4a (diff)
downloadFreeBSD-src-88016a0d08657de116deb5107d5fcd235438b30e.zip
FreeBSD-src-88016a0d08657de116deb5107d5fcd235438b30e.tar.gz
Implemented per-interface polling(4) control.
Diffstat (limited to 'sys')
-rw-r--r--sys/pci/if_rl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 10a8850..eee7976 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -1096,6 +1096,9 @@ rl_attach(dev)
ifp->if_init = rl_init;
ifp->if_baudrate = 10000000;
ifp->if_capabilities = IFCAP_VLAN_MTU;
+#ifdef DEVICE_POLLING
+ ifp->if_capabilities |= IFCAP_POLLING;
+#endif
ifp->if_capenable = ifp->if_capabilities;
ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
@@ -1430,6 +1433,10 @@ rl_poll (struct ifnet *ifp, enum poll_cmd cmd, int count)
struct rl_softc *sc = ifp->if_softc;
RL_LOCK(sc);
+ if (!(ifp->if_capenable & IFCAP_POLLING)) {
+ ether_poll_deregister(ifp);
+ cmd = POLL_DEREGISTER;
+ }
if (cmd == POLL_DEREGISTER) { /* final call, enable interrupts */
CSR_WRITE_2(sc, RL_IMR, RL_INTRS);
goto done;
@@ -1484,7 +1491,8 @@ rl_intr(arg)
#ifdef DEVICE_POLLING
if (ifp->if_flags & IFF_POLLING)
goto done;
- if (ether_poll_register(rl_poll, ifp)) { /* ok, disable interrupts */
+ if ((ifp->if_capenable & IFCAP_POLLING) &&
+ ether_poll_register(rl_poll, ifp)) { /* ok, disable interrupts */
CSR_WRITE_2(sc, RL_IMR, 0x0000);
rl_poll(ifp, 0, 1);
goto done;
@@ -1821,6 +1829,9 @@ rl_ioctl(ifp, command, data)
mii = device_get_softc(sc->rl_miibus);
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
break;
+ case SIOCSIFCAP:
+ ifp->if_capenable = ifr->ifr_reqcap;
+ break;
default:
error = ether_ioctl(ifp, command, data);
break;
OpenPOWER on IntegriCloud