FreeBSD/sys/dev/isci/scil/scif_sas_remote_device_state_handlers.c
static
void scif_sas_remote_device_updating_port_width_state_stop_complete_handler(
   SCIF_SAS_REMOTE_DEVICE_T * fw_device,
   SCI_STATUS                 completion_status
)
{
   SCIF_LOG_INFO((
      sci_base_object_get_logger(fw_device),
      SCIF_LOG_OBJECT_REMOTE_DEVICE,
      "RemoteDevice:0x%x updating port width state stop complete handler\n",
      fw_device,
      sci_base_state_machine_get_state(&fw_device->parent.state_machine)
   ));

   if ( fw_device->destination_state
           == SCIF_SAS_REMOTE_DEVICE_DESTINATION_STATE_STOPPING )
   {
      //Device directly transits to STOPPED STATE from UPDATING_PORT_WIDTH state,
      fw_device->domain->device_start_count--;

      //if the destination state of this device change to STOPPING, no matter
      //whether we need to update the port width again, just make the device
      //go to the STOPPED state.
      sci_base_state_machine_change_state(
         &fw_device->parent.state_machine,
         SCI_BASE_REMOTE_DEVICE_STATE_STOPPED
      );
   }
   else
   {
      scic_remote_device_set_port_width(
         fw_device->core_object,
         fw_device->device_port_width
      );

      //Device stop complete, means the RNC has been destructed. Now we need to
      //start core device so the RNC with updated port width will be posted.
      scic_remote_device_start(
         fw_device->core_object, SCIF_SAS_REMOTE_DEVICE_CORE_OP_TIMEOUT);
   }
}
/**
 * @brief This method provides handling of device stop complete duing
 *        UPDATING_PORT_WIDTH state.
 *
 * @param[in]  remote_device This parameter specifies the remote device object
 *             which is stop complete.
 *
 * @return none.
 */
@brief This method provides handling of device stop complete duing
UPDATING_PORT_WIDTH state.

@param[in]  remote_device This parameter specifies the remote device object
which is stop complete.

@return none.
@brief This method provides handling of device stop complete duing UPDATING_PORT_WIDTH state . @param [ in ] remote_device This parameter specifies the remote device object which is stop complete . @return none .
static
void scif_sas_remote_device_updating_port_width_state_stop_complete_handler(
   SCIF_SAS_REMOTE_DEVICE_T * fw_device,
   SCI_STATUS                 completion_status
)
{
   SCIF_LOG_INFO((
      sci_base_object_get_logger(fw_device),
      SCIF_LOG_OBJECT_REMOTE_DEVICE,
      "RemoteDevice:0x%x updating port width state stop complete handler\n",
      fw_device,
      sci_base_state_machine_get_state(&fw_device->parent.state_machine)
   ));
   if ( fw_device->destination_state
           == SCIF_SAS_REMOTE_DEVICE_DESTINATION_STATE_STOPPING )
   {
      fw_device->domain->device_start_count--;
      sci_base_state_machine_change_state(
         &fw_device->parent.state_machine,
         SCI_BASE_REMOTE_DEVICE_STATE_STOPPED
      );
   }
   else
   {
      scic_remote_device_set_port_width(
         fw_device->core_object,
         fw_device->device_port_width
      );
      scic_remote_device_start(
         fw_device->core_object, SCIF_SAS_REMOTE_DEVICE_CORE_OP_TIMEOUT);
   }
}
static void scif_sas_remote_device_updating_port_width_state_stop_complete_handler ( SCIF_SAS_REMOTE_DEVICE_T * fw_device , SCI_STATUS completion_status ) { SCIF_LOG_INFO ( ( sci_base_object_get_logger ( fw_device ) , SCIF_LOG_OBJECT_REMOTE_DEVICE , " \n " , fw_device , sci_base_state_machine_get_state ( & fw_device -> parent . state_machine ) ) ) ; if ( fw_device -> destination_state == SCIF_SAS_REMOTE_DEVICE_DESTINATION_STATE_STOPPING ) { fw_device -> domain -> device_start_count -- ; sci_base_state_machine_change_state ( & fw_device -> parent . state_machine , SCI_BASE_REMOTE_DEVICE_STATE_STOPPED ) ; } else { scic_remote_device_set_port_width ( fw_device -> core_object , fw_device -> device_port_width ) ; scic_remote_device_start ( fw_device -> core_object , SCIF_SAS_REMOTE_DEVICE_CORE_OP_TIMEOUT ) ; } }
@brief This method provides handling of device stop complete duing
        UPDATING_PORT_WIDTH state.
@brief This method provides handling of device stop complete duing UPDATING_PORT_WIDTH state .
//Device directly transits to STOPPED STATE from UPDATING_PORT_WIDTH state, //if the destination state of this device change to STOPPING, no matter //whether we need to update the port width again, just make the device //go to the STOPPED state. //Device stop complete, means the RNC has been destructed. Now we need to //start core device so the RNC with updated port width will be posted.