diff options
author | 2010-10-30 11:52:29 +0000 | |
---|---|---|
committer | 2010-10-30 11:52:29 +0000 | |
commit | ba34d0501c2b581ee696c00ab656dfdd2d3abf2c (patch) | |
tree | c6d560f0be8ffbfecd3c6ea780444606bfa376f0 | |
parent | don't release the node twice if tx() fails (diff) | |
download | wireguard-openbsd-ba34d0501c2b581ee696c00ab656dfdd2d3abf2c.tar.xz wireguard-openbsd-ba34d0501c2b581ee696c00ab656dfdd2d3abf2c.zip |
always decrement the number of xfers queued in txeof() even
if transfer failed.
-rw-r--r-- | sys/dev/usb/if_otus.c | 8 | ||||
-rw-r--r-- | sys/dev/usb/if_run.c | 15 |
2 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c index a1e1d82950b..7c56ed5086e 100644 --- a/sys/dev/usb/if_otus.c +++ b/sys/dev/usb/if_otus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_otus.c,v 1.22 2010/10/30 11:47:53 damien Exp $ */ +/* $OpenBSD: if_otus.c,v 1.23 2010/10/30 11:52:29 damien Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -1261,16 +1261,18 @@ otus_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) struct ifnet *ifp = &ic->ic_if; int s; + s = splnet(); + sc->tx_queued--; if (__predict_false(status != USBD_NORMAL_COMPLETION)) { DPRINTF(("TX status=%d\n", status)); if (status == USBD_STALLED) usbd_clear_endpoint_stall_async(sc->data_tx_pipe); ifp->if_oerrors++; + splx(s); return; } - s = splnet(); - sc->tx_queued--; sc->sc_tx_timer = 0; + ifp->if_opackets++; ifp->if_flags &= ~IFF_OACTIVE; otus_start(ifp); splx(s); diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 5f650bd6bf6..f94ccb0516b 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.77 2010/10/30 11:47:53 damien Exp $ */ +/* $OpenBSD: if_run.c,v 1.78 2010/10/30 11:52:29 damien Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -2064,22 +2064,23 @@ run_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) struct ifnet *ifp = &sc->sc_ic.ic_if; int s; + s = splnet(); + txq->queued--; + sc->qfullmsk &= ~(1 << data->qid); + if (__predict_false(status != USBD_NORMAL_COMPLETION)) { DPRINTF(("TX status=%d\n", status)); if (status == USBD_STALLED) usbd_clear_endpoint_stall_async(txq->pipeh); ifp->if_oerrors++; + splx(s); return; } - s = splnet(); sc->sc_tx_timer = 0; ifp->if_opackets++; - if (--txq->queued < RUN_TX_RING_COUNT) { - sc->qfullmsk &= ~(1 << data->qid); - ifp->if_flags &= ~IFF_OACTIVE; - run_start(ifp); - } + ifp->if_flags &= ~IFF_OACTIVE; + run_start(ifp); splx(s); } |