Lines Matching +full:current +full:- +full:sense
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;
91 sequence->protocol = SAT_PROTOCOL_NON_DATA;
92 sequence->ata_transfer_length = 0;
98 * @pre It is expected that the user has properly set the current contents
116 sequence->data_direction = SATI_DATA_DIRECTION_IN;
117 sequence->protocol = SAT_PROTOCOL_PIO_DATA_IN;
118 sequence->ata_transfer_length = sizeof(ATA_IDENTIFY_DEVICE_DATA_T);
140 sequence->data_direction = SATI_DATA_DIRECTION_IN;
141 sequence->protocol = SAT_PROTOCOL_DEVICE_DIAGNOSTIC;
142 sequence->ata_transfer_length = 16;
163 * in the 0x20 - 0x7E ASCII range.
177 // default to " " (i.e. 0x20) for all non-ascii printable characters.
192 * It will perform the byte swap from the 16-bit identify field
210 * in the 0x20 - 0x7E ASCII range.
245 length -= 2;
282 length--;
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
315 if (identify->command_set_enabled1
318 // This drive supports 48-bit addressing
320 *lba_high = identify->max_48bit_lba[7] << 24;
321 *lba_high |= identify->max_48bit_lba[6] << 16;
322 *lba_high |= identify->max_48bit_lba[5] << 8;
323 *lba_high |= identify->max_48bit_lba[4];
325 *lba_low = identify->max_48bit_lba[3] << 24;
326 *lba_low |= identify->max_48bit_lba[2] << 16;
327 *lba_low |= identify->max_48bit_lba[1] << 8;
328 *lba_low |= identify->max_48bit_lba[0];
332 // This device doesn't support 48-bit addressing
335 *lba_low = identify->total_num_sectors[3] << 24;
336 *lba_low |= identify->total_num_sectors[2] << 16;
337 *lba_low |= identify->total_num_sectors[1] << 8;
338 *lba_low |= identify->total_num_sectors[0];
343 if (identify->physical_logical_sector_info
346 *sector_size = identify->words_per_logical_sector[3] << 24;
347 *sector_size |= identify->words_per_logical_sector[2] << 16;
348 *sector_size |= identify->words_per_logical_sector[1] << 8;
349 *sector_size |= identify->words_per_logical_sector[0];
361 * @pre It is expected that the user has properly set the current contents
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
417 * @param[in] sense_data_length This parameter specifies the sense data
431 rsp_iu->sense_data_length[3] = sense_data_length;
432 rsp_iu->sense_data_length[2] = 0;
433 rsp_iu->sense_data_length[1] = 0;
434 rsp_iu->sense_data_length[0] = 0;
435 rsp_iu->status = scsi_status;
436 rsp_iu->data_present = data_present;
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;
488 if (sequence->device->descriptor_sense_enable)
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;
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
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);
771 sense_len - offset,
781 sense_len - offset,
787 sense_len - offset,
818 sense_len - offset,
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 sati_set_sense_data_byte(sense_data, sense_len, 7, sati_scsi_get_descriptor_sense_data_length(sequence, scsi_io) - 8);
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.
920 // We utilize the fixed format sense data format.
935 sati_set_sense_data_byte(sense_data, sense_len, 7, (sense_len < 18 ? sense_len - 1 : 17) - 7);
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);
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 sati_set_sense_data_byte(sense_data, sense_len, 7, sati_scsi_get_descriptor_sense_data_length(sequence, scsi_io) - 8);
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;
1097 information_buff[3] = ncq_log->lba_39_32;
1098 information_buff[4] = ncq_log->lba_31_24;
1099 information_buff[5] = ncq_log->lba_23_16;
1100 information_buff[6] = ncq_log->lba_15_8;
1101 information_buff[7] = ncq_log->lba_7_0;
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)
1171 sati_set_sense_data_byte(sense_data, sense_len, 3, ncq_log->lba_31_24);
1172 sati_set_sense_data_byte(sense_data, sense_len, 4, ncq_log->lba_23_16);
1173 sati_set_sense_data_byte(sense_data, sense_len, 5, ncq_log->lba_15_8);
1174 sati_set_sense_data_byte(sense_data, sense_len, 6, ncq_log->lba_7_0);
1213 sequence->is_sense_response_set = TRUE;
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;
1393 * for which to construct the sense data.
1395 * for which to construct the sense data.
1408 rsp_iu->data_present = 0x01;
1409 rsp_iu->response_data_length[3] = sizeof(U32);
1410 rsp_iu->status = 0;
1411 ((U8 *)rsp_iu->data)[3] = response_data;
1438 if (byte_offset < sequence->allocation_length)
1466 if (byte_offset < sequence->allocation_length)
1468 sequence->number_data_bytes_set++;
1511 * @pre It is expected that the user has properly set the current contents
1535 * @pre It is expected that the user has properly set the current contents
1558 sequence->device->ata_standby_timer = (U8) count;
1566 * @pre It is expected that the user has properly set the current contents
1590 * @pre It is expected that the user has properly set the current contents
1620 * @pre It is expected that the user has properly set the current contents
1649 * @pre It is expected that the user has properly set the current contents
1670 sequence->device->ata_standby_timer = 0x00;
1681 * @pre It is expected that the user has properly set the current contents
1706 * @pre It is expected that the user has properly set the current contents
1725 //According to SAT-2 (v7) 9.11.3
1728 //According to SAT-2 (v7) 9.11.3, set LBA to a value between zero and the
1729 //maximum LBA supported by the ATA device in its current configuration.
1730 //From the unit test, it seems we have to set LBA to a non-zero value.
1786 sequence->data_direction = SATI_DATA_DIRECTION_IN;
1787 sequence->protocol = SAT_PROTOCOL_PIO_DATA_IN;
1788 sequence->ata_transfer_length = transfer_length;
1865 sequence->data_direction = SATI_DATA_DIRECTION_IN;
1866 sequence->protocol = SAT_PROTOCOL_PIO_DATA_IN;
1867 sequence->ata_transfer_length = transfer_length;
1876 * @param[in] sequence - SATI sequence data with the device state.
1886 if(sequence->device->state == SATI_DEVICE_STATE_STOPPED)
1920 sequence->data_direction = SATI_DATA_DIRECTION_IN;
1921 sequence->protocol = SAT_PROTOCOL_PIO_DATA_IN;
1922 sequence->ata_transfer_length = 512;
1946 sequence->data_direction = SATI_DATA_DIRECTION_OUT;
1947 sequence->protocol = SAT_PROTOCOL_PIO_DATA_OUT;
1948 sequence->ata_transfer_length = 512;
1960 * @param[in] mode This parameter specifies the download microcode sub-command
2004 sequence->data_direction = SATI_DATA_DIRECTION_OUT;
2005 sequence->protocol = SAT_PROTOCOL_PIO_DATA_OUT;
2006 sequence->ata_transfer_length = allocation_length;