diff options
| author | 2010-10-30 11:52:29 +0000 | |
|---|---|---|
| committer | 2010-10-30 11:52:29 +0000 | |
| commit | ba34d0501c2b581ee696c00ab656dfdd2d3abf2c (patch) | |
| tree | c6d560f0be8ffbfecd3c6ea780444606bfa376f0 /sys/dev/usb/if_run.c | |
| 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.
Diffstat (limited to 'sys/dev/usb/if_run.c')
| -rw-r--r-- | sys/dev/usb/if_run.c | 15 |
1 files changed, 8 insertions, 7 deletions
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); } |
