aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-lib.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-04-08 08:13:02 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-04-08 08:13:02 -0400
commit745483f10c6cefb303007c6873e2bfce54efa8ed (patch)
tree9dc9dca95f017edf279bf3e2d5ec3d07481e75da /drivers/ide/ide-lib.c
parent60f85019c6c8c1aebf3485a313e0da094bc95d07 (diff)
ide: simplify 'struct ide_taskfile'
Make 'struct ide_taskfile' cover only 8 register values and thus put two such fields ('tf' and 'hob') into 'struct ide_cmd', dropping unnecessary 'tf_array' field from it. This required changing the prototype of ide_get_lba_addr() and ide_tf_dump(). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> [bart: fix setting of ATA_LBA bit for LBA48 commands in __ide_do_rw_disk()] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-lib.c')
-rw-r--r--drivers/ide/ide-lib.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index c9ef77c5d62e..6857e6aaf20d 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -49,16 +49,17 @@ static void ide_dump_opcode(ide_drive_t *drive)
49 printk(KERN_CONT "0x%02x\n", cmd->tf.command); 49 printk(KERN_CONT "0x%02x\n", cmd->tf.command);
50} 50}
51 51
52u64 ide_get_lba_addr(struct ide_taskfile *tf, int lba48) 52u64 ide_get_lba_addr(struct ide_cmd *cmd, int lba48)
53{ 53{
54 struct ide_taskfile *tf = &cmd->tf;
54 u32 high, low; 55 u32 high, low;
55 56
56 if (lba48)
57 high = (tf->hob_lbah << 16) | (tf->hob_lbam << 8) |
58 tf->hob_lbal;
59 else
60 high = tf->device & 0xf;
61 low = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal; 57 low = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal;
58 if (lba48) {
59 tf = &cmd->hob;
60 high = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal;
61 } else
62 high = tf->device & 0xf;
62 63
63 return ((u64)high << 24) | low; 64 return ((u64)high << 24) | low;
64} 65}
@@ -82,7 +83,7 @@ static void ide_dump_sector(ide_drive_t *drive)
82 83
83 if (lba48 || (tf->device & ATA_LBA)) 84 if (lba48 || (tf->device & ATA_LBA))
84 printk(KERN_CONT ", LBAsect=%llu", 85 printk(KERN_CONT ", LBAsect=%llu",
85 (unsigned long long)ide_get_lba_addr(tf, lba48)); 86 (unsigned long long)ide_get_lba_addr(&cmd, lba48));
86 else 87 else
87 printk(KERN_CONT ", CHS=%d/%d/%d", (tf->lbah << 8) + tf->lbam, 88 printk(KERN_CONT ", CHS=%d/%d/%d", (tf->lbah << 8) + tf->lbam,
88 tf->device & 0xf, tf->lbal); 89 tf->device & 0xf, tf->lbal);