Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

scsi_hba_init(9f) [opensolaris man page]

scsi_hba_init(9F)					   Kernel Functions for Drivers 					 scsi_hba_init(9F)

NAME
scsi_hba_init, scsi_hba_fini - SCSI Host Bus Adapter system initialization and completion routines SYNOPSIS
#include <sys/scsi/scsi.h> int scsi_hba_init(struct modlinkage *modlp); void scsi_hba_fini(struct modlinkage *modlp); INTERFACE LEVEL
Solaris architecture specific (Solaris DDI). PARAMETERS
modlp Pointer to the Host Bus Adapters module linkage structure. DESCRIPTION
scsi_hba_init() scsi_hba_init() is the system-provided initialization routine for SCSI HBA drivers. The scsi_hba_init() function registers the HBA in the system and allows the driver to accept configuration requests on behalf of SCSI target drivers. The scsi_hba_init() routine must be called in the HBA's _init(9E) routine before mod_install(9F) is called. If mod_install(9F) fails, the HBA's _init(9E) should call scsi_hba_fini() before returning failure. scsi_hba_fini() scsi_hba_fini() is the system provided completion routine for SCSI HBA drivers. scsi_hba_fini() removes all of the system references for the HBA that were created in scsi_hba_init(). The scsi_hba_fini() routine should be called in the HBA's _fini(9E) routine if mod_remove(9F) is successful. RETURN VALUES
scsi_hba_init() returns 0 if successful, and a non-zero value otherwise. If scsi_hba_init() fails, the HBA's _init() entry point should return the value returned by scsi_hba_init(). CONTEXT
scsi_hba_init() and scsi_hba_fini() should be called from _init(9E) or _fini(9E), respectively. SEE ALSO
_fini(9E), _init(9E), mod_install(9F), mod_remove(9F), scsi_pktalloc(9F), scsi_pktfree(9F), scsi_hba_tran(9S) Writing Device Drivers NOTES
The HBA is responsible for ensuring that no DDI request routines are called on behalf of its SCSI target drivers once scsi_hba_fini() is called. SunOS 5.11 1 Nov 1993 scsi_hba_init(9F)

Check Out this Related Man Page

mod_install(9F) 					   Kernel Functions for Drivers 					   mod_install(9F)

NAME
mod_install, mod_remove, mod_info - add, remove or query a loadable module SYNOPSIS
#include <sys/modctl.h> int mod_install(struct modlinkage *modlinkage); int mod_remove(struct modlinkage *modlinkage); int mod_info(struct modlinkage *modlinkage, struct modinfo *modinfo); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
modlinkage Pointer to the loadable module's modlinkage structure which describes what type(s) of module elements are included in this loadable module. modinfo Pointer to the modinfo structure passed to _info(9E). DESCRIPTION
mod_install() must be called from a module's _init(9E) routine. mod_remove() must be called from a module's _fini(9E) routine. mod_info() must be called from a module's _info(9E) routine. When _init(9E) is executing, its call to mod_install() enables other threads to call attach(9E) even prior to mod_install() returning and _init(9E) completion. From a programming standpoint this means that all _init(9E) initialization must occur prior to _init(9E) calling mod_install(). If mod_install() fails (non-zero return value), any initialization must be undone. When _fini(9E) is executing, another thread may call attach(9E) prior to _fini(9E) calling mod_remove(). If this occurs, the mod_remove() fails (non-zero return). From a programming standpoint, this means that _init(9E) initilizations should only be undone after a successful return from mod_remove(). RETURN VALUES
mod_install() and mod_remove() return 0 upon success and non-zero on failure. mod_info() returns a non-zero value on success and 0 upon failure. EXAMPLES
See _init(9E) for an example that uses these functions. SEE ALSO
_fini(9E), _info(9E), _init(9E), modldrv(9S), modlinkage(9S), modlstrmod(9S) Writing Device Drivers SunOS 5.10 12 May 2004 mod_install(9F)
Man Page