Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/usb Simplify queueing of rx transfers.



details:   https://anonhg.NetBSD.org/src-all/rev/83b084cf3eb3
branches:  trunk
changeset: 947927:83b084cf3eb3
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sun May 03 07:04:28 2020 +1000

description:
Simplify queueing of rx transfers.

diffstat:

 sys/dev/usb/if_urtwn.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 35eed5d1f923 -r 83b084cf3eb3 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Sun May 03 06:44:30 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c    Sun May 03 07:04:28 2020 +1000
@@ -5482,7 +5482,6 @@
        struct urtwn_softc *sc = ic->ic_softc;
        struct urtwn_rx_data *data;
        uint32_t reg;
-       size_t i;
        int error;
 
        DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
@@ -5711,8 +5710,8 @@
 
        /* Queue Rx xfers. */
        for (size_t j = 0; j < sc->rx_npipe; j++) {
-               for (i = 0; i < URTWN_RX_LIST_COUNT/ sc->rx_npipe; i++) {
-                       data = &sc->rx_data[j][i];
+               mutex_enter(&sc->sc_rx_mtx); 
+               TAILQ_FOREACH(data, &sc->rx_free_list[j], next) {
                        usbd_setup_xfer(data->xfer, data, data->buf,
                            URTWN_RXBUFSZ, USBD_SHORT_XFER_OK, USBD_NO_TIMEOUT,
                            urtwn_rxeof);
@@ -5721,6 +5720,7 @@
                            error != USBD_IN_PROGRESS))
                                goto fail;
                }
+               mutex_exit(&sc->sc_rx_mtx);
        }
 
        /* We're ready to go. */



Home | Main Index | Thread Index | Old Index