0001 Interface
0002 ~~~~~~~~~
0003
0004 DEF_MODULE (name, description, module_ops pointer, dependencies)
0005
0006 where
0007 name is a C symbol
0008 description is a string
0009 module_ops pointer is type (const struct module_ops *)
0010 dependencies is a const array of strings: { "dep1", "dep2", ... } or empty: {}
0011
0012 The module ops currently include only an "init" function:
0013
0014 struct module_ops { bool (*init) (void); };
0015
0016 Naming hierarchy
0017 ~~~~~~~~~~~~~~~~
0018
0019 The (currently informal) hierarchical name is built by inserting 3
0020 underscores "___" in between components of the name,
0021 e.g. "usb___uhci".
0022
0023 Example of defining a module
0024 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0025
0026 #include "module/header.h"
0027
0028 bool usb_asix_driver_init (void) { ... return TRUE; }
0029
0030 static const struct module_ops mod_ops = {
0031 .init = usb_asix_driver_init
0032 };
0033
0034 DEF_MODULE (usb___asix, "USB asix network driver", &mod_ops, {"usb", "net___ethernet"});