On Sat, May 29, 2010 at 11:07 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > On Sat, 29 May 2010, David Brownell wrote: > >> --- On Sat, 5/29/10, Danny Milosavljevic <danny_milo@xxxxxxxxx> wrote: >> >> >> > ** UNRECOGNIZED: >> > 09 21 10 01 00 01 22 24 00 >> >> Because that code doesn't recognize >> descriptor type 0x21 at that location >> in a configuration descriptor. >> >> Without further investigation, I couldn't >> say if that's a bug in the descriptor or >> is instead something "lsusb" should have >> been able to decode. > > According to include/linux/usb/ch9.h, descriptor type 0x21 is > USB_DT_WIRE_ADAPTER. I guess that's from the Wireless USB spec, but I > don't know what it means. > > Anyway, it's not widely used at the moment so it's not surprising that > lsusb doesn't recognize it. > I think this has nothing to do with Wireless USB. I just tried it for a simple Logitech Mouse. And same thing happens. Then I tried PICKit 2, it has same problem. I think there is an issue with the lsusb descriptor parser for the HID device. And Google has many more such samples. mcuee@ubuntu64-laptop:~$ lsusb -vvv -d 046d:c058 Bus 003 Device 002: ID 046d:c058 Logitech, Inc. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x046d Logitech, Inc. idProduct 0xc058 bcdDevice 54.00 iManufacturer 1 Logitech iProduct 2 USB Optical Mouse iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 34 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 98mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 1 Boot Interface Subclass bInterfaceProtocol 2 Mouse iInterface 0 ** UNRECOGNIZED: 09 21 11 01 00 01 22 43 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0006 1x 6 bytes bInterval 10 Device Status: 0x0000 (Bus Powered) Bus 003 Device 007: ID 04d8:0033 Microchip Technology, Inc. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x04d8 Microchip Technology, Inc. idProduct 0x0033 bcdDevice 0.02 iManufacturer 1 Microchip Technology Inc. iProduct 2 PICkit 2 Microcontroller Programmer iSerial 3 pk2new bNumConfigurations 2 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 41 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 2 PICkit 2 Microcontroller Programmer bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None iInterface 0 ** UNRECOGNIZED: 09 21 01 00 00 01 22 1d 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 2 iConfiguration 4 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 1 The USB descriptor of PICKit 2 is like this (from the firmware source code). /** C O N S T A N T S ************************************************/ #pragma romdata /* Device Descriptor */ rom USB_DEV_DSC device_dsc= { sizeof(USB_DEV_DSC), // Size of this descriptor in bytes DSC_DEV, // DEVICE descriptor type 0x0200, // USB Spec Release Number in BCD format 0x00, // Class Code 0x00, // Subclass code 0x00, // Protocol code EP0_BUFF_SIZE, // Max packet size for EP0, see usbcfg.h 0x04D8, // Vendor ID = 1240 0x0033, // Product ID = 51 0x0002, // Device release number in BCD format 0x01, // Manufacturer string index 0x02, // Product string index SERIAL_UNITID_DSC, // Device serial number string index 0x02 // Number of possible configurations }; /* Configuration 1 Descriptor */ CFG01={ /* Configuration Descriptor */ sizeof(USB_CFG_DSC), // Size of this descriptor in bytes DSC_CFG, // CONFIGURATION descriptor type sizeof(cfg01), // Total length of data for this cfg 1, // Number of interfaces in this cfg 1, // Index value of this configuration 2, // Configuration string index _DEFAULT, // Attributes, see usbdefs_std_dsc.h 50, // Max power consumption (2X mA) /* Interface Descriptor */ sizeof(USB_INTF_DSC), // Size of this descriptor in bytes DSC_INTF, // INTERFACE descriptor type 0, // Interface Number 0, // Alternate Setting Number 2, // Number of endpoints in this intf HID_INTF, // Class code 0, // Subclass code 0, // Protocol code 0, // Interface string index /* HID Class-Specific Descriptor */ sizeof(USB_HID_DSC), // Size of this descriptor in bytes DSC_HID, // HID descriptor type 0x0001, // HID Spec Release Number in BCD format 0x00, // Country Code (0x00 for Not supported) 1, // Number of class descriptors, see usbcfg.h DSC_RPT, // Report descriptor type sizeof(hid_rpt01), // Size of the report descriptor /* Endpoint Descriptor 1 in */ sizeof(USB_EP_DSC), DSC_EP, _EP01_IN, _INT, HID_INT_IN_EP_SIZE, 0x01, /* Endpoint Descriptor 1 out */ sizeof(USB_EP_DSC), DSC_EP, _EP01_OUT, _INT, HID_INT_OUT_EP_SIZE, 0x01 }; /* Configuration 2 Descriptor */ CFG02={ /* Configuration Descriptor */ sizeof(USB_CFG_DSC), // Size of this descriptor in bytes DSC_CFG, // CONFIGURATION descriptor type sizeof(cfg02), // Total length of data for this cfg 1, // Number of interfaces in this cfg 2, // Index value of this configuration 4, // Configuration string index _DEFAULT, // Attributes, see usbdefs_std_dsc.h 50, // Max power consumption (2X mA) /* Interface Descriptor */ sizeof(USB_INTF_DSC), // Size of this descriptor in bytes DSC_INTF, // INTERFACE descriptor type 0, // Interface Number 0, // Alternate Setting Number 2, // Number of endpoints in this intf 0xFF, // Class code (vendor defined) 0, // Subclass code 0, // Protocol code 0, // Interface string index /* Endpoint Descriptor 1 in */ sizeof(USB_EP_DSC), DSC_EP, _EP01_IN, _INT, HID_INT_IN_EP_SIZE, 0x01, /* Endpoint Descriptor 1 out */ sizeof(USB_EP_DSC), DSC_EP, _EP01_OUT, _INT, HID_INT_OUT_EP_SIZE, 0x01 }; rom struct{byte bLength;byte bDscType;word string[1];}sd000={ sizeof(sd000),DSC_STR,0x0409}; rom struct{byte bLength;byte bDscType;word string[25];}sd001={ sizeof(sd001),DSC_STR, 'M','i','c','r','o','c','h','i','p',' ','T','e','c','h','n','o','l','o','g','y',' ','I','n','c','.'}; rom struct{byte bLength;byte bDscType;word string[35];}sd002={ sizeof(sd002),DSC_STR, 'P','I','C','k','i','t',' ','2',' ','M','i','c','r','o','c','o','n','t','r','o','l','l','e','r',' ','P','r','o','g','r','a','m','m','e','r'}; //rom struct{byte bLength;byte bDscType;word string[10];}sd003={ //sizeof(sd003),DSC_STR, //'O','l','H','o', 's', 's', 'X', 0, 0, 0}; //rom struct{byte bLength;byte bDscType;word string[24];}sd004={ //sizeof(sd004),DSC_STR, //'P','I','C','k','i','t',' ','2',' ','C','o','n','f','i','g','u','r','a','t','i','o','n',' ','2'}; rom struct{byte report[29];}hid_rpt01={ 0x06, 0x00, 0xFF, // Usage Page (Vendor Defined) 0x09, 0x01, // Usage (Vendor Usage) 0xA1, 0x01, // Collection (Application) 0x19, 0x01, // Usage Minimum (Vendor Usage = 1) // 0x29, 0x08, // Usage Maximum (Vendor Usage = 8) 0x29, 0x40, // Usage Maximum (Vendor Usage = 64) 0x15, 0x00, // Logical Minimum (Vendor Usage = 0) 0x26, 0xFF, 0x00, // Logical Maximum (Vendor Usage = 255) 0x75, 0x08, // Report Size (Vendor Usage = 8) // 0x95, 0x08, // Report Count (Vendor Usage = 8) 0x95, 0x40, // Report Count (Vendor Usage = 64) 0x81, 0x02, // Input (Data, Var, Abs) 0x19, 0x01, // Usage Minimum (Vendor Usage = 1) // 0x29, 0x08, // Usage Maximum (Vendor Usage = 8) 0x29, 0x40, // Usage Maximum (Vendor Usage = 64) 0x91, 0x02, // Output (Data, Var, Ads) 0xC0}; // End Collection rom const unsigned char *rom USB_CD_Ptr[]={&cfg01,&cfg02}; //rom const unsigned char *rom USB_SD_Ptr[]={&sd000,&sd001,&sd002,&sd003,&sd004}; rom const unsigned char *rom USB_SD_Ptr[]={&sd000,&sd001,&sd002}; -- Xiaofan http://mcuee.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html