Writing Device Drivers

modldrv Structure

static struct modldrv xxmodldrv = {
        &mod_driverops,         /* drv_modops */
        "generic driver v1.1",  /* drv_linkinfo */
        &xx_dev_ops             /* drv_dev_ops */
};

This structure describes the module in more detail. The first field provide information on how to install and un-install the module. It should be set to &mod_driverops for driver modules. The second field is a string to be displayed by modinfo(1M). It should contain sufficient information for identifying the version of source code which generated the driver binary. The last field points to the driver's dev_ops structure defined next.