diff options
author | le <le@FreeBSD.org> | 2004-06-26 10:35:10 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2004-06-26 10:35:10 +0000 |
commit | 1255e60c4d80338ad1bef8f82845886b69b802bf (patch) | |
tree | 570cc786c69ffbcba2d2ad69188c6cb886c21324 /sys/dev/usb/ugen.c | |
parent | 1c3c0bb4350c49fb8582a9327f875a5bbf17dc8b (diff) | |
download | FreeBSD-src-1255e60c4d80338ad1bef8f82845886b69b802bf.zip FreeBSD-src-1255e60c4d80338ad1bef8f82845886b69b802bf.tar.gz |
MFNetBSD.
uhid.c (1.61), author: jdolecek
add support for USB_GET_DEVICEINFO and USB_GET_STRING_DESC ioctls,
with same meaning as for ugen(4)
usbdi_util.h (1.29), usb_quirks.c (1.50), uhid.c (1.62),
ugen.c (1.68), usb_subr.c (1.114) author: mycroft
Yes, some devices return incorrect lengths in their string
descriptors. Rather than losing, do what Windows does: just
request the maximum size, and allow a shorter response. Obsoletes
the need for UQ_NO_STRINGS, and therefore these "quirks" are removed.
usb_subr.c (1.116), author: mycroft
In the "seemed like a good idea until I found the fatal flaw"
department... Attempting to read a maximum-size string descriptor
causes my kue device to go completely apeshit. So, go back to the
original method, but allow the device to return a shorter string than
it claimed.
Obtained from: NetBSD
Diffstat (limited to 'sys/dev/usb/ugen.c')
-rw-r--r-- | sys/dev/usb/ugen.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 81ae5f2..0a8e062 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -4,6 +4,7 @@ * $NetBSD: ugen.c,v 1.61 2002/09/23 05:51:20 simonb Exp $ * $NetBSD: ugen.c,v 1.64 2003/06/28 14:21:46 darrenr Exp $ * $NetBSD: ugen.c,v 1.65 2003/06/29 22:30:56 fvdl Exp $ + * $NetBSD: ugen.c,v 1.68 2004/06/23 02:30:52 mycroft Exp $ */ #include <sys/cdefs.h> @@ -1311,13 +1312,15 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, free(cdesc, M_TEMP); return (error); } - case USB_GET_STRING_DESC: + case USB_GET_STRING_DESC: { + int len; si = (struct usb_string_desc *)addr; err = usbd_get_string_desc(sc->sc_udev, si->usd_string_index, - si->usd_language_id, &si->usd_desc); + si->usd_language_id, &si->usd_desc, &len); if (err) return (EINVAL); break; + } case USB_DO_REQUEST: { struct usb_ctl_request *ur = (void *)addr; |