Kernel Functions for Drivers sata_hba_init(9F) NAME sata_hba_init, sata_hba_fini - SATA Host Bus Adapter system initialization and completion routines SYNOPSIS #include int sata_hba_init(struct modlinkage *modlp); void sata_hba_fini(struct modlinkage *modlp); INTERFACE LEVEL Consolidation Private PARAMETERS modlp Pointer to the Host Bus Adapters module linkage structure. DESCRITPION sata_hba_init The sata_hba_init() function is the initialization routine for SATA HBA drivers. The sata_hba_init() registers SATA HBA driver with SATA HBA framework. SATA HBA framework will call scsi_hba_init() to register SATA HBA driver/SATA HBA framework pair as the SCSI HBA driver. SATA HBA driver cb_ops are ignored - SATA HBA framework cb_ops are used instead. SATA HBA Framework cb_ops pointer overwrites SATA HBA driver cb_ops pointer in SATA HBA driver dev_ops structure. The sata_hba_init() routine must be called in the SATA 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. sata_hba_fini The sata_hba_fini() function is a completion routine for SATA HBA drivers. It is called by SATA HBA driver to unregister the driver from SATA Framework. SATA HBA framework will call scsi_hba_fini() and it would free resources allocated by sata_hba_init(). The sata_hba_fini() routine should be called in the HBA's _fini(9E) routine if mod_remove(9F)is successful. RETURN VALUE sata_hba_init() returns 0 if successful, and a non-zero value otherwise. If sata_hba_init() fails, the SATA HBA's _init() entry point should return the value returned by sata_hba_init(). SEE ALSO _fini(9E), _init(9E), mod_install(9F), mod_remove(9F), sata_hba_tran(9S), sata_hba_attach(9F), sata_hba_detach(9F)