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 xfers need to be queued only in urtwn_init.



details:   https://anonhg.NetBSD.org/src-all/rev/72124762209f
branches:  trunk
changeset: 950898:72124762209f
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sun May 03 09:01:31 2020 +1000

description:
xfers need to be queued only in urtwn_init.

diffstat:

 sys/dev/usb/if_urtwn.c |  31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diffs (62 lines):

diff -r 09bad4ccd627 -r 72124762209f sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Sun May 03 08:38:56 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c    Sun May 03 09:01:31 2020 +1000
@@ -388,7 +388,6 @@
        struct usb_attach_arg *uaa = aux;
        char *devinfop;
        const struct urtwn_dev *dev;
-       struct urtwn_rx_data *data;
        usb_device_request_t req;
        // NNN loop below size_t i;
        int error;
@@ -617,20 +616,6 @@
                goto fail;
        }
 
-       /* Queue Rx xfers. */
-       for (size_t j = 0; j < sc->rx_npipe; j++) {
-               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);
-                       error = usbd_transfer(data->xfer);
-                       if (__predict_false(error != USBD_NORMAL_COMPLETION &&
-                           error != USBD_IN_PROGRESS))
-                               goto fail;
-               }
-               mutex_exit(&sc->sc_rx_mtx);
-       }
        return;
 
  fail:
@@ -5537,6 +5522,7 @@
        struct ieee80211com *ic = vap->iv_ic;
        struct ifmediareq imr;
        struct urtwn_softc *sc = ic->ic_softc;
+       struct urtwn_rx_data *data;
        uint32_t reg;
        int error;
 
@@ -5752,6 +5738,21 @@
        /* Set default channel. */
        urtwn_set_chan(sc, ic->ic_curchan, IEEE80211_HTINFO_2NDCHAN_NONE);
 
+       /* Queue Rx xfers. */
+       for (size_t j = 0; j < sc->rx_npipe; j++) {
+               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);
+                       error = usbd_transfer(data->xfer);
+                       if (__predict_false(error != USBD_NORMAL_COMPLETION &&
+                           error != USBD_IN_PROGRESS))
+                               goto fail;
+               }
+               mutex_exit(&sc->sc_rx_mtx);
+       }
+
        /* We're ready to go. */
        ifp->if_flags &= ~IFF_OACTIVE;
        ifp->if_flags |= IFF_RUNNING;



Home | Main Index | Thread Index | Old Index