Kernel Functions for Drivers sata_hba_event_notify(9F) NAME sata_hba_event_notify - SATA Host Bus Adapter attach routine. SYNOPSIS #include void sata_hba_event_notify(dev_info_t *dev_info, sata_device_t *sata_device, int event ); INTERFACE LEVEL Consolidation Private PARAMETERS dev_info Pointer to a dev_info_t structure, referring to the HBA device instance. sata_device Pointer to sata_address structure identifying a port. event Event type: SATA_EVNT_DEVICE_ATTACHED HBA detected the presence of a device (electrical connection with a device was detected) SATA_EVNT_DEVICE_DETACHED HBA detected the detachment of a device (electrical connection with a device was broken) SATA_EVNT_LINK_LOST HBA lost link with an attached device SATA_EVNT_LINK_ESTABLISHED HBA established a link with an attached device SATA_EVNT_DEVICE_RESET The attached SATA device was reset. SATA_EVNT_POWER_LEVEL_CHANGED The port or entire HBA has changed power level. If sata_device.sata_address specifies no valid address, the event refers to the entire HBA. DESCRIPTION The sata_hba_event_notify() function is called by SATA HBA driver to notify SATA HBA Framework about some asynchronous event, such as device attachement and detachment (hot-plug events). More then one event may be reporter at the same time. SATA HBA Framework will register the event, log warning message and return to the caller. Any action related to the registered event will be performed at later time. If events of the opposite types reported in the same call to sata_hba_event_notify(), for example SATA_EVNT_LINK_LOST and SATA_EVNT_LINK_ESTABLISHED, the sequence of events cannot be established - the port would be re-probed by SATA HBA Framework. In the case SATA_EVNT_LINK_LOST and SATA_EVNT_LINK_ESTABLISHED events being reported simultaneously, if the state of the port has not changed and the link is active, the link problem is presumed temporary and the state of any attached device would not be changed. Event SATA_EVNT_DEVICE_RESET indicates that a SATA device was reset and was put in the reset state. The device reset state (SATA_DSTATE_RESET) shall be set in sata_device structure. SATA HBA driver should reject any sata_pkt directed to device in reset state with SATA_TRAN_BUSY return status and SATA_PKT_BUSY packet completion_reason, until an explicit request from SATA HBA framework to clear this condition. SATA HBA may accept and execute packets for device in reset condition if the SATA_IGNORE_DEV_RESET_STATE flag in sata_cmd structure is set. The device reset condition is cleared by the SATA_CLEAR_DEV_RESET_STATE flag in sata_cmd structure. This function may be called from the interrupt context. RETURN VALUE void