diff options
author | Yojiro Uo <yuo@cvs.openbsd.org> | 2009-11-23 11:10:17 +0000 |
---|---|---|
committer | Yojiro Uo <yuo@cvs.openbsd.org> | 2009-11-23 11:10:17 +0000 |
commit | 9725ed6e5ef5757f2080bd77f7fb2596a2bb5a29 (patch) | |
tree | 5ff027a49852a05e3ca24c24d362faf06d214879 | |
parent | 430e9242705ced4e1731c1a11b2936ecb1338c9f (diff) |
add USB_GET_DEVICEINFO and USB_GET_STRING_DESC ioctl to the uhid(4).
ok jsg@ deraadt@
-rw-r--r-- | sys/dev/usb/uhid.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index f8eb2ad90e5..6ebeba10455 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.46 2009/11/09 17:53:39 nicm Exp $ */ +/* $OpenBSD: uhid.c,v 1.47 2009/11/23 11:10:16 yuo Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -511,6 +511,22 @@ uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr, *(int *)addr = sc->sc_hdev.sc_report_id; break; + case USB_GET_DEVICEINFO: + usbd_fill_deviceinfo(sc->sc_hdev.sc_parent->sc_udev, + (struct usb_device_info *)addr, 1); + break; + + case USB_GET_STRING_DESC: + { + struct usb_string_desc *si = (struct usb_string_desc *)addr; + err = usbd_get_string_desc(sc->sc_hdev.sc_parent->sc_udev, + si->usd_string_index, + si->usd_language_id, &si->usd_desc, &size); + if (err) + return (EINVAL); + break; + } + default: return (EINVAL); } |