FreeBSD/sys/dev/isci/scil/sati_report_luns.c
/**
 * @brief This method will translate the REPORT LUN SCSI command.  This
 *        command is immediately completed, since there is no applicable
 *        ATA/ATAPI command.  The data payload is written and SATI_COMPLETE
 *        is always returned.
 *        For more information on the parameters passed to this method,
 *        please reference sati_translate_command().
 *
 * @return This method always indicates the translation is complete.
 * @retval SATI_COMPLETE This value is always returned.
 */
@brief This method will translate the REPORT LUN SCSI command.  This
command is immediately completed, since there is no applicable
ATA/ATAPI command.  The data payload is written and SATI_COMPLETE
is always returned.
For more information on the parameters passed to this method,
please reference sati_translate_command().

@return This method always indicates the translation is complete.
@retval SATI_COMPLETE This value is always returned.
@brief This method will translate the REPORT LUN SCSI command . This command is immediately completed since there is no applicable ATA / ATAPI command . The data payload is written and SATI_COMPLETE is always returned . For more information on the parameters passed to this method please reference sati_translate_command () . @return This method always indicates the translation is complete . @retval SATI_COMPLETE This value is always returned .
SATI_STATUS sati_report_luns_translate_command(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   void                       * ata_io
)
{
   U8 * cdb = sati_cb_get_cdb_address(scsi_io);
   sequence->allocation_length = (sati_get_cdb_byte(cdb, 6) << 24) |
                                 (sati_get_cdb_byte(cdb, 7) << 16) |
                                 (sati_get_cdb_byte(cdb, 8) << 8)  |
                                 (sati_get_cdb_byte(cdb, 9));
   sati_set_data_byte(sequence, scsi_io, 0, 0);
   sati_set_data_byte(sequence, scsi_io, 1, 0);
   sati_set_data_byte(sequence, scsi_io, 2, 0);
   sati_set_data_byte(sequence, scsi_io, 3, 8);
   sati_set_data_byte(sequence, scsi_io, 4, 0);
   sati_set_data_byte(sequence, scsi_io, 5, 0);
   sati_set_data_byte(sequence, scsi_io, 6, 0);
   sati_set_data_byte(sequence, scsi_io, 7, 0);
   sati_set_data_byte(sequence, scsi_io, 8, 0);
   sati_set_data_byte(sequence, scsi_io, 9, 0);
   sati_set_data_byte(sequence, scsi_io, 10, 0);
   sati_set_data_byte(sequence, scsi_io, 11, 0);
   sati_set_data_byte(sequence, scsi_io, 12, 0);
   sati_set_data_byte(sequence, scsi_io, 13, 0);
   sati_set_data_byte(sequence, scsi_io, 14, 0);
   sati_set_data_byte(sequence, scsi_io, 15, 0);
   return SATI_COMPLETE;
}
SATI_STATUS sati_report_luns_translate_command ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , void * ata_io ) { U8 * cdb = sati_cb_get_cdb_address ( scsi_io ) ; sequence -> allocation_length = ( sati_get_cdb_byte ( cdb , 6 ) << 24 ) | ( sati_get_cdb_byte ( cdb , 7 ) << 16 ) | ( sati_get_cdb_byte ( cdb , 8 ) << 8 ) | ( sati_get_cdb_byte ( cdb , 9 ) ) ; sati_set_data_byte ( sequence , scsi_io , 0 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 1 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 2 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 3 , 8 ) ; sati_set_data_byte ( sequence , scsi_io , 4 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 5 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 6 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 7 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 8 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 9 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 10 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 11 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 12 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 13 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 14 , 0 ) ; sati_set_data_byte ( sequence , scsi_io , 15 , 0 ) ; return SATI_COMPLETE ; }
@brief This method will translate the REPORT LUN SCSI command.
@brief This method will translate the REPORT LUN SCSI command .
// Set the data length based on the allocation length field in the CDB. // The first 4 bytes indicate the length of the LUN list.  Each // LUN entry is 8 bytes.  There is only ever LUN 0 for ATA/ATAPI // devices.  The value reported is: n-7, where n is the last byte // offset (i.e. 15) in the REPORT LUN data. // Bytes 4-7 are reserved. // Add in our single LUN of zero.