start(D2I) start(D2I)
NAME
start - perform second stage initialization and registration
of a Host Bus Adapter
SYNOPSIS
int prefixstart(void);
Arguments
None.
DESCRIPTION
start(D2I) performs Host Bus Adapter (HBA)-specific
initialization and allocation of data structures (command
blocks, queues, and so on). It is also used to register the
HBA controller with SDI.
Return Values
On success, start returns 0. On failure, it returns -1,
indicating no hardware found or other error.
USAGE
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 start routine,
as defined by start(D2).
The start routine is called once and must perform second phase
initialization for each configured controller. The
prefixcntls contain the number of configured controllers, and
prefixidata[] contains the controller-specific configuration
data.
start(D2I) has two main purposes. Its first purpose is to
perform HBA-specific initialization and allocation of data
structures (command blocks, queues, and so on) not performed
by the first phase initialization, init(D2I).
The second purpose of the start routine is to let the SDI
subsystem know whether the HBA controller is present. If the
controller is present, the routine must register the
controller with SDI by first calling sdi_gethbano(D3I), then
calling the sdi_register(D3I) routine.
The sdi_gethbano call returns the external HBA number that is
used by the system to generate the node name. The HBA driver
needs this number to generate the mapping from the external
Copyright 1994 Novell, Inc. Page 1
start(D2I) start(D2I)
number to its own internal controller number. A positive
return value for sdi_gethbano represents a valid and available
controller number. A negative value indicates that the
requested controller number is either invalid or unavailable,
or that there are no available numbers to allocate.
The sdi_register routine is called after all the controller
initialization has been completed. A successful registry of
the HBA enters the controller into the HBA_tbl switch table,
which is SDI's interface to the driver. In addition, the
controller and its devices are entered into the SDI equipped
device table, EDT. A positive return from sdi_register
indicates a successful registration and the value is the
external HBA number. A negative value indicates either no
devices are present or some other error.
If the controller is registered with SDI, the start routine
should return the value 0. If no controller is found or no
devices are attached, or any other error condition is detected
such that the controller is not registered, the routine should
return -1. However, before start returns the error condition,
any memory allocated for the HBA controller should be freed.
Level
Base only.
REFERENCES
init(D2), init(D2I), sdi_gethbano(D3I), sdi_register(D3I),
start(D2)
NOTICES
Applicability
sdi: 1, 2
Copyright 1994 Novell, Inc. Page 2