Lines Matching +full:sense +full:-
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
9 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
22 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
28 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
61 * structure data, fill in sense data, etc.
73 * length for an ATA non-data command.
76 * values in a non-data ATA command constuct.
90 sequence->data_direction = SATI_DATA_DIRECTION_NONE; in sati_ata_non_data_command()
91 sequence->protocol = SAT_PROTOCOL_NON_DATA; in sati_ata_non_data_command()
92 sequence->ata_transfer_length = 0; in sati_ata_non_data_command()
116 sequence->data_direction = SATI_DATA_DIRECTION_IN; in sati_ata_identify_device_construct()
117 sequence->protocol = SAT_PROTOCOL_PIO_DATA_IN; in sati_ata_identify_device_construct()
118 sequence->ata_transfer_length = sizeof(ATA_IDENTIFY_DEVICE_DATA_T); in sati_ata_identify_device_construct()
140 sequence->data_direction = SATI_DATA_DIRECTION_IN; in sati_ata_execute_device_diagnostic_construct()
141 sequence->protocol = SAT_PROTOCOL_DEVICE_DIAGNOSTIC; in sati_ata_execute_device_diagnostic_construct()
142 sequence->ata_transfer_length = 16; in sati_ata_execute_device_diagnostic_construct()
163 * in the 0x20 - 0x7E ASCII range.
177 // default to " " (i.e. 0x20) for all non-ascii printable characters. in sati_set_ascii_data_byte()
192 * It will perform the byte swap from the 16-bit identify field
210 * in the 0x20 - 0x7E ASCII range.
245 length -= 2; in sati_ata_identify_device_copy_data()
282 length--; in sati_copy_data()
287 * @brief This method extracts the Logical Block Address high and low 32-bit
288 * values and the sector count 32-bit value from the ATA identify
295 * 16-bits should always be 0, since 48-bits of LBA is the most
299 * @param[out] sector_size This parameter specifies the 32-bits of sector
314 // 48-bit addressing. Bit 10 of Word 86 of ATA Identify in sati_ata_identify_device_get_sector_info()
315 if (identify->command_set_enabled1 in sati_ata_identify_device_get_sector_info()
318 // This drive supports 48-bit addressing in sati_ata_identify_device_get_sector_info()
320 *lba_high = identify->max_48bit_lba[7] << 24; in sati_ata_identify_device_get_sector_info()
321 *lba_high |= identify->max_48bit_lba[6] << 16; in sati_ata_identify_device_get_sector_info()
322 *lba_high |= identify->max_48bit_lba[5] << 8; in sati_ata_identify_device_get_sector_info()
323 *lba_high |= identify->max_48bit_lba[4]; in sati_ata_identify_device_get_sector_info()
325 *lba_low = identify->max_48bit_lba[3] << 24; in sati_ata_identify_device_get_sector_info()
326 *lba_low |= identify->max_48bit_lba[2] << 16; in sati_ata_identify_device_get_sector_info()
327 *lba_low |= identify->max_48bit_lba[1] << 8; in sati_ata_identify_device_get_sector_info()
328 *lba_low |= identify->max_48bit_lba[0]; in sati_ata_identify_device_get_sector_info()
332 // This device doesn't support 48-bit addressing in sati_ata_identify_device_get_sector_info()
335 *lba_low = identify->total_num_sectors[3] << 24; in sati_ata_identify_device_get_sector_info()
336 *lba_low |= identify->total_num_sectors[2] << 16; in sati_ata_identify_device_get_sector_info()
337 *lba_low |= identify->total_num_sectors[1] << 8; in sati_ata_identify_device_get_sector_info()
338 *lba_low |= identify->total_num_sectors[0]; in sati_ata_identify_device_get_sector_info()
343 if (identify->physical_logical_sector_info in sati_ata_identify_device_get_sector_info()
346 *sector_size = identify->words_per_logical_sector[3] << 24; in sati_ata_identify_device_get_sector_info()
347 *sector_size |= identify->words_per_logical_sector[2] << 16; in sati_ata_identify_device_get_sector_info()
348 *sector_size |= identify->words_per_logical_sector[1] << 8; in sati_ata_identify_device_get_sector_info()
349 *sector_size |= identify->words_per_logical_sector[0]; in sati_ata_identify_device_get_sector_info()
383 * @brief This method is utilized to set a specific byte in the sense
385 * isn't larger then the length of the requested sense data.
388 * for which to set the sense data byte.
390 * the sense data buffer where the data should be written.
391 * @param[in] value This parameter specifies the 8-bit value to be written
392 * into the sense data area.
403 // Ensure that we don't attempt to write past the end of the sense in sati_set_sense_data_byte()
417 * @param[in] sense_data_length This parameter specifies the sense data
431 rsp_iu->sense_data_length[3] = sense_data_length; in sati_scsi_common_response_iu_construct()
432 rsp_iu->sense_data_length[2] = 0; in sati_scsi_common_response_iu_construct()
433 rsp_iu->sense_data_length[1] = 0; in sati_scsi_common_response_iu_construct()
434 rsp_iu->sense_data_length[0] = 0; in sati_scsi_common_response_iu_construct()
435 rsp_iu->status = scsi_status; in sati_scsi_common_response_iu_construct()
436 rsp_iu->data_present = data_present; in sati_scsi_common_response_iu_construct()
440 * @brief This method will construct the buffer for sense data
441 * sense data buffer location. Additionally, it will set the user's
445 * for which to construct the buffer for sense data.
471 *sense_data = (U8*) rsp_iu->data; in sati_scsi_get_sense_data_buffer()
488 if (sequence->device->descriptor_sense_enable) in sati_scsi_get_sense_data_response_code()
499 * @brief This method will return length of descriptor sense data for executed command.
501 * @return sense data length
557 * @brief This method will return length of sense data.
559 * @return sense data length
583 * @brief This method will construct the sense data buffer in the user's
584 * sense data buffer location. Additionally, it will set the user's
588 * for which to construct the sense data.
590 * for which to construct the sense data.
593 * @param[in] sense_key This parameter specifies the sense key to
596 * additional sense code (ASC) key to be set for the user's
599 * the additional sense code qualifier (ASCQ) key to be set
631 sequence->is_sense_response_set = TRUE; in sati_scsi_sense_data_construct()
636 * sense data buffer location.
639 * for which to set the sense data byte.
640 * @param[in] sense_len This parameter specifies length of the sense data
661 * @brief This method will construct the command-specific descriptor for
662 * the descriptor sense data buffer in the user's sense data buffer
666 * for which to set the sense data byte.
667 * @param[in] sense_len This parameter specifies length of the sense data
672 * to set the command-specific information buffer.
692 // COMMAND-SPECIFIC INFORMATION field shall be set to FFFF_FFFF_FFFF_FFFFh in sati_scsi_command_specific_descriptor_construct()
699 * the descriptor sense data buffer in the user's sense data buffer
703 * for which to set the sense data byte.
704 * @param[in] sense_len This parameter specifies length of the sense data
734 * sense data buffer location.
737 * for which to construct the sense data.
739 * for which to set the sense data byte.
740 * @param[in] sense_len This parameter specifies length of the sense data
766 sense_len - offset); in sati_scsi_common_descriptors_construct()
771 sense_len - offset, in sati_scsi_common_descriptors_construct()
781 sense_len - offset, in sati_scsi_common_descriptors_construct()
787 sense_len - offset, in sati_scsi_common_descriptors_construct()
818 sense_len - offset, in sati_scsi_common_descriptors_construct()
827 * @brief This method will construct the descriptor sense data buffer in
828 * the user's sense data buffer location. Additionally, it will set
832 * for which to construct the sense data.
834 * for which to construct the sense data.
837 * @param[in] sense_key This parameter specifies the sense key to
840 * additional sense code (ASC) key to be set for the user's
843 * the additional sense code qualifier (ASCQ) key to be set
879 …byte(sense_data, sense_len, 7, sati_scsi_get_descriptor_sense_data_length(sequence, scsi_io) - 8); in sati_scsi_descriptor_sense_data_construct()
883 * @brief This method will construct the fixed format sense data buffer
884 * in the user's sense data buffer location. Additionally, it will
888 * for which to construct the sense data.
890 * for which to construct the sense data.
893 * @param[in] sense_key This parameter specifies the sense key to
896 * additional sense code (ASC) key to be set for the user's
899 * the additional sense code qualifier (ASCQ) key to be set
919 // Write out the sense data format per SPC-4. in sati_scsi_fixed_sense_data_construct()
920 // We utilize the fixed format sense data format. in sati_scsi_fixed_sense_data_construct()
935 sati_set_sense_data_byte(sense_data, sense_len, 7, (sense_len < 18 ? sense_len - 1 : 17) - 7); in sati_scsi_fixed_sense_data_construct()
949 * @brief This method will construct common sense data that will be identical in
950 * both read error sense construct functions.
955 * for which to set the sense data byte.
956 * @param[in] sense_len This parameter specifies length of the sense data
958 * @param[in] sense_key This parameter specifies the sense key to
961 * additional sense code (ASC) key to be set for the user's
964 * the additional sense code qualifier (ASCQ) key to be set
984 sati_set_sense_data_byte(sense_data, sense_len, 7, (sense_len < 18 ? sense_len - 1 : 17) - 7); in sati_scsi_common_fixed_sense_construct()
998 * @brief This method will construct the descriptor sense data buffer in
999 * the user's sense data buffer location. Additionally, it will set
1003 * for which to construct the sense data.
1005 * for which to construct the sense data.
1008 * @param[in] sense_key This parameter specifies the sense key to
1011 * additional sense code (ASC) key to be set for the user's
1014 * the additional sense code qualifier (ASCQ) key to be set
1040 …byte(sense_data, sense_len, 7, sati_scsi_get_descriptor_sense_data_length(sequence, scsi_io) - 8); in sati_scsi_common_descriptor_sense_construct()
1044 * @brief This method will construct the sense data buffer in the user's
1045 * descriptor sense data buffer location. Additionally, it will set
1050 * for which to construct the sense data.
1052 * for which to construct the sense data.
1057 * @param[in] sense_key This parameter specifies the sense key to
1060 * additional sense code (ASC) key to be set for the user's
1063 * the additional sense code qualifier (ASCQ) key to be set
1096 information_buff[2] = ncq_log->lba_47_40; in sati_scsi_read_ncq_error_descriptor_sense_construct()
1097 information_buff[3] = ncq_log->lba_39_32; in sati_scsi_read_ncq_error_descriptor_sense_construct()
1098 information_buff[4] = ncq_log->lba_31_24; in sati_scsi_read_ncq_error_descriptor_sense_construct()
1099 information_buff[5] = ncq_log->lba_23_16; in sati_scsi_read_ncq_error_descriptor_sense_construct()
1100 information_buff[6] = ncq_log->lba_15_8; in sati_scsi_read_ncq_error_descriptor_sense_construct()
1101 information_buff[7] = ncq_log->lba_7_0; in sati_scsi_read_ncq_error_descriptor_sense_construct()
1116 * @brief This method will construct the sense data buffer in the user's
1117 * sense data buffer location. Additionally, it will set the user's
1121 * for which to construct the sense data.
1123 * for which to construct the sense data.
1128 * @param[in] sense_key This parameter specifies the sense key to
1131 * additional sense code (ASC) key to be set for the user's
1134 * the additional sense code qualifier (ASCQ) key to be set
1159 if(ncq_log->lba_39_32 > 0) in sati_scsi_read_ncq_error_fixed_sense_construct()
1171 sati_set_sense_data_byte(sense_data, sense_len, 3, ncq_log->lba_31_24); in sati_scsi_read_ncq_error_fixed_sense_construct()
1172 sati_set_sense_data_byte(sense_data, sense_len, 4, ncq_log->lba_23_16); in sati_scsi_read_ncq_error_fixed_sense_construct()
1173 sati_set_sense_data_byte(sense_data, sense_len, 5, ncq_log->lba_15_8); in sati_scsi_read_ncq_error_fixed_sense_construct()
1174 sati_set_sense_data_byte(sense_data, sense_len, 6, ncq_log->lba_7_0); in sati_scsi_read_ncq_error_fixed_sense_construct()
1213 sequence->is_sense_response_set = TRUE; in sati_scsi_read_ncq_error_sense_construct()
1217 * @brief This method will construct the sense data buffer in the user's
1218 * sense data buffer location. Additionally, it will set the user's
1222 * for which to construct the sense data.
1224 * for which to construct the sense data.
1229 * @param[in] sense_key This parameter specifies the sense key to
1232 * additional sense code (ASC) key to be set for the user's
1235 * the additional sense code qualifier (ASCQ) key to be set
1287 * @brief This method will construct the sense data buffer in the user's
1288 * sense data buffer location. Additionally, it will set the user's
1292 * for which to construct the sense data.
1294 * for which to construct the sense data.
1299 * @param[in] sense_key This parameter specifies the sense key to
1302 * additional sense code (ASC) key to be set for the user's
1305 * the additional sense code qualifier (ASCQ) key to be set
1385 sequence->is_sense_response_set = TRUE; in sati_scsi_read_error_sense_construct()
1393 * for which to construct the sense data.
1395 * for which to construct the sense data.
1408 rsp_iu->data_present = 0x01; in sati_scsi_response_data_construct()
1409 rsp_iu->response_data_length[3] = sizeof(U32); in sati_scsi_response_data_construct()
1410 rsp_iu->status = 0; in sati_scsi_response_data_construct()
1411 ((U8 *)rsp_iu->data)[3] = response_data; in sati_scsi_response_data_construct()
1438 if (byte_offset < sequence->allocation_length) in sati_get_data_byte()
1466 if (byte_offset < sequence->allocation_length) in sati_set_data_byte()
1468 sequence->number_data_bytes_set++; in sati_set_data_byte()
1558 sequence->device->ata_standby_timer = (U8) count; in sati_ata_standby_construct()
1670 sequence->device->ata_standby_timer = 0x00; in sati_ata_idle_construct()
1725 //According to SAT-2 (v7) 9.11.3 in sati_ata_read_verify_sectors_construct()
1728 //According to SAT-2 (v7) 9.11.3, set LBA to a value between zero and the in sati_ata_read_verify_sectors_construct()
1730 //From the unit test, it seems we have to set LBA to a non-zero value. in sati_ata_read_verify_sectors_construct()
1786 sequence->data_direction = SATI_DATA_DIRECTION_IN; in sati_ata_smart_read_log_construct()
1787 sequence->protocol = SAT_PROTOCOL_PIO_DATA_IN; in sati_ata_smart_read_log_construct()
1788 sequence->ata_transfer_length = transfer_length; in sati_ata_smart_read_log_construct()
1865 sequence->data_direction = SATI_DATA_DIRECTION_IN; in sati_ata_read_log_ext_construct()
1866 sequence->protocol = SAT_PROTOCOL_PIO_DATA_IN; in sati_ata_read_log_ext_construct()
1867 sequence->ata_transfer_length = transfer_length; in sati_ata_read_log_ext_construct()
1876 * @param[in] sequence - SATI sequence data with the device state.
1886 if(sequence->device->state == SATI_DEVICE_STATE_STOPPED) in sati_device_state_stopped()
1920 sequence->data_direction = SATI_DATA_DIRECTION_IN; in sati_ata_read_buffer_construct()
1921 sequence->protocol = SAT_PROTOCOL_PIO_DATA_IN; in sati_ata_read_buffer_construct()
1922 sequence->ata_transfer_length = 512; in sati_ata_read_buffer_construct()
1946 sequence->data_direction = SATI_DATA_DIRECTION_OUT; in sati_ata_write_buffer_construct()
1947 sequence->protocol = SAT_PROTOCOL_PIO_DATA_OUT; in sati_ata_write_buffer_construct()
1948 sequence->ata_transfer_length = 512; in sati_ata_write_buffer_construct()
1960 * @param[in] mode This parameter specifies the download microcode sub-command
2004 sequence->data_direction = SATI_DATA_DIRECTION_OUT; in sati_ata_download_microcode_construct()
2005 sequence->protocol = SAT_PROTOCOL_PIO_DATA_OUT; in sati_ata_download_microcode_construct()
2006 sequence->ata_transfer_length = allocation_length; in sati_ata_download_microcode_construct()