Managing and Developing Dynamically Loadable Kernel Modules
Managing and Developing Dynamically Loadable Kernel Modules
Developing Dynamically Loadable Kernel Modules
Chapter 12 531
struct mod_type_data {
char *mtd_info;
void *mtd_pdata;
};
struct modwrapper {
int mw_rev;
int (*mw_load)();
int (*mw_unload)();
void (*mw_halt)();
void *mw_conf_data;
struct modlink *mw_modlink;
};
The elements of the modwrapper structure are:
❏ mw_rev – module revision number; use MODREV in your module
wrapper
❏ mw_load – pointer to module's _load() function
❏ mw_unload – pointer to module's _unload() function
❏ mw_halt – currently unused; use (void (*)())NULL in your module
wrapper
❏ mw_conf_data – pointer to configuration data created by
configuration tool config (1M)
❏ mw_modlink – pointer to a modlink array, which is a NULL terminated
array of modlink structures that specify the type-specific operations
required by the module
The elements of the modlink structure are:
❏ ml_ops – pointer to a mod_operations structure that depends on the
type of DLKM module being defined: