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 Backed out changeset f32a994bd774
details: https://anonhg.NetBSD.org/src-all/rev/3c185a0d2ac0
branches: trunk
changeset: 376732:3c185a0d2ac0
user: Nathanial Sloss <nat%netbsd.org@localhost>
date: Sun May 03 21:46:42 2020 +1000
description:
Backed out changeset f32a994bd774
diffstat:
sys/dev/usb/if_urtwn.c | 34 ++++++++++++++++------------------
1 files changed, 16 insertions(+), 18 deletions(-)
diffs (73 lines):
diff -r 7f10bc418a90 -r 3c185a0d2ac0 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c Sun May 03 20:45:26 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c Sun May 03 21:46:42 2020 +1000
@@ -603,6 +603,21 @@ urtwn_attach(device_t parent, device_t s
goto fail;
}
+ /* Allocate Tx/Rx buffers. */
+ error = urtwn_alloc_rx_list(sc);
+ if (error != 0) {
+ aprint_error_dev(sc->sc_dev,
+ "could not allocate Rx buffers\n");
+ goto fail;
+ }
+
+ error = urtwn_alloc_tx_list(sc);
+ if (error != 0) {
+ aprint_error_dev(sc->sc_dev,
+ "could not allocate Tx buffers\n");
+ goto fail;
+ }
+
return;
fail:
@@ -886,8 +901,8 @@ urtwn_alloc_tx_list(struct urtwn_softc *
return 0;
fail:
+ urtwn_free_tx_list(sc);
mutex_exit(&sc->sc_tx_mtx);
- urtwn_free_tx_list(sc);
return error;
}
@@ -5729,21 +5744,6 @@ urtwn_init(struct ifnet *ifp)
/* Set default channel. */
urtwn_set_chan(sc, ic->ic_curchan, IEEE80211_HTINFO_2NDCHAN_NONE);
- /* Allocate Tx/Rx buffers. */
- error = urtwn_alloc_rx_list(sc);
- if (error != 0) {
- aprint_error_dev(sc->sc_dev,
- "could not allocate Rx buffers\n");
- goto fail;
- }
-
- error = urtwn_alloc_tx_list(sc);
- if (error != 0) {
- aprint_error_dev(sc->sc_dev,
- "could not allocate Tx buffers\n");
- goto fail;
- }
-
/* Queue Rx xfers. */
for (size_t j = 0; j < sc->rx_npipe; j++) {
mutex_enter(&sc->sc_rx_mtx);
@@ -5822,7 +5822,6 @@ urtwn_stop(struct ifnet *ifp, int disabl
usbd_abort_pipe(sc->tx_pipe[i]);
}
mutex_exit(&sc->sc_tx_mtx);
- urtwn_free_tx_list(sc);
mutex_enter(&sc->sc_rx_mtx);
/* Stop Rx pipe. */
@@ -5831,7 +5830,6 @@ urtwn_stop(struct ifnet *ifp, int disabl
usbd_abort_pipe(sc->rx_pipe[i]);
}
mutex_exit(&sc->sc_rx_mtx);
- urtwn_free_rx_list(sc);
sc->sc_running = false;
if (disable)
Home |
Main Index |
Thread Index |
Old Index