diff --git a/sys/dev/isci/scil/sati_passthrough.c b/sys/dev/isci/scil/sati_passthrough.c index a083bd5af1b1..88ff0bc12df3 100644 --- a/sys/dev/isci/scil/sati_passthrough.c +++ b/sys/dev/isci/scil/sati_passthrough.c @@ -230,9 +230,9 @@ void sati_passthrough_construct_sense( // 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, 9, sati_get_ata_lba_low(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)); + sati_set_sense_data_byte(sense_data, sense_len, 11, sati_get_ata_lba_high(register_fis)); sequence->is_sense_response_set = TRUE; } diff --git a/sys/dev/isci/scil/sati_util.c b/sys/dev/isci/scil/sati_util.c index 90b9bfa4d8f7..e037c5cfae1f 100644 --- a/sys/dev/isci/scil/sati_util.c +++ b/sys/dev/isci/scil/sati_util.c @@ -932,7 +932,7 @@ void sati_scsi_fixed_sense_data_construct( sati_set_sense_data_byte(sense_data, sense_len, 4, 0); sati_set_sense_data_byte(sense_data, sense_len, 5, 0); sati_set_sense_data_byte(sense_data, sense_len, 6, 0); - sati_set_sense_data_byte(sense_data, sense_len, 7, 0); + sati_set_sense_data_byte(sense_data, sense_len, 7, (sense_len < 18 ? sense_len - 1 : 17) - 7); sati_set_sense_data_byte(sense_data, sense_len, 8, 0); sati_set_sense_data_byte(sense_data, sense_len, 9, 0); sati_set_sense_data_byte(sense_data, sense_len, 10, 0); @@ -981,7 +981,7 @@ void sati_scsi_common_fixed_sense_construct( //Bytes 3, 4, 5, 6 are set in read_error_sense_construct functions - sati_set_sense_data_byte(sense_data, sense_len, 7, 0); + sati_set_sense_data_byte(sense_data, sense_len, 7, (sense_len < 18 ? sense_len - 1 : 17) - 7); sati_set_sense_data_byte(sense_data, sense_len, 8, 0); sati_set_sense_data_byte(sense_data, sense_len, 9, 0); sati_set_sense_data_byte(sense_data, sense_len, 10, 0);