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 Rx / Tx timeouts for usbwifi.
details: https://anonhg.NetBSD.org/src-all/rev/0b482fe1e2e8
branches: trunk
changeset: 361079:0b482fe1e2e8
user: Nathanial Sloss <nat%netbsd.org@localhost>
date: Sun Jan 02 12:10:22 2022 +1100
description:
Rx / Tx timeouts for usbwifi.
Add the provision for setting usb transfer timeouts to usbwifi.
Use timeouts that existed in the wifi drivers before usbwifi conversion.
diffstat:
sys/dev/usb/if_run.c | 2 ++
sys/dev/usb/if_urtwn.c | 2 ++
sys/dev/usb/usbwifi.c | 9 +++++----
sys/dev/usb/usbwifi.h | 3 +++
4 files changed, 12 insertions(+), 4 deletions(-)
diffs (78 lines):
diff -r d03f4fbd4896 -r 0b482fe1e2e8 sys/dev/usb/if_run.c
--- a/sys/dev/usb/if_run.c Sun Jan 02 12:03:23 2022 +1100
+++ b/sys/dev/usb/if_run.c Sun Jan 02 12:10:22 2022 +1100
@@ -604,6 +604,8 @@
sc->sc_uw.uw_ops = &run_ops;
sc->sc_uw.uw_rx_xfer_flags = USBD_SHORT_XFER_OK;
sc->sc_uw.uw_tx_xfer_flags = USBD_FORCE_SHORT_XFER;
+ sc->sc_uw.uw_tx_xfer_timeout = RUN_TX_TIMEOUT;
+ sc->sc_uw.uw_rx_xfer_timeout = USBD_NO_TIMEOUT;
sc->sc_uw.uw_rx_bufsz = RUN_MAX_RXSZ;
sc->sc_uw.uw_tx_bufsz = RUN_MAX_TXSZ;
sc->sc_uw.uw_rx_list_cnt = RUN_RX_RING_COUNT;
diff -r d03f4fbd4896 -r 0b482fe1e2e8 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c Sun Jan 02 12:03:23 2022 +1100
+++ b/sys/dev/usb/if_urtwn.c Sun Jan 02 12:10:22 2022 +1100
@@ -383,6 +383,8 @@
sc->sc_uw.uw_ops = &urtwn_ops;
sc->sc_uw.uw_rx_xfer_flags = USBD_SHORT_XFER_OK;
sc->sc_uw.uw_tx_xfer_flags = USBD_FORCE_SHORT_XFER;
+ sc->sc_uw.uw_tx_xfer_timeout = URTWN_TX_TIMEOUT;
+ sc->sc_uw.uw_rx_xfer_timeout = USBD_NO_TIMEOUT;
sc->sc_uw.uw_rx_bufsz = URTWN_RXBUFSZ; /* size of a single buffer */
sc->sc_uw.uw_tx_bufsz = URTWN_TXBUFSZ; /* for RX/TX */
sc->sc_uw.uw_tx_list_cnt = URTWN_TX_LIST_COUNT; /* max RX/TX buffers */
diff -r d03f4fbd4896 -r 0b482fe1e2e8 sys/dev/usb/usbwifi.c
--- a/sys/dev/usb/usbwifi.c Sun Jan 02 12:03:23 2022 +1100
+++ b/sys/dev/usb/usbwifi.c Sun Jan 02 12:10:22 2022 +1100
@@ -328,7 +328,7 @@
/* Setup new transfer. */
usbd_setup_xfer(xfer, c, c->uwc_buf, uw->uw_rx_bufsz,
- uw->uw_rx_xfer_flags, USBD_NO_TIMEOUT, usbwifi_rxeof);
+ uw->uw_rx_xfer_flags, uw->uw_rx_xfer_timeout, usbwifi_rxeof);
usbd_transfer(xfer);
return;
@@ -480,7 +480,7 @@
if (c->uwc_xfer == NULL) {
int err = usbd_create_xfer(
uwp->uwp_ep[c->uwc_index],
- uw->uw_rx_bufsz, uw->uw_rx_xfer_flags, 0,
+ uw->uw_rx_bufsz, 0, 0,
&c->uwc_xfer);
if (err)
return err;
@@ -539,7 +539,7 @@
usbd_setup_xfer(c->uwc_xfer, c, c->uwc_buf,
uw->uw_rx_bufsz, uw->uw_rx_xfer_flags,
- USBD_NO_TIMEOUT, usbwifi_rxeof);
+ uw->uw_rx_xfer_timeout, usbwifi_rxeof);
usbd_transfer(c->uwc_xfer);
}
}
@@ -839,7 +839,8 @@
}
usbd_setup_xfer(c->uwc_xfer, c, c->uwc_buf, length,
- uw->uw_tx_xfer_flags, 10000, usbwifi_txeof);
+ uw->uw_tx_xfer_flags, uw->uw_tx_xfer_timeout,
+ usbwifi_txeof);
/* Transmit */
usbd_status err = usbd_transfer(c->uwc_xfer);
diff -r d03f4fbd4896 -r 0b482fe1e2e8 sys/dev/usb/usbwifi.h
--- a/sys/dev/usb/usbwifi.h Sun Jan 02 12:03:23 2022 +1100
+++ b/sys/dev/usb/usbwifi.h Sun Jan 02 12:10:22 2022 +1100
@@ -202,7 +202,10 @@
unsigned uw_rx_list_cnt;
unsigned uw_tx_list_cnt;
int uw_rx_xfer_flags;
+ int uw_rx_xfer_timeout;
int uw_tx_xfer_flags;
+ int uw_tx_xfer_timeout;
+
int uw_rxpipes;
int uw_txpipes;
Home |
Main Index |
Thread Index |
Old Index