From 650d841d9e053a618dd8ce753422f91b493cf2f6 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 25 Jan 2008 22:17:06 +0100 Subject: ide: add struct ide_taskfile (take 2) * Don't set write-only ide_task_t.hobRegister[6] and ide_task_t.hobRegister[7] in idedisk_set_max_address_ext(). * Add struct ide_taskfile and use it in ide_task_t instead of tfRegister[] and hobRegister[]. * Remove no longer needed IDE_CONTROL_OFFSET_HOB define. * Add #ifndef/#endif __KERNEL__ around definitions of {task,hob}_struct_t. While at it: * Use ATA_LBA define for LBA bit (0x40) as suggested by Tejun Heo. v2: * Add missing newlines. (Noticed by Sergei) * Use ~ATA_LBA instead of 0xBF. (Noticed by Sergei) * Use unnamed unions for error/feature and status/command. (Suggested by Sergei). There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov Cc: Tejun Heo Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-iops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/ide/ide-iops.c') diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index f4e8a0cf06e..4aac1cc7101 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c @@ -642,9 +642,9 @@ no_80w: int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) { - if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) && - (args->tfRegister[IDE_SECTOR_OFFSET] > XFER_UDMA_2) && - (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER)) { + if (args->tf.command == WIN_SETFEATURES && + args->tf.lbal > XFER_UDMA_2 && + args->tf.feature == SETFEATURES_XFER) { if (eighty_ninty_three(drive) == 0) { printk(KERN_WARNING "%s: UDMA speeds >UDMA33 cannot " "be set\n", drive->name); @@ -662,9 +662,9 @@ int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) */ int set_transfer (ide_drive_t *drive, ide_task_t *args) { - if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) && - (args->tfRegister[IDE_SECTOR_OFFSET] >= XFER_SW_DMA_0) && - (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER) && + if (args->tf.command == WIN_SETFEATURES && + args->tf.lbal >= XFER_SW_DMA_0 && + args->tf.feature == SETFEATURES_XFER && (drive->id->dma_ultra || drive->id->dma_mword || drive->id->dma_1word)) -- cgit v1.2.3