porting driver 2.4 -> 2.6, confused by device model

Sebastian Kuzminsky seb at highlab.com
Fri Feb 23 16:27:40 CST 2007


Hi folks, I've got a driver I wrote for 2.4 and now I'm trying to port
it to 2.6.  The port was pretty straight-forward, but I'm having trouble
figuring out how to make uevent/udev automatically creates the device
nodes in /dev.

The hardware is a data acquisition device that sits on the ISA bus.
It's got 16 ADCs, 2 DACs, and 8 bits of digital input and 8 bits
of digital output.  In 2.4 my driver was a character device, and I
represented each card by 19 minors.  The two 8-bit digitals were merged
into one, differentiated by read vs write.  I statically created the
device nodes in /dev, and each device node was easy to use with dd,
hexdump, etc.

In the 2.6 driver I'd like to use dynamically allocated major & minor
numbers, and I'd like device node creation to be automatic.  It seems
like the cleaner way to go.

As far as I can tell, this device does not fit well into any of the
existing classes.  LDD3 talks about a "simple" class, but it seems like
it's been removed since that book was written.  Should I create a new
class for the device?

Should I create a cdev for each minor?  Seems that way.

Should I somehow call make a kobject for each device node and call
kobject_uevent() directly?


I'm confuzzled.


-- 
Sebastian Kuzminsky                                 hash bang bin bash


More information about the Kernel-mentors mailing list