summaryrefslogtreecommitdiff
path: root/sys/src/cmd/usb/kb/kb.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-06-28 03:51:47 +0200
committercinap_lenrek <cinap_lenrek@localhost>2011-06-28 03:51:47 +0200
commit81a19e0dc53e0c9b13c0c7e05e0d4f39af934832 (patch)
treeb47f20f20fd9f529d3e06ed24dfcb299179147cc /sys/src/cmd/usb/kb/kb.c
parent6d91601a775db1fa873f64f90da764ece2c2da6d (diff)
parent59f388e947b7f18165c1b3054df41bf540caa129 (diff)
merge
Diffstat (limited to 'sys/src/cmd/usb/kb/kb.c')
-rw-r--r--sys/src/cmd/usb/kb/kb.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/src/cmd/usb/kb/kb.c b/sys/src/cmd/usb/kb/kb.c
index bf4918cc4..0880f5b51 100644
--- a/sys/src/cmd/usb/kb/kb.c
+++ b/sys/src/cmd/usb/kb/kb.c
@@ -124,6 +124,12 @@ setbootproto(KDev* f, int eid)
return usbcmd(f->dev, r, Setproto, Bootproto, id, nil, 0);
}
+static int
+setleds(KDev* f, int eid, uchar leds)
+{
+ return usbcmd(f->dev, Rh2d|Rclass|Riface, Setreport, Reportout, 0, &leds, 1);
+}
+
/*
* Try to recover from a babble error. A port reset is the only way out.
* BUG: we should be careful not to reset a bundle with several devices.
@@ -537,7 +543,10 @@ kbstart(Dev *d, Ep *ep, Kin *in, void (*f)(void*), int accel)
kd->ep = nil;
return;
}
-
+ if(setleds(kd, ep->id, 0) < 0){
+ fprint(2, "kb: %s: setleds: %r\n", d->dir);
+ return;
+ }
incref(d);
proccreate(f, kd, Stack);
}