DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

init(D2sdi)


init -- perform first-stage initialization and registration of a Host Bus Adapter

Synopsis

See init(D2) for synopsis and general usage information about this entry point.

Description

This entry point is for Host Bus Adapter (HBA) drivers. This part of the initialization is performed with system interrupts enabled and must conform to the definition of a init(D2) routine.

init( ) performs first-stage Host Bus Adapter (HBA)-specific initialization and allocation of data structures (command blocks, queues, and so on).

Return values

On success, init( ) returns 0. On failure, it returns -1, indicating no hardware found or another error.

Usage

The init( ) routine is called once and must perform first-phase initialization for each configured controller. prefixidata[] is an array of hba_idata_v5(D4sdi) structures that contains the controller-specific configuration data.

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.

Arguments

None

Level

Base only

Applicable hardware

All

Version applicability

sdi: 1, 2, 3, 4 HBA drivers with DDI versions prior to version 8.

See Also

init(D2), _load(D2sdi), sdi_gethbano(D3sdi), sdi_register(D3sdi), start(D2), start(D2sdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005