|
|
The following entry point routines are used to initialize, configure, close, and analyze driver configuration in DDI 8 drivers: .
All DDI 8 drivers must include a _load(D2) entry point routine that is called to initialize the driver. MDI and SDI HBA drivers that use DDI 7 must also have a _load( ) entry point routine.
Drivers written for DDI versions prior to version 8 that are not dynamically loaded use the init(D2) and start(D2) entry point routines instead of _load(D2). Loadable drivers for DDI versions prior to DDI 8 do hardware configuration as well as driver initialization in their _load( ) routines. See ``Dynamically-loadable kernel modules (DLKM)''.
All SCO OpenServer 5 drivers use the init(D2oddi) and start(D2oddi) entry points for driver initialization and configuration. SCO OpenServer 5 does not support loadable drivers.
The driver's CFG_ADD subfunction must also allocate a private data structure for each supported board that contains (or references) state information for the board such as the resource manager key and the interrupt cookie. It then passes this structure back to the kernel by writing it to (*(void **)idata). All subsequent entry points have this idata value passed back into the driver so it can get at its per-board state.
PCI hotplug devices (identified by the D_HOT flag set in the drvinfo(D4) structure) must support additional subfunctions to the config( ) routine, including CFG_SUSPEND and CFG_REMOVE. See ``Hotplug devices''.
CFG_SUSPEND is called during system shutdown, and CFG_REMOVE is called when a hotplug device is removed from the system. These functions must, among other things, call the cm_intr_detach(D3) function to detach the device's interrupt vectors. CFG_REMOVE must detach interrupts conditionally (only if they have not already been detached), and then deallocate the idata.
DDI 8 ISA devices must support the CFG_VERIFY subfunction to compensate for the reduced autoconfiguration facilities for ISA devices relative to the smart-bus architectures such as PCI MCA, and EISA. See ``ISA bus autoconfiguration''.