-remove "bDescriptorSubtype" from usb_descriptor_t - this is not part

of the common USB spec
-Fix length of string descriptor: Descriptors have only a byte field
 for length, so 2*127+2 is already too much. Some devices obviously
 don't reply to string read requests with impossible length which
 happened if "sizeof(usb_string_descriptor_t) was used.
This commit is contained in:
drochner 2007-02-26 13:58:36 +00:00
parent 1b5f35a8e4
commit 3ccaca911b
1 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.h,v 1.76 2007/01/19 22:46:21 drochner Exp $ */
/* $NetBSD: usb.h,v 1.77 2007/02/26 13:58:36 drochner Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */
/*
@ -183,7 +183,6 @@ typedef struct {
typedef struct {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
} UPACKED usb_descriptor_t;
typedef struct {
@ -266,7 +265,7 @@ typedef struct {
typedef struct {
uByte bLength;
uByte bDescriptorType;
uWord bString[127];
uWord bString[126];
} UPACKED usb_string_descriptor_t;
#define USB_MAX_STRING_LEN 128
#define USB_LANGUAGE_TABLE 0 /* # of the string language id table */