Google
  Web www.spinics.net

Re: Mapping a usbfs device to the corresponding sysfs device.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Sat, 28 Jul 2007, Greg KH wrote:

> On Fri, Jul 27, 2007 at 10:08:21AM -0400, Dave Mielke wrote:
> > Given that the default kernel options seem to be excluding
> > /sys/class/usb_device/ these days, what's the best way on a newer kernel to map
> > a usbfs device to its corresponding sysfs device? Please understand that it's
> > not reasonable, at least to us, to require that every user of a USB-connected
> > braille display rebuild his kernel. Is there still a way to do the mapping?
> 
> It's easier to go from a sysfs device to a usbfs device, but I don't
> understand the question really.  You want to know how to do it on newer
> kernels but not older ones?

The procedure ought to be the same.  But the sysfs links which provided 
the mapping on older kernels are now deprecated and hence don't appear 
in some distributions.

>  The mapping is still the same, nothing has
> changed,

It _has_ changed.  One of the configuration options 
(CONFIG_USB_DEVICE_CLASS perhaps -- I forget) is now deprecated whereas 
it wasn't before -- it didn't even exist before.

> you can still just look up the bus and device number from the
> usbfs name and then walk sysfs to get the device.  That will work with
> all kernel versions, right?

You mean to iterate through all the USB device directories in sysfs,
looking for the correct bus and device number?  It would work but it is
awkward.  There ought to be a direct symlink available in sysfs
somewhere.  For instance, it could go in /sys/bus/usb or in 
/sys/bus/usb/devicemap/ (a new directory intended for just this 
purpose).

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Linux-usb-users@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

[Linux USB]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Video Projectors]     [PDAs]     [Free Online Dating]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [16.7MP]

Powered by Linux