summaryrefslogtreecommitdiff
path: root/sys/src/9/bcm/usbdwc.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-04-23 20:03:01 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-04-23 20:03:01 +0200
commit41908149de00ab5830c5c72ef3a300a050b2b3bf (patch)
tree21e8c4f1697b73705a50cf35f2cda257ec47acb2 /sys/src/9/bcm/usbdwc.c
parent07bf5a24ab5b702f8b4ee89fb501204aaaa5b17b (diff)
nusb: resolve endpoint id conflict with different input and output types
ftrvxmtrx repots devices that use the endpoint number for input and output of different types like: nusb/ether: parsedesc endpoint 5[7] 07 05 81 03 08 00 09 # ep1 in intr nusb/ether: parsedesc endpoint 5[7] 07 05 82 02 00 02 00 nusb/ether: parsedesc endpoint 5[7] 07 05 01 02 00 02 00 # ep1 out bulk the previous change tried to work arround this but had the concequence that only the lastly defined endpoint was usable. this change addresses the issue by allowing up to 32 endpoints per device (16 output + 16 input endpoints) in devusb. the hci driver will ignore the 4th bit and will only use the lower 4 bits as endpoint address when talking to the usb device. when we encounter a conflict, we map the input endpoint to the upper id range 16..31 and the output endpoint to id 0..15 so two distinct endpoints are created.
Diffstat (limited to 'sys/src/9/bcm/usbdwc.c')
-rw-r--r--sys/src/9/bcm/usbdwc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/9/bcm/usbdwc.c b/sys/src/9/bcm/usbdwc.c
index 652b2ceea..a7292ba5f 100644
--- a/sys/src/9/bcm/usbdwc.c
+++ b/sys/src/9/bcm/usbdwc.c
@@ -115,10 +115,10 @@ chansetup(Hostchan *hc, Ep *ep)
hcc = 0;
break;
default:
- hcc = ep->dev->nb<<ODevaddr;
+ hcc = (ep->dev->nb&Devmax)<<ODevaddr;
break;
}
- hcc |= ep->maxpkt | 1<<OMulticnt | ep->nb<<OEpnum;
+ hcc |= ep->maxpkt | 1<<OMulticnt | (ep->nb&Epmax)<<OEpnum;
switch(ep->ttype){
case Tctl:
hcc |= Epctl;