Skip to contentSkip to conversation

Devfs and driverfs

DISCUSSION Simon Turvey 3 participants 3 messages Jun 5, 2002

lore
Share & tools
lore
#0 lore raw

I apologise if this is a trivial question but I was hoping someone could explain or point me in the direction of more info.

I understand the purpose and reason for devfs but I cannot find any info on driverfs. What's it for?

Thanks,
Simon

#1 lore raw
Quoted 5 lines · Simon Turvey

I apologise if this is a trivial question but I was hoping someone could explain or point me in the direction of more info.

I understand the purpose and reason for devfs but I cannot find any info on driverfs. What's it for?

driverfs is a 'view by connection' view of everything in the system. It useful for a number of things, from Power management to hinv type tools. Read more at Documentation/driver-model.txt

Dave

Signature · 2 lines
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs
#2 lore raw
In reply to Simon Turvey
Quoted 5 lines · Simon Turvey

I apologise if this is a trivial question but I was hoping someone could explain or point me in the direction of more info.

I understand the purpose and reason for devfs but I cannot find any info on driverfs. What's it for?

There is some documentation in Documentation/filesystems/driverfs.txt. It is a bit outdated, but the general purpose of it should be in there.

Basically, driverfs is a filesystem that maps onto the global device tree. Each device found in the system gets a directory in driverfs. In this directory, ascii-based files can be created that export device parameters (kind of an ascii-based ioctl).

Files can be created by the bus the device resides on, by a driver that binds to the device, or by the class the device registers with.

In addition to the global device tree, driverfs now exports a flat listing of bus types in the system. Each bus type gets a directory, which it is free to create interface files in. It also a has a devices directory and a drivers directory. The former has symlinks for all the devices found on that bus type that point to each device's directory in the physical hierarchical layout. The drivers directory contains a directory for each driver for that bus type. In those directories, drivers may create files to export driver-specific parameters (that control the entire driver, not an individual device).

-pat