Elomax Driver project

elomax

This is the documentation of the "Elomax Driver" project.

Elomax Driver Requirements

Elomax (http://www.elomax.nl) units are units that control io and can be addressed via usb. Elomax produces several types:

All these 'solutions' have in common that they communicate via 8 byte blocks, though the content of these 8 bytes differs per 'solution'.

That is where this package comes in. This package has to implement the bare usb communication, delivering the 8 byte blocks both ways, without interpreting their content.

This package has to fullfill the requirements:

Elomax Driver User View

To install the driver in the system:

When an elomax unit is connected to the system's usb-bus, the kernel will tell udev about it. This result udev in telling the kernel to load the elomax.ko module, after which the usb-core of the kernel will 'probe' the unit through this package. The driver will accept control over the unit, which it tells to the usb-core, who will tell udev to create a device file for the unit.

Via this device file can an user application access the driver and so the unit. The allowed operations on the device file are described in elomax.h.

inline_dotgraph_1.dot

Elomax Driver Implementation

Where the picture above gives an hierarchical overview, the picture below gives the relationship between functions and data inside this package, roughly ordered in time.

The solid lines represent the usage/update of data by a function. The dashed lines represent one function calling another. The dotted lines represent the possibility to find related data (usually a 'pointer to' the destination data is included in the source data).

inline_dotgraph_2.dot

First there is the stage of module loading. The modprobe/rmmod commands respectively trigger the execution of the kernelmodule_init() and kernelmodule_exit() functions. This functionality is described in more detail in kernelmodule.h.

The (un)loading of this package triggers the construction/destruction of the elomax_driver layer. The functions elomax_driver_construct() and elomax_driver_destruct() announce this package to the usb-core. It gives the {vendorid, productid} pairs for which this driver wants to be informed. When such a unit is connected/disconnected, the functions according the driver-table are called (elomax_driver_probe() and elomax_driver_disconnect()). This functionality is described in more detail in elomaxdriver.h.

The third stage is triggered when an elomax-unit is connected to the usb-bus. This results in the construction of an elomax_instance which is announced to the usb-core by telling the class-driver-table. The usb-core now (lets) create(s) the corresponding device-file with its minor-node. This is describe in more detail in elomaxinstance.h.

The fourth and last stage is user-access to the device-file. The class-driver told the usb-core which function to call, which when the user access the device-file results in elomax_instance_open(), elomax_instance_read(), elomax_instance_write() and/or elomax_instance_close() to be called. These functions are described in more detail in elomaxinstance-priv.h.

This interaction can also be depicted as shown in the figure below.

inline_mscgraph_1
 All Classes Files Functions Variables Typedefs Defines
Generated by  doxygen 1.6.3