summaryrefslogtreecommitdiff
path: root/sys/src/cmd/nusb/lib/parse.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-02-10 20:08:13 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2021-02-10 20:08:13 +0100
commit2f28aaac65b4dde059f393222bfd2f939d83f9f5 (patch)
tree3767e9061c1c2e39860b580005e8e9cdd59e7922 /sys/src/cmd/nusb/lib/parse.c
parentd7ade692c8c3c96bae6828f63afb1b19765b5589 (diff)
nusb: don't create rw iso endpoints (by Michael Forney)
There may be two iso endpoints with the same ID if it is asynchronous or adaptive (one for data, one for feedback), and rw iso endpoints are unusable (error out with "iso i/o is half-duplex").
Diffstat (limited to 'sys/src/cmd/nusb/lib/parse.c')
-rw-r--r--sys/src/cmd/nusb/lib/parse.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/src/cmd/nusb/lib/parse.c b/sys/src/cmd/nusb/lib/parse.c
index 916da0b3e..4b795bf7c 100644
--- a/sys/src/cmd/nusb/lib/parse.c
+++ b/sys/src/cmd/nusb/lib/parse.c
@@ -111,8 +111,6 @@ parseendpt(Usbdev *d, Conf *c, Iface *ip, Altc *altc, uchar *b, int n, Ep **epp)
return -1;
}
dep = (DEp *)b;
- altc->attrib = dep->bmAttributes; /* here? */
- altc->interval = dep->bInterval;
type = dep->bmAttributes & 0x03;
addr = dep->bEndpointAddress;
@@ -145,13 +143,18 @@ parseendpt(Usbdev *d, Conf *c, Iface *ip, Altc *altc, uchar *b, int n, Ep **epp)
ep->maxpkt = GET2(dep->wMaxPacketSize);
ep->ntds = 1 + ((ep->maxpkt >> 11) & 3);
ep->maxpkt &= 0x7FF;
- altc->maxpkt = ep->maxpkt;
- altc->ntds = ep->ntds;
ep->addr = addr;
ep->type = type;
ep->isotype = (dep->bmAttributes>>2) & 0x03;
+ ep->isousage = (dep->bmAttributes>>4) & 0x03;
ep->conf = c;
ep->iface = ip;
+ if(ep->type != Eiso || ep->isousage == Edata || ep->isousage == Eimplicit){
+ altc->attrib = dep->bmAttributes;
+ altc->interval = dep->bInterval;
+ altc->maxpkt = ep->maxpkt;
+ altc->ntds = ep->ntds;
+ }
for(i = 0; i < nelem(ip->ep); i++)
if(ip->ep[i] == nil)
break;