FreeBSD/sys/dev/isci/scil/scif_sas_smp_io_request.c
/**
 * @brief This method retry the internal smp request.
 *
 * @param[in] fw_device This parameter specifies the remote device for
 *            which the internal IO request is destined.
 * @param[in] retry_count This parameter specifies how many times the
 *            old smp request has been retried.
 *
 * @return none.
 */
@brief This method retry the internal smp request.
@param[in] fw_device This parameter specifies the remote device for
which the internal IO request is destined.
@param[in] retry_count This parameter specifies how many times the
old smp request has been retried.

@return none.
@brief This method retry the internal smp request . @param [ in ] fw_device This parameter specifies the remote device for which the internal IO request is destined . @param [ in ] retry_count This parameter specifies how many times the old smp request has been retried . @return none .
SCI_STATUS scif_sas_smp_internal_request_retry(
   SCIF_SAS_REMOTE_DEVICE_T * fw_device
)
{
   SCIF_SAS_CONTROLLER_T * fw_controller;
   SCIF_SAS_IO_REQUEST_T * new_io;
   void                  * new_request_memory = NULL;
   U8 retry_count = fw_device->protocol_device.smp_device.io_retry_count;
   SCIF_LOG_TRACE((
      sci_base_object_get_logger(fw_device),
      SCIF_LOG_OBJECT_IO_REQUEST | SCIF_LOG_OBJECT_DOMAIN_DISCOVERY,
      "scif_sas_smp_internal_request_retry(0x%x, 0x%x) time %d!\n",
      fw_device, retry_count
   ));
   fw_controller = fw_device->domain->controller;
   switch (fw_device->protocol_device.smp_device.current_smp_request)
   {
      case SMP_FUNCTION_REPORT_GENERAL:
         new_request_memory = scif_sas_smp_request_construct_report_general(
            fw_controller, fw_device
         );
         break;
      case SMP_FUNCTION_DISCOVER:
         new_request_memory = scif_sas_smp_request_construct_discover(
            fw_controller, fw_device,
            fw_device->protocol_device.smp_device.current_activity_phy_index,
            NULL, NULL
         );
         break;
      case SMP_FUNCTION_REPORT_PHY_SATA:
         new_request_memory = scif_sas_smp_request_construct_report_phy_sata(
            fw_controller, fw_device,
            fw_device->protocol_device.smp_device.current_activity_phy_index
         );
         break;
      default:
         break;
   } 
   if (new_request_memory != NULL)
   {
      new_io = (SCIF_SAS_IO_REQUEST_T *) new_request_memory;
      new_io->retry_count = ++retry_count;
      scif_cb_start_internal_io_task_schedule(
            fw_controller,
            scif_sas_controller_start_high_priority_io,
            fw_controller
         );
      return SCI_SUCCESS;
   }
   else
      return SCI_FAILURE_INSUFFICIENT_RESOURCES;
}
SCI_STATUS scif_sas_smp_internal_request_retry ( SCIF_SAS_REMOTE_DEVICE_T * fw_device ) { SCIF_SAS_CONTROLLER_T * fw_controller ; SCIF_SAS_IO_REQUEST_T * new_io ; void * new_request_memory = NULL ; U8 retry_count = fw_device -> protocol_device . smp_device . io_retry_count ; SCIF_LOG_TRACE ( ( sci_base_object_get_logger ( fw_device ) , SCIF_LOG_OBJECT_IO_REQUEST | SCIF_LOG_OBJECT_DOMAIN_DISCOVERY , " \n " , fw_device , retry_count ) ) ; fw_controller = fw_device -> domain -> controller ; switch ( fw_device -> protocol_device . smp_device . current_smp_request ) { case SMP_FUNCTION_REPORT_GENERAL : new_request_memory = scif_sas_smp_request_construct_report_general ( fw_controller , fw_device ) ; break ; case SMP_FUNCTION_DISCOVER : new_request_memory = scif_sas_smp_request_construct_discover ( fw_controller , fw_device , fw_device -> protocol_device . smp_device . current_activity_phy_index , NULL , NULL ) ; break ; case SMP_FUNCTION_REPORT_PHY_SATA : new_request_memory = scif_sas_smp_request_construct_report_phy_sata ( fw_controller , fw_device , fw_device -> protocol_device . smp_device . current_activity_phy_index ) ; break ; default : break ; } if ( new_request_memory != NULL ) { new_io = ( SCIF_SAS_IO_REQUEST_T * ) new_request_memory ; new_io -> retry_count = ++ retry_count ; scif_cb_start_internal_io_task_schedule ( fw_controller , scif_sas_controller_start_high_priority_io , fw_controller ) ; return SCI_SUCCESS ; } else return SCI_FAILURE_INSUFFICIENT_RESOURCES ; }
@brief This method retry the internal smp request.
@brief This method retry the internal smp request .
//We are retrying an internal io. So we are going to allocate //a new memory from internal io memory pool. //unsupported case, TBD //end of switch //set the retry count to new built smp request. //need to schedule the DPC here.