FreeBSD/sys/dev/isci/scil/scic_sds_remote_device.c
/**
 * This method check the signature fis of a stp device to decide whether
 * a device is atapi or not.
 *
 * @param[in] this_device The device to be checked.
 *
 * @return TRUE if a device is atapi device. False if a device is not atapi.
 */
This method check the signature fis of a stp device to decide whether
a device is atapi or not.

@param[in] this_device The device to be checked.

@return TRUE if a device is atapi device. False if a device is not atapi.
This method check the signature fis of a stp device to decide whether a device is atapi or not . @param [ in ] this_device The device to be checked . @return TRUE if a device is atapi device . False if a device is not atapi .
BOOL scic_sds_remote_device_is_atapi(
   SCIC_SDS_REMOTE_DEVICE_T * this_device
)
{
   if (!this_device->target_protocols.u.bits.attached_stp_target)
      return FALSE;
   else if (this_device->is_direct_attached)
   {
      SCIC_SDS_PHY_T * phy;
      SCIC_SATA_PHY_PROPERTIES_T properties;
      SATA_FIS_REG_D2H_T * signature_fis;
      phy = scic_sds_port_get_a_connected_phy(this_device->owning_port);
      scic_sata_phy_get_properties(phy, &properties);
      signature_fis = &(properties.signature_fis);
      if (   (signature_fis->sector_count  == 0x01)
          && (signature_fis->lba_low       == 0x01)
          && (signature_fis->lba_mid       == 0x14)
          && (signature_fis->lba_high      == 0xEB)
          && ( (signature_fis->device & 0x5F) == 0x00)
         )
      {
         return TRUE;
      }
      else
         return FALSE;
   }
   else
   {
      return FALSE;
   }
}
BOOL scic_sds_remote_device_is_atapi ( SCIC_SDS_REMOTE_DEVICE_T * this_device ) { if ( ! this_device -> target_protocols . u . bits . attached_stp_target ) return FALSE ; else if ( this_device -> is_direct_attached ) { SCIC_SDS_PHY_T * phy ; SCIC_SATA_PHY_PROPERTIES_T properties ; SATA_FIS_REG_D2H_T * signature_fis ; phy = scic_sds_port_get_a_connected_phy ( this_device -> owning_port ) ; scic_sata_phy_get_properties ( phy , & properties ) ; signature_fis = & ( properties . signature_fis ) ; if ( ( signature_fis -> sector_count == 0x01 ) && ( signature_fis -> lba_low == 0x01 ) && ( signature_fis -> lba_mid == 0x14 ) && ( signature_fis -> lba_high == 0xEB ) && ( ( signature_fis -> device & 0x5F ) == 0x00 ) ) { return TRUE ; } else return FALSE ; } else { return FALSE ; } }
This method check the signature fis of a stp device to decide whether
 a device is atapi or not.
This method check the signature fis of a stp device to decide whether a device is atapi or not .
//decode the signature fis. // An ATA device supporting the PACKET command set. //Expander supported ATAPI device is not currently supported.