|
|
init( ) performs first-stage Host Bus Adapter (HBA)-specific initialization and allocation of data structures (command blocks, queues, and so on).
As part of this initialization, the init( ) routine must determine whether the specified type of HBA controller is present. Each HBA's init( ) routine must search for the presence of controllers without causing problems for the other devices present. Therefore, it should use only the minimum number of inb(D3) and outb(D3) steps needed to detect an HBA controller. If an action is needed only after a controller is detected, this action should not be performed until the detection is complete and can be performed by the second-phase initialization, start(D2sdi). Examples of post-detection steps include DMA initialization or other actions that can effect the system or other controllers.
Drivers for ISA controllers that probe I/O ports to verify that the associated hardware is present should read and save the value from the port before modifying it. If it is determined that the hardware is not present, drivers should restore the port value. This procedure does not prevent all conflicts, but does reduce the possibility of catastrophic failure. Note that this applies only to drivers for ISA devices; drivers for PCU devices (see ``PCU (Platform Conformance Utility)'' in HDK Technical Reference) should never probe hardware themselves; use the autoconfiguration facilities described in ``Autoconfiguration'' in HDK Technical Reference instead.