[Nut-upsdev] More information on USB bus

Charles Lepple clepple at gmail.com
Fri Aug 31 23:09:26 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 choice
>
> 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 am a little concerned about how that would work in practice -
different kernels might use different names there.

-- 
- Charles Lepple



More information about the Nut-upsdev mailing list