Partially applied our style guide.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9968 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
/** verify that device is ready for further PIO transmission */
|
||||
|
||||
static bool
|
||||
check_rw_status(ide_device_info *device, bool drq_required)
|
||||
check_rw_status(ide_device_info *device, bool drqStatus)
|
||||
{
|
||||
ide_bus_info *bus = device->bus;
|
||||
int status;
|
||||
@@ -31,7 +31,7 @@ check_rw_status(ide_device_info *device, bool drq_required)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (drq_required != ((status & ide_status_drq) != 0)) {
|
||||
if (drqStatus != ((status & ide_status_drq) != 0)) {
|
||||
device->subsys_status = SCSI_SEQUENCE_FAIL;
|
||||
return false;
|
||||
}
|
||||
@@ -180,7 +180,8 @@ static uint8 cmd_28[2][2] = {
|
||||
};
|
||||
|
||||
|
||||
// create IDE read/write command
|
||||
/** create IDE read/write command */
|
||||
|
||||
static bool
|
||||
create_rw_taskfile(ide_device_info *device, ide_qrequest *qrequest,
|
||||
uint64 pos, size_t length, bool write)
|
||||
@@ -247,13 +248,12 @@ create_rw_taskfile(ide_device_info *device, ide_qrequest *qrequest,
|
||||
if (qrequest->queuable) {
|
||||
// queued LBA
|
||||
SHOW_FLOW( 3, "creating DMA queued command, tag=%d", qrequest->tag );
|
||||
device->tf_param_mask =
|
||||
ide_mask_features |
|
||||
ide_mask_sector_count |
|
||||
ide_mask_LBA_low |
|
||||
ide_mask_LBA_mid |
|
||||
ide_mask_LBA_high |
|
||||
ide_mask_device_head;
|
||||
device->tf_param_mask = ide_mask_features
|
||||
| ide_mask_sector_count
|
||||
| ide_mask_LBA_low
|
||||
| ide_mask_LBA_mid
|
||||
| ide_mask_LBA_high
|
||||
| ide_mask_device_head;
|
||||
|
||||
device->tf.queued.sector_count = length & 0xff;
|
||||
device->tf.queued.tag = qrequest->tag;
|
||||
@@ -264,16 +264,14 @@ create_rw_taskfile(ide_device_info *device, ide_qrequest *qrequest,
|
||||
device->tf.queued.command = write ? IDE_CMD_WRITE_DMA_QUEUED
|
||||
: IDE_CMD_READ_DMA_QUEUED;
|
||||
return true;
|
||||
|
||||
} else {
|
||||
// non-queued LBA
|
||||
SHOW_FLOW0( 3, "creating normal DMA/PIO command" );
|
||||
device->tf_param_mask =
|
||||
ide_mask_sector_count |
|
||||
ide_mask_LBA_low |
|
||||
ide_mask_LBA_mid |
|
||||
ide_mask_LBA_high |
|
||||
ide_mask_device_head;
|
||||
device->tf_param_mask = ide_mask_sector_count
|
||||
| ide_mask_LBA_low
|
||||
| ide_mask_LBA_mid
|
||||
| ide_mask_LBA_high
|
||||
| ide_mask_device_head;
|
||||
|
||||
device->tf.lba.sector_count = length & 0xff;
|
||||
device->tf.lba.lba_0_7 = pos & 0xff;
|
||||
@@ -282,7 +280,6 @@ create_rw_taskfile(ide_device_info *device, ide_qrequest *qrequest,
|
||||
device->tf.lba.lba_24_27 = (pos >> 24) & 0xf;
|
||||
device->tf.lba.command = cmd_28[qrequest->uses_dma][write];
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -296,12 +293,11 @@ create_rw_taskfile(ide_device_info *device, ide_qrequest *qrequest,
|
||||
|
||||
device->tf.chs.mode = ide_mode_chs;
|
||||
|
||||
device->tf_param_mask =
|
||||
ide_mask_sector_count |
|
||||
ide_mask_sector_number |
|
||||
ide_mask_cylinder_low |
|
||||
ide_mask_cylinder_high |
|
||||
ide_mask_device_head;
|
||||
device->tf_param_mask = ide_mask_sector_count
|
||||
| ide_mask_sector_number
|
||||
| ide_mask_cylinder_low
|
||||
| ide_mask_cylinder_high
|
||||
| ide_mask_device_head;
|
||||
|
||||
device->tf.chs.sector_count = length & 0xff;
|
||||
|
||||
@@ -335,10 +331,13 @@ err:
|
||||
}
|
||||
|
||||
|
||||
// execute read/write command
|
||||
// pos - first block
|
||||
// length - number of blocks
|
||||
void ata_send_rw( ide_device_info *device, ide_qrequest *qrequest,
|
||||
/** execute read/write command
|
||||
* pos - first block
|
||||
* length - number of blocks
|
||||
*/
|
||||
|
||||
void
|
||||
ata_send_rw(ide_device_info *device, ide_qrequest *qrequest,
|
||||
uint64 pos, size_t length, bool write)
|
||||
{
|
||||
ide_bus_info *bus = device->bus;
|
||||
@@ -418,7 +417,6 @@ void ata_send_rw( ide_device_info *device, ide_qrequest *qrequest,
|
||||
}
|
||||
|
||||
start_dma_wait_no_lock(device, qrequest);
|
||||
|
||||
} else {
|
||||
// on PIO read, we start with waiting, on PIO write we can
|
||||
// transmit data immediately; we let the service thread do
|
||||
@@ -449,13 +447,15 @@ err_send:
|
||||
abort_dma(device, qrequest);
|
||||
|
||||
finish_reset_queue(qrequest);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// check for errors reported by read/write command
|
||||
// return: true, if an error occured
|
||||
bool check_rw_error( ide_device_info *device, ide_qrequest *qrequest )
|
||||
/** check for errors reported by read/write command
|
||||
* return: true, if an error occured
|
||||
*/
|
||||
|
||||
bool
|
||||
check_rw_error(ide_device_info *device, ide_qrequest *qrequest)
|
||||
{
|
||||
ide_bus_info *bus = device->bus;
|
||||
uint8 status;
|
||||
@@ -466,8 +466,7 @@ bool check_rw_error( ide_device_info *device, ide_qrequest *qrequest )
|
||||
uint8 error;
|
||||
|
||||
if (bus->controller->read_command_block_regs(bus->channel,
|
||||
&device->tf, ide_mask_error ) != B_OK )
|
||||
{
|
||||
&device->tf, ide_mask_error) != B_OK) {
|
||||
device->subsys_status = SCSI_HBA_ERR;
|
||||
return true;
|
||||
}
|
||||
@@ -527,12 +526,15 @@ bool check_rw_error( ide_device_info *device, ide_qrequest *qrequest )
|
||||
}
|
||||
|
||||
|
||||
// check result of ATA command
|
||||
// drdy_required - true if drdy must be set by device
|
||||
// error_mask - bits to be checked in error register
|
||||
// is_write - true, if command was a write command
|
||||
bool check_output( ide_device_info *device,
|
||||
bool drdy_required, int error_mask, bool is_write )
|
||||
/** check result of ATA command
|
||||
* drdy_required - true if drdy must be set by device
|
||||
* error_mask - bits to be checked in error register
|
||||
* is_write - true, if command was a write command
|
||||
*/
|
||||
|
||||
bool
|
||||
check_output(ide_device_info *device, bool drdy_required,
|
||||
int error_mask, bool is_write)
|
||||
{
|
||||
ide_bus_info *bus = device->bus;
|
||||
uint8 status;
|
||||
@@ -562,8 +564,7 @@ bool check_output( ide_device_info *device,
|
||||
uint8 error;
|
||||
|
||||
if (bus->controller->read_command_block_regs(bus->channel,
|
||||
&device->tf, ide_mask_error ) != B_OK )
|
||||
{
|
||||
&device->tf, ide_mask_error) != B_OK) {
|
||||
device->subsys_status = SCSI_HBA_ERR;
|
||||
return false;
|
||||
}
|
||||
@@ -623,9 +624,13 @@ bool check_output( ide_device_info *device,
|
||||
return true;
|
||||
}
|
||||
|
||||
// execute SET FEATURE command
|
||||
// set subcommand in task file before calling this
|
||||
static bool device_set_feature( ide_device_info *device, int feature )
|
||||
|
||||
/** execute SET FEATURE command
|
||||
* set subcommand in task file before calling this
|
||||
*/
|
||||
|
||||
static bool
|
||||
device_set_feature(ide_device_info *device, int feature)
|
||||
{
|
||||
device->tf_param_mask = ide_mask_features;
|
||||
|
||||
@@ -640,13 +645,15 @@ static bool device_set_feature( ide_device_info *device, int feature )
|
||||
return check_output(device, true, ide_error_abrt, false);
|
||||
}
|
||||
|
||||
static bool configure_rmsn( ide_device_info *device )
|
||||
|
||||
static bool
|
||||
configure_rmsn(ide_device_info *device)
|
||||
{
|
||||
ide_bus_info *bus = device->bus;
|
||||
int i;
|
||||
|
||||
if( !device->infoblock.RMSN_supported ||
|
||||
device->infoblock._127_RMSN_support != 1 )
|
||||
if (!device->infoblock.RMSN_supported
|
||||
|| device->infoblock._127_RMSN_support != 1)
|
||||
return true;
|
||||
|
||||
if (!device_set_feature(device, IDE_CMD_SET_FEATURES_ENABLE_MSN))
|
||||
|
||||
Reference in New Issue
Block a user