VID parser problem with usbdevs
Xiaofan Chen
xiaofanc at gmail.com
Thu Oct 11 06:17:42 PDT 2007
On 10/11/07, M. Warner Losh <imp at bsdimp.com> wrote:
> In message:
> : ===[mcuee] ~/Desktop/build/fsusb/fsusb-0.1.11-2 # sudo usbdevs -v
> : Controller /dev/usb1:
> : addr 126: full speed, power 100 mA, config 1, product 0x000b(0x000b),
> : I-Tuner Networks(0x04d8), rev 0.00
> : port 4 addr 126: full speed, power 100 mA, config 1, product
> : 0x000b(0x000b), I-Tuner Networks(0x04d8), rev 0.00
>
> While 4d8 is for microchip technology, we get the name that we print
> here directly from the usb device itself.
> What makes you think that the vendor ID is parsed wrong?
>
I have read the firmware source codes so I do not think there
is anything called "I-Tuner" in the descriptors or anywhere in the
firmware. 04d8/000b is the bootloader firmware VID/PID for
Microchip PICDEM FS USB demo board.
The following is the relevant descriptor.
#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
0x000b, // Product ID: PICDEM FS USB (Boot Mode)
0x0001, // Device release number in BCD format
0x00, // Manufacturer string index
0x00, // Product string index
0x00, // Device serial number string index
0x01 // 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
0, // 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
0x00, // Class code
0x00, // Subclass code
0x00, // Protocol code
0, // Interface string index
/* Endpoint Descriptors */
sizeof(USB_EP_DSC),DSC_EP,_EP01_OUT,_BULK,BOOT_EP_SIZE,0x00,
sizeof(USB_EP_DSC),DSC_EP,_EP01_IN,_BULK,BOOT_EP_SIZE,0x00
};
rom struct{byte bLength;byte bDscType;word string[1];}sd000={
sizeof(sd000),DSC_STR,0x0409};
So I plug in PICkit 2, another Microchip product. It is fine.
===[mcuee] ~ # sudo usbdev -v
addr 125: full speed, power 100 mA, config 1, PICkit 2 Microcontroller
Programme r(0x0033), Microchip Technology
Inc.(0x04d8), rev 0.01
port 2 addr 125: full speed, power 100 mA, config 1, PICkit 2
Microcontroller P rogrammer(0x0033), Microchip
Technology Inc.(0x04d8), rev 0.01
Kind of strange.
Xiaofan
More information about the freebsd-usb
mailing list