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 Total number of buffers are shared by all ...



details:   https://anonhg.NetBSD.org/src-all/rev/e14ccbd00916
branches:  trunk
changeset: 375406:e14ccbd00916
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sun May 03 06:44:30 2020 +1000

description:
Total number of buffers are shared by all pipes.

diffstat:

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

diffs (30 lines):

diff -r 17d799fbec34 -r e14ccbd00916 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Fri May 01 11:36:56 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c    Sun May 03 06:44:30 2020 +1000
@@ -800,7 +800,7 @@ urtwn_alloc_rx_list(struct urtwn_softc *
 
        for (size_t j = 0; j < sc->rx_npipe; j++) {
                TAILQ_INIT(&sc->rx_free_list[j]);
-               for (i = 0; i < URTWN_RX_LIST_COUNT; i++) {
+               for (i = 0; i < URTWN_RX_LIST_COUNT / sc->rx_npipe; i++) {
                        data = &sc->rx_data[j][i];
 
                        data->sc = sc;  /* Backpointer for callbacks. */
@@ -857,7 +857,7 @@ urtwn_alloc_tx_list(struct urtwn_softc *
        mutex_enter(&sc->sc_tx_mtx);
        for (size_t j = 0; j < sc->tx_npipe; j++) {
                TAILQ_INIT(&sc->tx_free_list[j]);
-               for (i = 0; i < URTWN_TX_LIST_COUNT; i++) {
+               for (i = 0; i < URTWN_TX_LIST_COUNT / sc->tx_npipe; i++) {
                        data = &sc->tx_data[j][i];
 
                        data->sc = sc;  /* Backpointer for callbacks. */
@@ -5743,7 +5743,7 @@ urtwn_init(struct ifnet *ifp)
 
        /* Queue Rx xfers. */
        for (size_t j = 0; j < sc->rx_npipe; j++) {
-               for (i = 0; i < URTWN_RX_LIST_COUNT; i++) {
+               for (i = 0; i < URTWN_RX_LIST_COUNT/ sc->rx_npipe; i++) {
                        data = &sc->rx_data[j][i];
                        usbd_setup_xfer(data->xfer, data, data->buf,
                            URTWN_RXBUFSZ, USBD_SHORT_XFER_OK, USBD_NO_TIMEOUT,



Home | Main Index | Thread Index | Old Index