Kernel Functions for Drivers sata_hba_detach(9F) NAME sata_hba_detach - SATA Host Bus Adapter attach routine. SYNOPSIS #include int sata_hba_detach(dev_info_t *dev_info, ddi_detach_cmd_t cmd); INTERFACE LEVEL Consolidation Private PARAMETERS dev_info Pointer to a dev_info_t structure, referring to the HBA device instance. cmd Detach type. Possible values are DDI_DETACH and DDI_SUSPEND. DESCRIPTION DDI_DETACH If cmd is set to DDI_DETACH, the sata_hba_detach() function is used by SATA HBA driver to detach the driver instance from the SATA HBA framework. SATA_HBA framework will free resources allocated per HBA instance, including unregistering interrupts. If sata_hba_detach() determines a particular instance of the device cannot be removed when requested because of some exceptional condition, it will return DDI_FAILURE. In such case SATA HBA driver must ensure that no per instance data or state is modified or freed that would compromise the system or subsequent driver operation and should fail HBA detach(). DDI_SUSPEND If cmd is set to DDI_SUSPEND, sata_hba_detach() is used to suspend all activity of a device before power is (possibly) removed from the device. Saving the hardware state of the device is the responsibility of the SATA HBA driver. SATA HBA framework will prevent any new requests reaching HBA instance and will save attached SATA device configuration and settings. RETURN VALUE Returns DDI_SUCCESS on success or DDI_FAILURE on failure. SEE ALSO sata_hba_attach(9F), sata_hba_init(9F), sata_hba_tran(9S)