* Fixed build.

* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42417 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2011-07-12 21:51:24 +00:00
parent 84bcfa3d4b
commit 429d0b8c0b
+16 -16
View File
@@ -8,7 +8,7 @@
/* /*
Part of Open IDE bus manager Part of Open IDE bus manager
Converts SCSI commands to ATA commands. Converts SCSI commands to ATA commands.
*/ */
@@ -63,7 +63,7 @@ ata_mode_sense_10(ide_device_info *device, ide_qrequest *qrequest)
copy_sg_data(request, 0, allocationLength, &param_header, copy_sg_data(request, 0, allocationLength, &param_header,
sizeof(param_header), false); sizeof(param_header), false);
/*block_desc = (scsi_mode_param_block_desc *)(request->data /*block_desc = (scsi_mode_param_block_desc *)(request->data
+ sizeof(*param_header));*/ + sizeof(*param_header));*/
memset(&block_desc, 0, sizeof(block_desc)); memset(&block_desc, 0, sizeof(block_desc));
// density is reserved (0), descriptor apply to entire medium (num_blocks=0) // density is reserved (0), descriptor apply to entire medium (num_blocks=0)
@@ -75,16 +75,16 @@ ata_mode_sense_10(ide_device_info *device, ide_qrequest *qrequest)
copy_sg_data(request, sizeof(param_header), allocationLength, copy_sg_data(request, sizeof(param_header), allocationLength,
&block_desc, sizeof(block_desc), false); &block_desc, sizeof(block_desc), false);
/*contr = (scsi_modepage_contr *)(request->data /*contr = (scsi_modepage_contr *)(request->data
+ sizeof(*param_header) + sizeof(*param_header)
+ ((uint16)param_header->high_block_desc_len << 8) + ((uint16)param_header->high_block_desc_len << 8)
+ param_header->low_block_desc_len);*/ + param_header->low_block_desc_len);*/
memset(&control, 0, sizeof(control)); memset(&control, 0, sizeof(control));
control.RLEC = false; control.RLEC = false;
control.DQue = !device->CQ_enabled; control.DQue = !device->CQ_enabled;
control.QErr = false; control.QErr = false;
// when a command fails we requeue all // when a command fails we requeue all
// lost commands automagically // lost commands automagically
control.QAM = SCSI_QAM_UNRESTRICTED; control.QAM = SCSI_QAM_UNRESTRICTED;
@@ -150,7 +150,7 @@ ata_mode_select_10(ide_device_info *device, ide_qrequest *qrequest)
modepageOffset = sizeof(param_header) modepageOffset = sizeof(param_header)
+ B_BENDIAN_TO_HOST_INT16(param_header.block_desc_length); + B_BENDIAN_TO_HOST_INT16(param_header.block_desc_length);
// go through list of pages // go through list of pages
while (modepageOffset < totalLength) { while (modepageOffset < totalLength) {
uint32 pageLength; uint32 pageLength;
@@ -211,7 +211,7 @@ ata_test_unit_ready(ide_device_info *device, ide_qrequest *qrequest)
|| device->infoblock._127_RMSN_support != 1) || device->infoblock._127_RMSN_support != 1)
return true; return true;
// ask device about status // ask device about status
device->tf_param_mask = 0; device->tf_param_mask = 0;
device->tf.write.command = IDE_CMD_GET_MEDIA_STATUS; device->tf.write.command = IDE_CMD_GET_MEDIA_STATUS;
@@ -244,7 +244,7 @@ ata_flush_cache(ide_device_info *device, ide_qrequest *qrequest)
return true; return true;
device->tf_param_mask = 0; device->tf_param_mask = 0;
device->tf.lba.command = device->use_48bits ? IDE_CMD_FLUSH_CACHE_EXT device->tf.lba.command = device->use_48bits ? IDE_CMD_FLUSH_CACHE_EXT
: IDE_CMD_FLUSH_CACHE; : IDE_CMD_FLUSH_CACHE;
// spec says that this may take more then 30s, how much more? // spec says that this may take more then 30s, how much more?
@@ -335,9 +335,9 @@ ata_inquiry(ide_device_info *device, ide_qrequest *qrequest)
data.relative_address = false; data.relative_address = false;
// the following fields are *much* to small, sigh... // the following fields are *much* to small, sigh...
memcpy(data.vendor_ident, device->infoblock.model_number, memcpy(data.vendor_ident, device->infoblock.model_number,
sizeof(data.vendor_ident)); sizeof(data.vendor_ident));
memcpy(data.product_ident, device->infoblock.model_number + 8, memcpy(data.product_ident, device->infoblock.model_number + 8,
sizeof(data.product_ident)); sizeof(data.product_ident));
memcpy(data.product_rev, " ", sizeof(data.product_rev)); memcpy(data.product_rev, " ", sizeof(data.product_rev));
@@ -380,9 +380,9 @@ void
ata_exec_io(ide_device_info *device, ide_qrequest *qrequest) ata_exec_io(ide_device_info *device, ide_qrequest *qrequest)
{ {
scsi_ccb *request = qrequest->request; scsi_ccb *request = qrequest->request;
SHOW_FLOW(3, "command=%x", request->cdb[0]); SHOW_FLOW(3, "command=%x", request->cdb[0]);
// ATA devices have one LUN only // ATA devices have one LUN only
if (request->target_lun != 0) { if (request->target_lun != 0) {
request->subsys_status = SCSI_SEL_TIMEOUT; request->subsys_status = SCSI_SEL_TIMEOUT;
@@ -392,7 +392,7 @@ ata_exec_io(ide_device_info *device, ide_qrequest *qrequest)
// starting a request means deleting sense, so don't do it if // starting a request means deleting sense, so don't do it if
// the command wants to read it // the command wants to read it
if (request->cdb[0] != SCSI_OP_REQUEST_SENSE) if (request->cdb[0] != SCSI_OP_REQUEST_SENSE)
start_request(device, qrequest); start_request(device, qrequest);
switch (request->cdb[0]) { switch (request->cdb[0]) {
@@ -412,7 +412,7 @@ ata_exec_io(ide_device_info *device, ide_qrequest *qrequest)
set_sense(device, SCSIS_KEY_ILLEGAL_REQUEST, SCSIS_ASC_INV_OPCODE); set_sense(device, SCSIS_KEY_ILLEGAL_REQUEST, SCSIS_ASC_INV_OPCODE);
break; break;
case SCSI_OP_INQUIRY: case SCSI_OP_INQUIRY:
ata_inquiry(device, qrequest); ata_inquiry(device, qrequest);
break; break;
@@ -466,14 +466,14 @@ ata_exec_io(ide_device_info *device, ide_qrequest *qrequest)
read_capacity(device, qrequest); read_capacity(device, qrequest);
break; break;
case SCSI_OP_VERIFY: case SCSI_OP_VERIFY_6:
// does anyone uses this function? // does anyone uses this function?
// effectly, it does a read-and-compare, which IDE doesn't support // effectly, it does a read-and-compare, which IDE doesn't support
set_sense(device, SCSIS_KEY_ILLEGAL_REQUEST, SCSIS_ASC_INV_OPCODE); set_sense(device, SCSIS_KEY_ILLEGAL_REQUEST, SCSIS_ASC_INV_OPCODE);
break; break;
case SCSI_OP_SYNCHRONIZE_CACHE: case SCSI_OP_SYNCHRONIZE_CACHE:
// we ignore range and immediate bit, we always immediately flush everything // we ignore range and immediate bit, we always immediately flush everything
ata_flush_cache(device, qrequest); ata_flush_cache(device, qrequest);
break; break;