Re: Does sysfs really provides persistent hardware path to devices?

From: David Brownell
Date: Tue Aug 19 2003 - 13:27:48 EST


That's nice. Now add a second camera from the same vendor
:( No, i don't expect you to be able to uniquely identify
identical devices being added and removed from a single USB buss
in a persistent way. But it would be nice if we could get
consistency between busses so that a mouse on one USB buss
weren't confused with a mouse on another USB buss.

Well the add/remove part is potentially an issue, depending
on how you run things. The conventional solution, used
with other serial lines since long before UNIX, is labeling
ports according to what should be plugged in to them.

There's a usb_device->devpath field that provides a stable
topological identifier for devices within a USB bus, each id
corresponding to one of those port labels. That field is
merged into sysfs bus_id values for USB.

It's not so nice for bus identifiers themselves, "usbN".
Though clearly there's a physical path there too, and it's
normally stable enough that PCI slot names won't change.
(Except on high end systems, where the topology may be
more stable than the bus numbers ... but we don't have
anything like usb_device->devpath for use with PCI.)

So the problem is how to munch the sysfs information into
the persistent path information you want. It's demonstrably
doable ... though it does look to be a PITA.

- Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/