File: [local] / funnyos / sys / devctl.h (download)
Revision 1.1, Sun Dec 16 23:03:00 2007 UTC (16 years, 9 months ago) by nbrk
Branch: MAIN
CVS Tags: HEAD
introducing devctl, a mechanism to talk to device drivers from other drivers or userland.
interested drivers should implement callback function (xxx_devctl) and register it with devctl_register();
once registered, all other FunnyOS subsystems should be able to pass in/out some control commands
and data to/from device driver in subject.
for example, to toggle onboard LED on/off (see next commits) one will use: devctl("gpioled", 0, DCGPIOLED_TOGGLE, NULL);
DCGPIOLED is a 'ctlcmd' and NULL is a 'ctldata'. ctlcmd is a command recognized by that driver (gpioled);
this is similar to ioctl(2) in UNIX.
|