summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/cmd/nusb/joy/joy.c8
-rw-r--r--sys/src/cmd/nusb/kb/kb.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/src/cmd/nusb/joy/joy.c b/sys/src/cmd/nusb/joy/joy.c
index b04028507..0cb254eaf 100644
--- a/sys/src/cmd/nusb/joy/joy.c
+++ b/sys/src/cmd/nusb/joy/joy.c
@@ -222,6 +222,14 @@ setproto(KDev *f, int eid)
proto = Reportproto;
}else
kbfatal(f, "no report");
+
+ /*
+ * if a HID's subclass code is 1 (boot mode), it will support
+ * setproto, otherwise it is not guaranteed to.
+ */
+ if(Subclass(f->dev->usb->ep[eid]->iface->csp) != 1)
+ return 0;
+
return usbcmd(f->dev, Rh2d|Rclass|Riface, Setproto, proto, id, nil, 0);
}
diff --git a/sys/src/cmd/nusb/kb/kb.c b/sys/src/cmd/nusb/kb/kb.c
index 3e2913e34..7b9ed9f2c 100644
--- a/sys/src/cmd/nusb/kb/kb.c
+++ b/sys/src/cmd/nusb/kb/kb.c
@@ -368,6 +368,14 @@ setproto(Hiddev *f, int eid)
}
proto = Bootproto;
}
+
+ /*
+ * if a HID's subclass code is 1 (boot mode), it will support
+ * setproto, otherwise it is not guaranteed to.
+ */
+ if(Subclass(iface->csp) != 1)
+ return 0;
+
return usbcmd(f->dev, Rh2d|Rclass|Riface, Setproto, proto, iface->id, nil, 0);
}