summaryrefslogtreecommitdiff
path: root/sys/src/9/port/devusb.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2022-07-31 13:12:17 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2022-07-31 13:12:17 +0000
commit9672be80e84cb3253dc999fbaa5dbc7913a17e0e (patch)
tree69fa2962395657faccf1b17413ff4ce58240f53b /sys/src/9/port/devusb.c
parent30dcf55ee221b986aee6d428b4da431f6174c66b (diff)
usb: fix ehci isochronous "in" split transactions
For "in" transactions, the "Total Bytes to Transfer" field in the siTD is decremented by the controller by the actual transfer size, so what remains in the field is the residue number of bytes. Also, handle restart when we get a zero byte read on a isochronous "in" endpoint in devusb itself (removing the restart code for xhci drivers). This fixes audio recording with a usb1.1 audio device connected to ehci controller.
Diffstat (limited to 'sys/src/9/port/devusb.c')
-rw-r--r--sys/src/9/port/devusb.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/src/9/port/devusb.c b/sys/src/9/port/devusb.c
index e395df265..beb55055c 100644
--- a/sys/src/9/port/devusb.c
+++ b/sys/src/9/port/devusb.c
@@ -1199,19 +1199,22 @@ usbread(Chan *c, void *a, long n, vlong offset)
error(Enotconf);
case Tctl:
nr = rhubread(ep, a, n);
- if(nr >= 0){
- n = nr;
+ if(nr >= 0)
break;
- }
/* else fall */
default:
ddeprint("\nusbread q %#x fid %d cnt %ld off %lld\n",q,c->fid,n,offset);
- n = ep->hp->epread(ep, a, n);
+ Again:
+ nr = ep->hp->epread(ep, a, n);
+ if(nr == 0 && ep->ttype == Tiso){
+ tsleep(&up->sleep, return0, nil, 2*ep->pollival);
+ goto Again;
+ }
break;
}
poperror();
putep(ep);
- return n;
+ return nr;
}
/*