A C source file (a .c file) for a device driver has the following responsibilities:
Contains the data declarations and the code for the entry points of the driver
Contains the #include statements that are needed by the driver
Declares extern references
Declares local data
Sets up the cb_ops and dev_ops structures
Declares and initializes the module configuration section, that is, the modlinkage(9S) and modldrv(9S) structures
Makes any other necessary declarations
Defines the driver entry points