Lines Matching +full:user +full:- +full:defined

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.
60 * by a user to construct ATA/ATAPI commands, copy ATA device
73 * kength for an ATA non-data command.
75 * @pre It is expected that the user will use this method for setting these
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()
98 * @pre It is expected that the user has properly set the current contents
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()
146 * @brief This method will set data bytes in the user data area. If the
158 * from the source buffer that is to be copied into the user
163 * in the 0x20 - 0x7E ASCII range.
176 // if the user requests that the copied data be ascii printable, then in sati_set_ascii_data_byte()
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()
361 * @pre It is expected that the user has properly set the current contents
387 * @param[in] scsi_io This parameter specifies the user SCSI IO request
391 * @param[in] value This parameter specifies the 8-bit value to be written
410 * @brief This method will construct the common response IU in the user
413 * @param[out] rsp_iu This parameter specifies the user request's
416 * value for the user's IO request.
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()
441 * sense data buffer location. Additionally, it will set the user's
444 * @param[in,out] scsi_io This parameter specifies the user's IO request
447 * value for the user's IO request.
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()
513 #if !defined(DISABLE_SATI_WRITE_LONG) in sati_scsi_get_descriptor_sense_data_length()
519 #endif // !defined(DISABLE_SATI_WRITE_LONG) in sati_scsi_get_descriptor_sense_data_length()
520 #if !defined(DISABLE_SATI_REASSIGN_BLOCKS) in sati_scsi_get_descriptor_sense_data_length()
525 #endif // !defined(DISABLE_SATI_REASSIGN_BLOCKS) in sati_scsi_get_descriptor_sense_data_length()
534 #if !defined(DISABLE_SATI_VERIFY) in sati_scsi_get_descriptor_sense_data_length()
538 #endif // !defined(DISABLE_SATI_VERIFY) in sati_scsi_get_descriptor_sense_data_length()
539 #if !defined(DISABLE_SATI_WRITE_AND_VERIFY) \ in sati_scsi_get_descriptor_sense_data_length()
540 && !defined(DISABLE_SATI_VERIFY) \ in sati_scsi_get_descriptor_sense_data_length()
541 && !defined(DISABLE_SATI_WRITE) in sati_scsi_get_descriptor_sense_data_length()
546 #endif // !defined(DISABLE_SATI_WRITE_AND_VERIFY) in sati_scsi_get_descriptor_sense_data_length()
547 // && !defined(DISABLE_SATI_VERIFY) in sati_scsi_get_descriptor_sense_data_length()
548 // && !defined(DISABLE_SATI_WRITE) in sati_scsi_get_descriptor_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
589 * @param[in,out] scsi_io This parameter specifies the user's IO request
592 * value for the user's IO request.
594 * be set for the user's IO request.
596 * additional sense code (ASC) key to be set for the user's
600 * for the user's IO request.
631 sequence->is_sense_response_set = TRUE; in sati_scsi_sense_data_construct()
635 * @brief This method will construct the block descriptor in the user's descriptor
638 * @param[in] sense_data This parameter specifies the user SCSI IO request
661 * @brief This method will construct the command-specific descriptor for
662 * the descriptor sense data buffer in the user's sense data buffer
665 * @param[in] sense_data This parameter specifies the user SCSI IO request
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
702 * @param[in] sense_data This parameter specifies the user SCSI IO request
733 * @brief This method will construct the descriptors in the user's descriptor
736 * @param[in,out] scsi_io This parameter specifies the user's IO request
738 * @param[in] sense_data This parameter specifies the user SCSI IO request
761 #if !defined(DISABLE_SATI_WRITE_LONG) in sati_scsi_common_descriptors_construct()
766 sense_len - offset); in sati_scsi_common_descriptors_construct()
771 sense_len - offset, in sati_scsi_common_descriptors_construct()
776 #endif // !defined(DISABLE_SATI_WRITE_LONG) in sati_scsi_common_descriptors_construct()
777 #if !defined(DISABLE_SATI_REASSIGN_BLOCKS) 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()
792 #endif // !defined(DISABLE_SATI_REASSIGN_BLOCKS) in sati_scsi_common_descriptors_construct()
801 #if !defined(DISABLE_SATI_VERIFY) in sati_scsi_common_descriptors_construct()
805 #endif // !defined(DISABLE_SATI_VERIFY) in sati_scsi_common_descriptors_construct()
806 #if !defined(DISABLE_SATI_WRITE_AND_VERIFY) \ in sati_scsi_common_descriptors_construct()
807 && !defined(DISABLE_SATI_VERIFY) \ in sati_scsi_common_descriptors_construct()
808 && !defined(DISABLE_SATI_WRITE) in sati_scsi_common_descriptors_construct()
813 #endif // !defined(DISABLE_SATI_WRITE_AND_VERIFY) in sati_scsi_common_descriptors_construct()
814 // && !defined(DISABLE_SATI_VERIFY) in sati_scsi_common_descriptors_construct()
815 // && !defined(DISABLE_SATI_WRITE) in sati_scsi_common_descriptors_construct()
818 sense_len - offset, in sati_scsi_common_descriptors_construct()
828 * the user's sense data buffer location. Additionally, it will set
829 * the user's SCSI status.
833 * @param[in,out] scsi_io This parameter specifies the user's IO request
836 * value for the user's IO request.
838 * be set for the user's IO request.
840 * additional sense code (ASC) key to be set for the user's
844 * for the user's IO request.
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()
884 * in the user's sense data buffer location. Additionally, it will
885 * set the user's SCSI status.
889 * @param[in,out] scsi_io This parameter specifies the user's IO request
892 * value for the user's IO request.
894 * be set for the user's IO request.
896 * additional sense code (ASC) key to be set for the user's
900 * for the user's IO request.
919 // Write out the sense data format per SPC-4. 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()
954 * @param[in] sense_data This parameter specifies the user SCSI IO request
959 * be set for the user's IO request.
961 * additional sense code (ASC) key to be set for the user's
965 * for the user's IO request.
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()
999 * the user's sense data buffer location. Additionally, it will set
1000 * the user's SCSI status.
1004 * @param[in,out] scsi_io This parameter specifies the user's IO request
1007 * value for the user's IO request.
1009 * be set for the user's IO request.
1011 * additional sense code (ASC) key to be set for the user's
1015 * for the user's IO request.
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
1046 * the user's SCSI status. This is only used for NCQ uncorrectable
1051 * @param[in,out] scsi_io This parameter specifies the user's IO request
1053 * @param[in] ata_input_data This parameter specifies the user's ATA IO
1056 * value for the user's IO request.
1058 * be set for the user's IO request.
1060 * additional sense code (ASC) key to be set for the user's
1064 * for the user's IO request.
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
1122 * @param[in,out] scsi_io This parameter specifies the user's IO request
1124 * @param[in] ata_input_data This parameter specifies the user's ATA IO
1127 * value for the user's IO request.
1129 * be set for the user's IO request.
1131 * additional sense code (ASC) key to be set for the user's
1135 * for the user's IO request.
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
1223 * @param[in,out] scsi_io This parameter specifies the user's IO request
1228 * value for the user's IO request.
1230 * be set for the user's IO request.
1232 * additional sense code (ASC) key to be set for the user's
1236 * for the user's IO request.
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
1293 * @param[in,out] scsi_io This parameter specifies the user's IO request
1298 * value for the user's IO request.
1300 * be set for the user's IO request.
1302 * additional sense code (ASC) key to be set for the user's
1306 * for the user's IO request.
1385 sequence->is_sense_response_set = TRUE; in sati_scsi_read_error_sense_construct()
1394 * @param[in,out] scsi_io This parameter specifies the user's IO request
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()
1419 * to retrieving the payload data byte from the user's buffer.
1421 * @param[in,out] scsi_io This parameter specifies the user's IO request
1422 * for which to set the user payload data byte.
1424 * the user's payload buffer at which to write the supplied
1427 * which to read the value from the user's payload buffer.
1438 if (byte_offset < sequence->allocation_length) in sati_get_data_byte()
1445 * translating payload data into the user's buffer.
1448 * for which to set the user payload data byte.
1449 * @param[in,out] scsi_io This parameter specifies the user's IO request
1450 * for which to set the user payload data byte.
1452 * the user's payload buffer at which to write the supplied
1455 * written out into the user's payload buffer.
1466 if (byte_offset < sequence->allocation_length) in sati_set_data_byte()
1468 sequence->number_data_bytes_set++; in sati_set_data_byte()
1476 * translating payload data into the user's buffer.
1479 * for which to set the user payload data dword.
1480 * @param[in,out] scsi_io This parameter specifies the user's IO request
1481 * for which to set the user payload data dword.
1483 * the user's payload buffer at which to write the supplied
1486 * written out into the user's payload buffer.
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; in sati_ata_standby_construct()
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; in sati_ata_idle_construct()
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 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()