Hi,
I compiled the code.
I run it for 2 different pen drives but in both case I got the same output.
Manufacture name is not right and same output is repeated lot of times.
Output goes like this:
bus/device idVendor/idProduct
008/001 1D6B/0001
- Manufacturer : Linux 2.6.38.8-customc uhci_hcd
- Product : UHCI Host Controller
- Serial Number: 0000:00:1d.2
wTotalLength: 25
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 0
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 9
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 2
bInterval: 255
bRefresh: 0
bSynchAddress: 0
007/001 1D6B/0001
- Manufacturer : Linux 2.6.38.8-customc uhci_hcd
- Product : UHCI Host Controller
- Serial Number: 0000:00:1d.1
wTotalLength: 25
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 0
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 9
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 2
bInterval: 255
bRefresh: 0
bSynchAddress: 0
006/001 1D6B/0001
- Manufacturer : Linux 2.6.38.8-customc uhci_hcd
- Product : UHCI Host Controller
- Serial Number: 0000:00:1d.0
wTotalLength: 25
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 0
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 9
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 2
bInterval: 255
bRefresh: 0
bSynchAddress: 0
005/002 08FF/2810
- Product : Fingerprint Sensor
wTotalLength: 32
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: a0h
MaxPower: 50
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 2
bInterfaceClass: 255
bInterfaceSubClass: 255
bInterfaceProtocol: 255
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 02h
bmAttributes: 02h
wMaxPacketSize: 8
bInterval: 0
bRefresh: 0
bSynchAddress: 0
005/001 1D6B/0001
- Manufacturer : Linux 2.6.38.8-customc uhci_hcd
- Product : UHCI Host Controller
- Serial Number: 0000:00:1a.2
wTotalLength: 25
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 0
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 9
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 2
bInterval: 255
bRefresh: 0
bSynchAddress: 0
004/001 1D6B/0001
- Manufacturer : Linux 2.6.38.8-customc uhci_hcd
- Product : UHCI Host Controller
- Serial Number: 0000:00:1a.1
wTotalLength: 25
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 0
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 9
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 2
bInterval: 255
bRefresh: 0
bSynchAddress: 0
003/006 413C/8156
- Manufacturer : Dell Computer Corp
- Product : Dell Wireless 370 Bluetooth Mini-card
wTotalLength: 216
bNumInterfaces: 4
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 50
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 3
bInterfaceClass: 224
bInterfaceSubClass: 1
bInterfaceProtocol: 1
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 16
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 82h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 02h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 0
bNumEndpoints: 2
bInterfaceClass: 224
bInterfaceSubClass: 1
bInterfaceProtocol: 1
iInterface: 0
bEndpointAddress: 83h
bmAttributes: 01h
wMaxPacketSize: 0
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 03h
bmAttributes: 01h
wMaxPacketSize: 0
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 1
bNumEndpoints: 2
bInterfaceClass: 224
bInterfaceSubClass: 1
bInterfaceProtocol: 1
iInterface: 0
bEndpointAddress: 83h
bmAttributes: 01h
wMaxPacketSize: 9
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 03h
bmAttributes: 01h
wMaxPacketSize: 9
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 2
bNumEndpoints: 2
bInterfaceClass: 224
bInterfaceSubClass: 1
bInterfaceProtocol: 1
iInterface: 0
bEndpointAddress: 83h
bmAttributes: 01h
wMaxPacketSize: 17
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 03h
bmAttributes: 01h
wMaxPacketSize: 17
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 3
bNumEndpoints: 2
bInterfaceClass: 224
bInterfaceSubClass: 1
bInterfaceProtocol: 1
iInterface: 0
bEndpointAddress: 83h
bmAttributes: 01h
wMaxPacketSize: 32
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 03h
bmAttributes: 01h
wMaxPacketSize: 32
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 4
bNumEndpoints: 2
bInterfaceClass: 224
bInterfaceSubClass: 1
bInterfaceProtocol: 1
iInterface: 0
bEndpointAddress: 83h
bmAttributes: 01h
wMaxPacketSize: 64
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 03h
bmAttributes: 01h
wMaxPacketSize: 64
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 5
bNumEndpoints: 2
bInterfaceClass: 224
bInterfaceSubClass: 1
bInterfaceProtocol: 1
iInterface: 0
bEndpointAddress: 83h
bmAttributes: 01h
wMaxPacketSize: 64
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 03h
bmAttributes: 01h
wMaxPacketSize: 64
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 2
bAlternateSetting: 0
bNumEndpoints: 2
bInterfaceClass: 255
bInterfaceSubClass: 255
bInterfaceProtocol: 255
iInterface: 0
bEndpointAddress: 84h
bmAttributes: 02h
wMaxPacketSize: 32
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 04h
bmAttributes: 02h
wMaxPacketSize: 32
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 3
bAlternateSetting: 0
bNumEndpoints: 0
bInterfaceClass: 254
bInterfaceSubClass: 1
bInterfaceProtocol: 0
iInterface: 0
003/004 413C/8158
wTotalLength: 62
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 1
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 3
bInterfaceSubClass: 1
bInterfaceProtocol: 2
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 4
bInterval: 10
bRefresh: 0
bSynchAddress: 0
003/003 413C/8157
wTotalLength: 34
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 1
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 3
bInterfaceSubClass: 1
bInterfaceProtocol: 1
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 8
bInterval: 10
bRefresh: 0
bSynchAddress: 0
003/002 0A5C/4500
- Manufacturer : Broadcom
- Product : BCM2046B1
wTotalLength: 25
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 47
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 9
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 1
bInterval: 255
bRefresh: 0
bSynchAddress: 0
003/001 1D6B/0001
- Manufacturer : Linux 2.6.38.8-customc uhci_hcd
- Product : UHCI Host Controller
- Serial Number: 0000:00:1a.0
wTotalLength: 25
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 0
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 9
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 2
bInterval: 255
bRefresh: 0
bSynchAddress: 0
002/003 058F/6387
- Manufacturer : Generic
- Product : Mass Storage
- Serial Number: 1180FF3A
wTotalLength: 32
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: 80h
MaxPower: 50
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 2
bInterfaceClass: 8
bInterfaceSubClass: 6
bInterfaceProtocol: 80
iInterface: 0
bEndpointAddress: 01h
bmAttributes: 02h
wMaxPacketSize: 512
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 82h
bmAttributes: 02h
wMaxPacketSize: 512
bInterval: 0
bRefresh: 0
bSynchAddress: 0
002/001 1D6B/0002
- Manufacturer : Linux 2.6.38.8-customc ehci_hcd
- Product : EHCI Host Controller
- Serial Number: 0000:00:1d.7
wTotalLength: 25
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 0
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 9
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 4
bInterval: 12
bRefresh: 0
bSynchAddress: 0
001/004 05CA/18A0
- Manufacturer : Ricoh co. Ltd.
- Product : Integrated Webcam
- Serial Number: CN0TX6137248789NAHC8
wTotalLength: 1144
bNumInterfaces: 2
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: 80h
MaxPower: 50
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 1
bInterfaceProtocol: 0
iInterface: 2
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 64
bInterval: 16
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 0
bNumEndpoints: 0
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bInterfaceNumber: 1
bAlternateSetting: 1
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5076
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 2
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 4976
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 3
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 968
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 4
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 632
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 5
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 800
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 6
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5100
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 7
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5100
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 8
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5100
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 9
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5120
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 10
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5052
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 11
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 4956
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 12
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 840
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 13
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 624
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 14
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 700
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 15
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5120
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 16
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5120
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 17
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5120
bInterval: 1
bRefresh: 0
bSynchAddress: 0
bInterfaceNumber: 1
bAlternateSetting: 18
bNumEndpoints: 1
bInterfaceClass: 14
bInterfaceSubClass: 2
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 82h
bmAttributes: 05h
wMaxPacketSize: 5120
bInterval: 1
bRefresh: 0
bSynchAddress: 0
001/001 1D6B/0002
- Manufacturer : Linux 2.6.38.8-customc ehci_hcd
- Product : EHCI Host Controller
- Serial Number: 0000:00:1a.7
wTotalLength: 25
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: e0h
MaxPower: 0
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 9
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 81h
bmAttributes: 03h
wMaxPacketSize: 4
bInterval: 12
bRefresh: 0
bSynchAddress: 0
"
Please help !
Quote:
Originally Posted by alain91
Hello,
Here is the end of the article :
Important attributes of USB devices useful in device driver coding
Configuration and Endpoints are one of the two important descriptors of any USB device. These desciptors are defined using the “struct usb_config_descriptor” and “struct_usb_endpoint_descriptor” respectively .
dev->descriptor.idVendor : Reveals the Vendor-Id of the USB device connected to the system.
dev->descriptor.idProduct : Reveals the Product-Id of the USB device connected to the system.
dev->descriptor.iManufacturer : Reveals the name of the Manufacturer USB device connected to the system.
EndpointAddress:Combination of endpoint address and enpoint direction on a USB device.
InterfaceNumber : One of the several interfaces that is allocated to the connected USB device.
AlternateSetting:This is part of the a single interface allocated to the USB device.
Prerequites for Libusb programming
Linux system with Kernel 2.4 above series.
Proficiency in C language.
Good understanding of USB device internals.
Idea about USBFS.
|