diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-10-31 20:40:13 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-10-31 20:40:13 +0100 |
commit | bb33ba6b9af392e39d6e4f49814384cb825cc90f (patch) | |
tree | 4dcb86503b743395ff0517297e8bfe097dc372a5 /sys/src/cmd/nusb | |
parent | 634c55543a24e459900fdbad229eb01baae63680 (diff) |
nusb/kb: dont set boot protocol on HidCSP interface when we failed to read report descriptor (thanks aap_)
this fixes wireless keyboard/mouse on raspi.
Diffstat (limited to 'sys/src/cmd/nusb')
-rw-r--r-- | sys/src/cmd/nusb/kb/kb.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/src/cmd/nusb/kb/kb.c b/sys/src/cmd/nusb/kb/kb.c index 36d2793d0..f0f4eb5cd 100644 --- a/sys/src/cmd/nusb/kb/kb.c +++ b/sys/src/cmd/nusb/kb/kb.c @@ -304,7 +304,6 @@ setproto(Hiddev *f, int eid) int id, proto; Iface *iface; - proto = Bootproto; iface = f->dev->usb->ep[eid]->iface; id = iface->id; f->nrep = usbcmd(f->dev, Rd2h|Rstd|Riface, Rgetdesc, Dreport<<8, id, @@ -323,13 +322,20 @@ setproto(Hiddev *f, int eid) } proto = Reportproto; } else { - if(iface->csp == KbdCSP){ + switch(iface->csp){ + case KbdCSP: f->nrep = sizeof(kbdbootrep); memmove(f->rep, kbdbootrep, f->nrep); - } else { + break; + case PtrCSP: f->nrep = sizeof(ptrbootrep); memmove(f->rep, ptrbootrep, f->nrep); + break; + default: + werrstr("no report descriptor"); + return -1; } + proto = Bootproto; } return usbcmd(f->dev, Rh2d|Rclass|Riface, Setproto, proto, id, nil, 0); } |