diff options
| author | Ruslan Ermilov <ru@FreeBSD.org> | 2004-04-11 15:35:49 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@FreeBSD.org> | 2004-04-11 15:35:49 +0000 |
| commit | fb9172265bd6b29d89a211714ec484e8ab50f5ed (patch) | |
| tree | c4267468c8cdc50efc1477ba3af33b21a207ba53 | |
| parent | 43de1cf4be725db819853002cec9e9c25e796676 (diff) | |
Notes
| -rw-r--r-- | sys/dev/fxp/if_fxp.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index fbc655d5820da..67fc30132be5d 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -804,6 +804,12 @@ fxp_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; } +#ifdef DEVICE_POLLING + /* Inform the world we support polling. */ + ifp->if_capabilities |= IFCAP_POLLING; + ifp->if_capenable |= IFCAP_POLLING; +#endif + /* * Attach the interface. */ @@ -1512,6 +1518,10 @@ fxp_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) u_int8_t statack; FXP_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_1(sc, FXP_CSR_SCB_INTRCNTL, 0); FXP_UNLOCK(sc); @@ -1559,7 +1569,8 @@ fxp_intr(void *xsc) FXP_UNLOCK(sc); return; } - if (ether_poll_register(fxp_poll, ifp)) { + if ((ifp->if_capenable & IFCAP_POLLING) && + ether_poll_register(fxp_poll, ifp)) { /* disable interrupts */ CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE); FXP_UNLOCK(sc); @@ -2480,6 +2491,10 @@ fxp_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } break; + case SIOCSIFCAP: + ifp->if_capenable = ifr->ifr_reqcap; + break; + default: /* * ether_ioctl() will eventually call fxp_start() which |
