View Single Post
Old 03-12-2012, 12:22 PM   #20
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Device names

Names of devices in the sub-tree of /dev may and often are, maintained by udev rules (/etc/udev/**).

Names of devices in the sub-tree of /sys are set in (are part of) the driver code.

So for a "fixed", "primary" information source, try using /sys/class/input/**

For example, "what is event0?"
Code:
cd /sys/class/input
cd event0
cd device
ls -l
The /sys sub-tree is a nest of symbolic links giving you many ways to reach the information desired.

One quick way, get the Major:Minor number of the devices, then use /sys/dev/{block,char} as appropriate to reach the information about it.

The since this tree is hard-coded in the driver, it will not change while the driver is loaded. It will (should) disappear if the driver is unloaded.

(something to keep in mind when unloading a g_* module and loading a different g_* module for the same device)
knc1 is offline   Reply With Quote