devctrl()

Allow for the configuration of a module by an external source

Synopsis:

static int devctrl( inout_module_t *pModule, 
                    int event, 
                    void *ptr );

Description:

This function lets an external source — typically another module — configure a module. It's invoked by an output module at arbitrary points of execution.

The pModule parameter holds a pointer to a module descriptor.

What this function should do depends on which layer it's in:

Device
If event is meaningful, assign type to ptr and process. Read and update the pointer as appropriate.

If event isn't meaningful, return -1 and set errno to EINVAL.

Protocol
If event is meaningful, assign type to ptr and process. Read and update the pointer as appropriate.

If event isn't meaningful and there's a linked input module, invoke the input module's devctrl() callback.


Note: To add a new DEVCTL command, make an entry in include/const.h and define any data sent with the DEVCTL in struct.h.

Returns:

EOK

Classification:

Your code

Safety:
Interrupt handler Yes
Signal handler Yes
Thread Yes