FreeBSD/sys/dev/isci/scil/scic_sds_remote_device.c
/**
 * This method is a general ssp frame handler.  In most cases the device
 * object needs to route the unsolicited frame processing to the io request
 * object.  This method decodes the tag for the io request object and routes
 * the unsolicited frame to that object.
 *
 * @param[in] device The SCI_BASE_REMOTE_DEVICE which is then cast into a
 *       SCIC_SDS_REMOTE_DEVICE.
 * @param[in] frame_index The frame index for which the SCIC_SDS_CONTROLLER
 *       wants this device object to process.
 *
 * @return SCI_STATUS
 * @retval SCI_FAILURE_INVALID_STATE
 */
This method is a general ssp frame handler.  In most cases the device
object needs to route the unsolicited frame processing to the io request
object.  This method decodes the tag for the io request object and routes
the unsolicited frame to that object.

@param[in] device The SCI_BASE_REMOTE_DEVICE which is then cast into a
SCIC_SDS_REMOTE_DEVICE.
@param[in] frame_index The frame index for which the SCIC_SDS_CONTROLLER
wants this device object to process.


This method is a general ssp frame handler . In most cases the device object needs to route the unsolicited frame processing to the io request object . This method decodes the tag for the io request object and routes the unsolicited frame to that object . @param [ in ] device The SCI_BASE_REMOTE_DEVICE which is then cast into a SCIC_SDS_REMOTE_DEVICE . @param [ in ] frame_index The frame index for which the SCIC_SDS_CONTROLLER wants this device object to process .
SCI_STATUS scic_sds_remote_device_general_frame_handler(
   SCIC_SDS_REMOTE_DEVICE_T *this_device,
   U32                       frame_index
)
{
   SCI_STATUS result;
   SCI_SSP_FRAME_HEADER_T *frame_header;
   SCIC_SDS_REQUEST_T     *io_request;
   result = scic_sds_unsolicited_frame_control_get_header(
      &(scic_sds_remote_device_get_controller(this_device)->uf_control),
      frame_index,
      (void **)&frame_header
   );
   if (SCI_SUCCESS == result)
   {
      io_request = scic_sds_controller_get_io_request_from_tag(
         scic_sds_remote_device_get_controller(this_device), frame_header->tag);
      if (  (io_request == SCI_INVALID_HANDLE)
         || (io_request->target_device != this_device) )
      {
         scic_sds_controller_release_frame(
            scic_sds_remote_device_get_controller(this_device), frame_index
         );
      }
      else
      {
         result = io_request->state_handlers->frame_handler(
                                                    io_request, frame_index);
      }
   }
   return result;
}
SCI_STATUS scic_sds_remote_device_general_frame_handler ( SCIC_SDS_REMOTE_DEVICE_T * this_device , U32 frame_index ) { SCI_STATUS result ; SCI_SSP_FRAME_HEADER_T * frame_header ; SCIC_SDS_REQUEST_T * io_request ; result = scic_sds_unsolicited_frame_control_get_header ( & ( scic_sds_remote_device_get_controller ( this_device ) -> uf_control ) , frame_index , ( void * * ) & frame_header ) ; if ( SCI_SUCCESS == result ) { io_request = scic_sds_controller_get_io_request_from_tag ( scic_sds_remote_device_get_controller ( this_device ) , frame_header -> tag ) ; if ( ( io_request == SCI_INVALID_HANDLE ) || ( io_request -> target_device != this_device ) ) { scic_sds_controller_release_frame ( scic_sds_remote_device_get_controller ( this_device ) , frame_index ) ; } else { result = io_request -> state_handlers -> frame_handler ( io_request , frame_index ) ; } } return result ; }
This method is a general ssp frame handler.
This method is a general ssp frame handler .
// We could not map this tag to a valid IO request // Just toss the frame and continue // The IO request is now in charge of releasing the frame