diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/if_aue.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 4013813d..acafe1d 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -129,8 +129,10 @@ Static int aue_rx_list_init __P((struct aue_softc *)); Static int aue_newbuf __P((struct aue_softc *, struct aue_chain *, struct mbuf *)); Static int aue_encap __P((struct aue_softc *, struct mbuf *, int)); +#ifdef AUE_INTR_PIPE Static void aue_intr __P((usbd_xfer_handle, usbd_private_handle, usbd_status)); +#endif Static void aue_rxeof __P((usbd_xfer_handle, usbd_private_handle, usbd_status)); Static void aue_txeof __P((usbd_xfer_handle, @@ -768,9 +770,10 @@ Static int aue_detach(dev) usbd_abort_pipe(sc->aue_ep[AUE_ENDPT_TX]); if (sc->aue_ep[AUE_ENDPT_RX] != NULL) usbd_abort_pipe(sc->aue_ep[AUE_ENDPT_RX]); +#ifdef AUE_INTR_PIPE if (sc->aue_ep[AUE_ENDPT_INTR] != NULL) usbd_abort_pipe(sc->aue_ep[AUE_ENDPT_INTR]); - +#endif splx(s); return(0); @@ -864,6 +867,7 @@ Static int aue_tx_list_init(sc) return(0); } +#ifdef AUE_INTR_PIPE Static void aue_intr(xfer, priv, status) usbd_xfer_handle xfer; usbd_private_handle priv; @@ -908,6 +912,7 @@ Static void aue_intr(xfer, priv, status) splx(s); return; } +#endif Static void aue_rxstart(ifp) struct ifnet *ifp; @@ -1044,9 +1049,11 @@ Static void aue_txeof(xfer, priv, status) ifp->if_flags &= ~IFF_OACTIVE; usbd_get_xfer_status(c->aue_xfer, NULL, NULL, NULL, &err); - c->aue_mbuf->m_pkthdr.rcvif = ifp; - usb_tx_done(c->aue_mbuf); - c->aue_mbuf = NULL; + if (c->aue_mbuf != NULL) { + c->aue_mbuf->m_pkthdr.rcvif = ifp; + usb_tx_done(c->aue_mbuf); + c->aue_mbuf = NULL; + } if (err) ifp->if_oerrors++; @@ -1232,7 +1239,9 @@ Static void aue_init(xsc) return; } +#ifdef AUE_INTR_PIPE sc->aue_cdata.aue_ibuf = malloc(AUE_INTR_PKTLEN, M_USBDEV, M_NOWAIT); +#endif /* Load the multicast filter. */ aue_setmulti(sc); @@ -1261,6 +1270,7 @@ Static void aue_init(xsc) return; } +#ifdef AUE_INTR_PIPE err = usbd_open_pipe_intr(sc->aue_iface, sc->aue_ed[AUE_ENDPT_INTR], USBD_SHORT_XFER_OK, &sc->aue_ep[AUE_ENDPT_INTR], sc, sc->aue_cdata.aue_ibuf, AUE_INTR_PKTLEN, aue_intr, @@ -1271,6 +1281,7 @@ Static void aue_init(xsc) splx(s); return; } +#endif /* Start up the receive pipe. */ for (i = 0; i < AUE_RX_LIST_CNT; i++) { @@ -1396,13 +1407,17 @@ Static void aue_watchdog(ifp) struct ifnet *ifp; { struct aue_softc *sc; + struct aue_chain *c; + usbd_status stat; sc = ifp->if_softc; ifp->if_oerrors++; printf("aue%d: watchdog timeout\n", sc->aue_unit); - aue_init(sc); + c = &sc->aue_cdata.aue_tx_chain[0]; + usbd_get_xfer_status(c->aue_xfer, NULL, NULL, NULL, &stat); + aue_txeof(c->aue_xfer, c, stat); if (ifp->if_snd.ifq_head != NULL) aue_start(ifp); @@ -1458,6 +1473,7 @@ Static void aue_stop(sc) sc->aue_ep[AUE_ENDPT_TX] = NULL; } +#ifdef AUE_INTR_PIPE if (sc->aue_ep[AUE_ENDPT_INTR] != NULL) { err = usbd_abort_pipe(sc->aue_ep[AUE_ENDPT_INTR]); if (err) { @@ -1471,6 +1487,7 @@ Static void aue_stop(sc) } sc->aue_ep[AUE_ENDPT_INTR] = NULL; } +#endif /* Free RX resources. */ for (i = 0; i < AUE_RX_LIST_CNT; i++) { @@ -1504,8 +1521,10 @@ Static void aue_stop(sc) } } +#ifdef AUE_INTR_PIPE free(sc->aue_cdata.aue_ibuf, M_USBDEV); sc->aue_cdata.aue_ibuf = NULL; +#endif sc->aue_link = 0; |