[Nut-upsdev] More information on USB bus
Arjen de Korte
nut+devel at de-korte.org
Sat Sep 1 07:18:27 UTC 2007
> On 8/31/07, Arjen de Korte <nut+devel at de-korte.org> wrote:
>> When I plug in a device, the kernel will not only tell me to which USB
>> bus it is connected, but also the socket it is plugged into:
>> > Aug 31 22:06:07 miffy kernel: usb 1-1: new low speed USB device using
>> uhci_hcd and address 31
>> > Aug 31 22:06:08 miffy kernel: usb 1-1: new device found,
>> idVendor=0463, idProduct=ffff
>> > Aug 31 22:06:08 miffy kernel: usb 1-1: new device strings: Mfr=1,
>> Product=2, SerialNumber=3
>> > Aug 31 22:06:08 miffy kernel: usb 1-1: Product: Evolution
>> > Aug 31 22:06:08 miffy kernel: usb 1-1: Manufacturer: MGE UPS SYSTEMS
>> > Aug 31 22:06:08 miffy kernel: usb 1-1: SerialNumber: AV1H2402G
>> > Aug 31 22:06:08 miffy kernel: usb 1-1: configuration #1 chosen from 1
>> On USB bus 1, I have two sockets and it clearly makes a difference in
>> which I put the connector. The kernel will report either 'usb 1-1' or
>> 'usb 1-2'. Is there a way to get to this information through libusb?
>> From a posting today on nut-users, it looks like we need more
>> granularity than just the bus.
> I think that is something you can infer from the usb_device structure
> (the filename member). Not sure if that's considered portable, though.
I'll have a look. It seemed obvious that this would be in the usb_bus
structure, but that proved to be a wrong assumption.
> I am a little concerned about how that would work in practice -
> different kernels might use different names there.
That's probably something autoconf could deal with for us, so I'm not that
worried about that.
Best regards, Arjen
More information about the Nut-upsdev