FreeBSD Bugzilla – Attachment 154205 Details for
Bug 191717
[isci] smartctl -H gives "ATA output registers missing" for a disk using the isci driver
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Compatibility patch written by Jim Harris
sati_passthrough_sense.patch (text/plain), 5.06 KB, created by
martin
on 2015-03-11 16:16:56 UTC
(
hide
)
Description:
Compatibility patch written by Jim Harris
Filename:
MIME Type:
Creator:
martin
Created:
2015-03-11 16:16:56 UTC
Size:
5.06 KB
patch
obsolete
>Index: sys/dev/isci/scil/intel_scsi.h >=================================================================== >--- sys/dev/isci/scil/intel_scsi.h (revision 266473) >+++ sys/dev/isci/scil/intel_scsi.h (working copy) >@@ -147,6 +147,8 @@ > #define SCSI_INFORMATION_DESCRIPTOR_LENGTH 0x0c > #define SCSI_BLOCK_DESCRIPTOR_ADDITIONAL_LENGTH 0x2 > #define SCSI_BLOCK_DESCRIPTOR_LENGTH 0x4 >+#define SCSI_ATA_STATUS_RETURN_DESCRIPTOR_ADDITIONAL_LENGTH 0xc >+#define SCSI_ATA_STATUS_RETURN_DESCRIPTOR_LENGTH 0xe > > #define SCSI_SENSE_DATA_DESC_BIT 0x01 > >Index: sys/dev/isci/scil/sati_passthrough.c >=================================================================== >--- sys/dev/isci/scil/sati_passthrough.c (revision 266473) >+++ sys/dev/isci/scil/sati_passthrough.c (working copy) >@@ -176,8 +176,6 @@ > U8 * sense_data; > U32 sense_len; > U8 * cdb; >- unsigned char sector_count_upper; >- unsigned char lba_upper; > > #ifdef SATI_TRANSPORT_SUPPORTS_SAS > SCI_SSP_RESPONSE_IU_T * rsp_iu = (SCI_SSP_RESPONSE_IU_T*) >@@ -208,32 +206,29 @@ > > cdb = sati_cb_get_cdb_address(scsi_io); > >- if (sati_get_ata_sector_count_ext(register_fis) != 0) { >- sector_count_upper = 1; >- } else { >- sector_count_upper = 0; >- } >+ sati_set_sense_data_byte(sense_data, sense_len, 8+0, SCSI_ATA_STATUS_RETURN_DESCRIPTOR_TYPE); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+1, SCSI_ATA_STATUS_RETURN_DESCRIPTOR_ADDITIONAL_LENGTH); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+2, PASSTHROUGH_CDB_EXTEND(cdb)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+3, (U8)sati_get_ata_error(register_fis)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+5, sati_get_ata_sector_count(register_fis)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+7, sati_get_ata_lba_low(register_fis)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+9, sati_get_ata_lba_mid(register_fis)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+11, sati_get_ata_lba_high(register_fis)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+12, sati_get_ata_device(register_fis)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+13, (U8)sati_get_ata_status(register_fis)); > >- if (sati_get_ata_lba_high_ext(register_fis) != 0 || >- sati_get_ata_lba_mid_ext(register_fis) != 0 || >- sati_get_ata_lba_low_ext(register_fis) != 0) { >- lba_upper = 1; >+ if (PASSTHROUGH_CDB_EXTEND(cdb)) { >+ sati_set_sense_data_byte(sense_data, sense_len, 8+4, sati_get_ata_sector_count_ext(register_fis)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+6, sati_get_ata_lba_low_ext(register_fis)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+8, sati_get_ata_lba_mid_ext(register_fis)); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+10, sati_get_ata_lba_high_ext(register_fis)); > } else { >- lba_upper = 0; >+ sati_set_sense_data_byte(sense_data, sense_len, 8+4, 0); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+6, 0); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+8, 0); >+ sati_set_sense_data_byte(sense_data, sense_len, 8+10, 0); > } > >- // Information section >- sati_set_sense_data_byte(sense_data, sense_len, 3, (U8)sati_get_ata_error(register_fis)); >- sati_set_sense_data_byte(sense_data, sense_len, 4, (U8)sati_get_ata_status(register_fis)); >- sati_set_sense_data_byte(sense_data, sense_len, 5, sati_get_ata_device(register_fis)); >- sati_set_sense_data_byte(sense_data, sense_len, 6, sati_get_ata_sector_count(register_fis)); >- >- // Command specific section >- sati_set_sense_data_byte(sense_data, sense_len, 8, (PASSTHROUGH_CDB_EXTEND(cdb) << 7) | (sector_count_upper << 6) | (lba_upper << 5)); >- sati_set_sense_data_byte(sense_data, sense_len, 9, sati_get_ata_lba_high(register_fis)); >- sati_set_sense_data_byte(sense_data, sense_len, 10, sati_get_ata_lba_mid(register_fis)); >- sati_set_sense_data_byte(sense_data, sense_len, 11, sati_get_ata_lba_low(register_fis)); >- > sequence->is_sense_response_set = TRUE; > } > >Index: sys/dev/isci/scil/sati_util.c >=================================================================== >--- sys/dev/isci/scil/sati_util.c (revision 266473) >+++ sys/dev/isci/scil/sati_util.c (working copy) >@@ -485,7 +485,9 @@ > static > U8 sati_scsi_get_sense_data_response_code(SATI_TRANSLATOR_SEQUENCE_T * sequence) > { >- if (sequence->device->descriptor_sense_enable) >+ if (sequence->device->descriptor_sense_enable || >+ sequence->type == SATI_SEQUENCE_ATA_PASSTHROUGH_12 || >+ sequence->type == SATI_SEQUENCE_ATA_PASSTHROUGH_16) > { > return SCSI_DESCRIPTOR_CURRENT_RESPONSE_CODE; > } >@@ -548,6 +550,12 @@ > // && !defined(DISABLE_SATI_WRITE) > length += SCSI_INFORMATION_DESCRIPTOR_LENGTH; > break; >+#if !defined(DISABLE_SATI_ATA_PASSTHROUGH) >+ case SCSI_ATA_PASSTHRU_12: >+ case SCSI_ATA_PASSTHRU_16: >+ length += SCSI_ATA_STATUS_RETURN_DESCRIPTOR_LENGTH; >+ break; >+#endif // !defined(DISABLE_SATI_ATA_PASSTHROUGH) > } > > return length;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 191717
:
154205
|
159976