tech-net archive

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

Call for testers of urtwn/xhci patches



Hi,

These changes have already made it into -current.

I would like to get as many people testing the urtwn/xhci changes against -11
so I can be assured there are no issues and request pullups.

It at all possible those running -10 that would like to test these changes 
against -10 please do, it would be most helpful.

gdt and hgutch have already been helping with this but the more hands the 
better.

The patch can be found at:

http://ftp.netbsd.org/pub/misc/nat/xchi-urtwn-noids.diff

Also attached for convienence.


Best regards and TIA,

Nat
--- a/sys/dev/usb/if_urtwn.c	Wed Aug 20 18:33:09 2025 +0000
+++ b/sys/dev/usb/if_urtwn.c	Sun Aug 24 09:45:29 2025 +0000
@@ -760,6 +760,7 @@
 			data = &sc->rx_data[j][i];
 
 			data->sc = sc;	/* Backpointer for callbacks. */
+			data->pidx = j;
 
 			error = usbd_create_xfer(sc->rx_pipe[j], URTWN_RXBUFSZ,
 			    0, 0, &data->xfer);
@@ -2554,7 +2555,7 @@
 	size_t pidx = data->pidx;
 	uint32_t rxdw0;
 	uint8_t *buf;
-	int len, totlen, pktlen, infosz, npkts;
+	int len, totlen, pktlen, infosz, npkts, pktspacing;
 
 	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 	DPRINTFN(DBG_RX, "status=%jd", status, 0, 0, 0);
@@ -2591,8 +2592,13 @@
 	if (npkts != 0)
 		rnd_add_uint32(&sc->rnd_source, npkts);
 
+	if (ISSET(sc->chip, URTWN_CHIP_92EU))
+		pktspacing = 8;
+	else
+		pktspacing = 128;
+
 	/* Process all of them. */
-	while (npkts-- > 0) {
+	while (npkts-- > 0 && len > 0) {
 		if (__predict_false(len < (int)sizeof(*stat))) {
 			DPRINTFN(DBG_RX, "len(%jd) is short than header",
 			    len, 0, 0, 0);
@@ -2620,8 +2626,7 @@
 		/* Process 802.11 frame. */
 		urtwn_rx_frame(sc, buf, pktlen);
 
-		/* Next chunk is 128-byte aligned. */
-		totlen = roundup2(totlen, 128);
+		totlen = roundup2(totlen, pktspacing);
 		buf += totlen;
 		len -= totlen;
 	}
@@ -3002,6 +3007,7 @@
 			device_printf(sc->sc_dev,
 			    "unable to transmit packet\n");
 			if_statinc(ifp, if_oerrors);
+			urtwn_put_tx_data(sc, data);
 			continue;
 		}
 		m_freem(m);
@@ -3367,7 +3373,7 @@
 	if (sc->chip & URTWN_CHIP_88E)
 		pktbuf_count = R88E_TXPKTBUF_COUNT;
 	else if (sc->chip & URTWN_CHIP_92EU)
-		pktbuf_count = R88E_TXPKTBUF_COUNT;
+		pktbuf_count = R92E_TXPKTBUF_COUNT;
 	else
 		pktbuf_count = R92C_TXPKTBUF_COUNT;
 
--- a/sys/dev/usb/xhci.c	Wed Aug 20 18:33:09 2025 +0000
+++ b/sys/dev/usb/xhci.c	Sun Aug 24 09:45:29 2025 +0000
@@ -4794,6 +4794,13 @@
 	    XHCI_TRB_3_IOC_BIT;
 	xhci_xfer_put_trb(xx, i++, parameter, status, control);
 
+	if (!isread && (xfer->ux_flags & USBD_FORCE_SHORT_XFER)) {
+		status = XHCI_TRB_2_IRQ_SET(0) |
+		    XHCI_TRB_2_TDSZ_SET(0) |
+		    XHCI_TRB_2_BYTES_SET(0);
+		xhci_xfer_put_trb(xx, i++, parameter, status, control);
+	}
+
 	if (!polling)
 		mutex_enter(&tr->xr_lock);
 	xhci_ring_put_xfer(sc, tr, xx, i);


Home | Main Index | Thread Index | Old Index