FreeBSD/sys/dev/isci/scil/sati_unmap.c
/**
 * @brief This method updates the unmap sequence state to the next
 *        unmap descriptor
 *
 * @return Indicate if the method was successfully completed.
 * @retval SATI_SUCCESS This is returned in all other cases.
 */
@brief This method updates the unmap sequence state to the next
unmap descriptor

@return Indicate if the method was successfully completed.
@retval SATI_SUCCESS This is returned in all other cases.
@brief This method updates the unmap sequence state to the next unmap descriptor @return Indicate if the method was successfully completed . @retval SATI_SUCCESS This is returned in all other cases .
SATI_STATUS sati_unmap_load_next_descriptor(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io
)
{
   SATI_UNMAP_PROCESSING_STATE_T * unmap_process_state;
   U32                             index;
   U8                              unmap_block_descriptor[16];
   unmap_process_state = &sequence->command_specific_data.unmap_process_state;
   for(index = unmap_process_state->current_unmap_block_descriptor_index;
       index < unmap_process_state->current_unmap_block_descriptor_index +
               SATI_UNMAP_SIZEOF_SCSI_UNMAP_BLOCK_DESCRIPTOR;
       index++)
   {
      sati_get_data_byte(sequence,
         scsi_io,
         index,
         &unmap_block_descriptor[index-unmap_process_state->current_unmap_block_descriptor_index]);
   }
   unmap_process_state->current_lba_count = (unmap_block_descriptor[8] << 24) |
                                            (unmap_block_descriptor[9] << 16) |
                                            (unmap_block_descriptor[10] << 8) |
                                            (unmap_block_descriptor[11]);
   unmap_process_state->current_lba       = ((SATI_LBA)(unmap_block_descriptor[0]) << 56) |
                                            ((SATI_LBA)(unmap_block_descriptor[1]) << 48) |
                                            ((SATI_LBA)(unmap_block_descriptor[2]) << 40) |
                                            ((SATI_LBA)(unmap_block_descriptor[3]) << 32) |
                                            ((SATI_LBA)(unmap_block_descriptor[4]) << 24) |
                                            ((SATI_LBA)(unmap_block_descriptor[5]) << 16) |
                                            ((SATI_LBA)(unmap_block_descriptor[6]) << 8) |
                                            ((SATI_LBA)(unmap_block_descriptor[7]));
   unmap_process_state->next_lba          = 0;
   unmap_process_state->current_unmap_block_descriptor_index += SATI_UNMAP_SIZEOF_SCSI_UNMAP_BLOCK_DESCRIPTOR;
   return SATI_SUCCESS;
}
SATI_STATUS sati_unmap_load_next_descriptor ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io ) { SATI_UNMAP_PROCESSING_STATE_T * unmap_process_state ; U32 index ; U8 unmap_block_descriptor [ 16 ] ; unmap_process_state = & sequence -> command_specific_data . unmap_process_state ; for ( index = unmap_process_state -> current_unmap_block_descriptor_index ; index < unmap_process_state -> current_unmap_block_descriptor_index + SATI_UNMAP_SIZEOF_SCSI_UNMAP_BLOCK_DESCRIPTOR ; index ++ ) { sati_get_data_byte ( sequence , scsi_io , index , & unmap_block_descriptor [ index - unmap_process_state -> current_unmap_block_descriptor_index ] ) ; } unmap_process_state -> current_lba_count = ( unmap_block_descriptor [ 8 ] << 24 ) | ( unmap_block_descriptor [ 9 ] << 16 ) | ( unmap_block_descriptor [ 10 ] << 8 ) | ( unmap_block_descriptor [ 11 ] ) ; unmap_process_state -> current_lba = ( ( SATI_LBA ) ( unmap_block_descriptor [ 0 ] ) << 56 ) | ( ( SATI_LBA ) ( unmap_block_descriptor [ 1 ] ) << 48 ) | ( ( SATI_LBA ) ( unmap_block_descriptor [ 2 ] ) << 40 ) | ( ( SATI_LBA ) ( unmap_block_descriptor [ 3 ] ) << 32 ) | ( ( SATI_LBA ) ( unmap_block_descriptor [ 4 ] ) << 24 ) | ( ( SATI_LBA ) ( unmap_block_descriptor [ 5 ] ) << 16 ) | ( ( SATI_LBA ) ( unmap_block_descriptor [ 6 ] ) << 8 ) | ( ( SATI_LBA ) ( unmap_block_descriptor [ 7 ] ) ) ; unmap_process_state -> next_lba = 0 ; unmap_process_state -> current_unmap_block_descriptor_index += SATI_UNMAP_SIZEOF_SCSI_UNMAP_BLOCK_DESCRIPTOR ; return SATI_SUCCESS ; }
@brief This method updates the unmap sequence state to the next
        unmap descriptor
@brief This method updates the unmap sequence state to the next unmap descriptor
// Load the next descriptor // Update the internal state for the next translation pass // Update the index for the next descriptor to translate