FreeBSD/sys/dev/isci/scil/scic_sds_phy.c
/**
 * This method decodes the unsolicited frame when the SCIC_SDS_PHY is in the
 * SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF.
 *    - Get the UF Header
 *    - If the UF is an SIGNATURE FIS
 *       - Copy IAF data to local phy object SIGNATURE FIS data buffer.
 *    - else
 *       - log warning message of unexpected unsolicted frame
 *    - release frame buffer
 *
 * @param[in] phy This is SCIC_SDS_PHY object which is being requested to
 *       decode the frame data.
 * @param[in] frame_index This is the index of the unsolicited frame which was
 *       received for this phy.
 *
 * @return SCI_STATUS
 * @retval SCI_SUCCESS
 *
 * @todo Must decode the SIGNATURE FIS data
 */
This method decodes the unsolicited frame when the SCIC_SDS_PHY is in the
SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF.
- Get the UF Header
- If the UF is an SIGNATURE FIS
- Copy IAF data to local phy object SIGNATURE FIS data buffer.
- else
- log warning message of unexpected unsolicted frame
- release frame buffer

@param[in] phy This is SCIC_SDS_PHY object which is being requested to
decode the frame data.
@param[in] frame_index This is the index of the unsolicited frame which was
received for this phy.



@todo Must decode the SIGNATURE FIS data
This method decodes the unsolicited frame when the SCIC_SDS_PHY is in the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF . - Get the UF Header - If the UF is an SIGNATURE FIS - Copy IAF data to local phy object SIGNATURE FIS data buffer . - else - log warning message of unexpected unsolicted frame - release frame buffer @param [ in ] phy This is SCIC_SDS_PHY object which is being requested to decode the frame data . @param [ in ] frame_index This is the index of the unsolicited frame which was received for this phy . @todo Must decode the SIGNATURE FIS data
static
SCI_STATUS scic_sds_phy_starting_substate_await_sig_fis_frame_handler(
   SCIC_SDS_PHY_T *this_phy,
   U32            frame_index
)
{
   SCI_STATUS          result;
   U32               * frame_words;
   SATA_FIS_HEADER_T * fis_frame_header;
   U32               * fis_frame_data;
   result = scic_sds_unsolicited_frame_control_get_header(
               &(scic_sds_phy_get_controller(this_phy)->uf_control),
               frame_index,
               (void **)&frame_words);
   if (result != SCI_SUCCESS)
   {
      return result;
   }
   fis_frame_header = (SATA_FIS_HEADER_T *)frame_words;
   if (
         (fis_frame_header->fis_type == SATA_FIS_TYPE_REGD2H)
      && !(fis_frame_header->status & ATA_STATUS_REG_BSY_BIT)
      )
   {
      scic_sds_unsolicited_frame_control_get_buffer(
         &(scic_sds_phy_get_controller(this_phy)->uf_control),
         frame_index,
         (void **)&fis_frame_data
      );
      scic_sds_controller_copy_sata_response(
         &this_phy->phy_type.sata.signature_fis_buffer,
         frame_words,
         fis_frame_data
      );
      sci_base_state_machine_change_state(
         scic_sds_phy_get_starting_substate_machine(this_phy),
         SCIC_SDS_PHY_STARTING_SUBSTATE_FINAL
         );
      result = SCI_SUCCESS;
   }
   else
   {
      SCIC_LOG_WARNING((
         sci_base_object_get_logger(this_phy),
         SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_UNSOLICITED_FRAMES,
         "PHY starting substate machine received unexpected frame id %x\n",
         frame_index
      ));
   }
   scic_sds_controller_release_frame(
      scic_sds_phy_get_controller(this_phy), frame_index
      );
   return result;
}
static SCI_STATUS scic_sds_phy_starting_substate_await_sig_fis_frame_handler ( SCIC_SDS_PHY_T * this_phy , U32 frame_index ) { SCI_STATUS result ; U32 * frame_words ; SATA_FIS_HEADER_T * fis_frame_header ; U32 * fis_frame_data ; result = scic_sds_unsolicited_frame_control_get_header ( & ( scic_sds_phy_get_controller ( this_phy ) -> uf_control ) , frame_index , ( void * * ) & frame_words ) ; if ( result != SCI_SUCCESS ) { return result ; } fis_frame_header = ( SATA_FIS_HEADER_T * ) frame_words ; if ( ( fis_frame_header -> fis_type == SATA_FIS_TYPE_REGD2H ) && ! ( fis_frame_header -> status & ATA_STATUS_REG_BSY_BIT ) ) { scic_sds_unsolicited_frame_control_get_buffer ( & ( scic_sds_phy_get_controller ( this_phy ) -> uf_control ) , frame_index , ( void * * ) & fis_frame_data ) ; scic_sds_controller_copy_sata_response ( & this_phy -> phy_type . sata . signature_fis_buffer , frame_words , fis_frame_data ) ; sci_base_state_machine_change_state ( scic_sds_phy_get_starting_substate_machine ( this_phy ) , SCIC_SDS_PHY_STARTING_SUBSTATE_FINAL ) ; result = SCI_SUCCESS ; } else { SCIC_LOG_WARNING ( ( sci_base_object_get_logger ( this_phy ) , SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_UNSOLICITED_FRAMES , " \n " , frame_index ) ) ; } scic_sds_controller_release_frame ( scic_sds_phy_get_controller ( this_phy ) , frame_index ) ; return result ; }
This method decodes the unsolicited frame when the SCIC_SDS_PHY is in the
 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF.
This method decodes the unsolicited frame when the SCIC_SDS_PHY is in the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF .
// We got the IAF we can now go to the await spinup semaphore state // Regardless of the result release this frame since we are done with it