[Nut-upsdev] recent and planned changes

Charles Lepple clepple at gmail.com
Sat Sep 17 13:25:36 UTC 2005


On 9/16/05, Peter Selinger <selinger at mathstat.dal.ca> wrote:
> Arnaud wrote:
> > I've not had time to dig this yet (some Debian and MGE things to deal with),
> > but there would be some points missing:
> > - Index. This is a param to differentiate 2 devices with exactly the same
> > info (ie same VID/ PID, no serial, ...). Then you could say "the 2nd device
> > with VID xxxx and PID yyyy"
> 
> I don't think this will work. There is no fixed meaning to "2nd
> device". The devices could be enumerated by libusb in any order.

I tend to agree with Peter here. If you have two devices A and B, with
device A plugged in before device B, then if I unplug and replug
device A, then it will get a higher device number than B (modulo 127)
under Linux. But the kernel has already changed the order of devices
in /proc/bus/usb/devices once (when the new driver model was added in
2.6) so it's not something to depend on.
 
> > - an interesting notion that was introduced by Dave Brownell (linux USB
> > hacker) is the "physical path" (stable ids, which don't change unless usb
> > topology morphs). For more info, search for HIDIOCGPHYS in hidups.
> > I find this interesting, but I'm not sure it has been ported...
> 
> As per Charles' post, this is probably not possible with the current
> backend. The best I could probably do is offer a "bus" option. As far
> as I can tell (in Linux), while device numbers are assigned randomly,
> busses are physical, e.g. 001, 002, etc correspond to particular fixed
> physical USB ports on my computer. (However, I don't know how "fixed"
> they really are - perhaps this depends on the order in which they are
> discovered during booting?) So if someone really owns several
> indistinguishable UPS devices, they might be able to plug them into
> different physical ports and use the bus number to match the devices.

If the user has hubs with serial numbers, and the virtual root hubs
(the host controllers) have serial numbers (in Linux, this includes
the PCI ID), then there is a chance of a portable solution here.

On the other hand, my (totally unsolicited) recommendation for anyone
with a need for several UPSes on the same machine is that they spend a
couple extra dollars and get ones that report their serial number.

-- 
- Charles Lepple



More information about the Nut-upsdev mailing list