aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:38 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:38 -0400
commitd1d76714e2f0c520b6c2a84ab5b050d0b3244949 (patch)
tree605b10d60a0bcc59441ebe87503c03016df08dd1 /drivers/ide/ide-io.c
parentc67c216d810a05fffdbdbdf1b81048f0d4759287 (diff)
ide: fix HDIO_DRIVE_TASK[FILE] ioctls for CHS commands on LBA devices
Add IDE_DFLAG_LBA device flag and use it instead of ->select.b.lba. Since ->tf_load uses ->select.all for ATA Device/Head register this fixes HDIO_DRIVE_TASK[FILE] ioctls for CHS commands on LBA devices. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 11b602bb5741..623f6c246cf5 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -383,7 +383,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8
383 } else if (stat & ATA_ERR) { 383 } else if (stat & ATA_ERR) {
384 /* err has different meaning on cdrom and tape */ 384 /* err has different meaning on cdrom and tape */
385 if (err == ATA_ABORTED) { 385 if (err == ATA_ABORTED) {
386 if (drive->select.b.lba && 386 if ((drive->dev_flags & IDE_DFLAG_LBA) &&
387 /* some newer drives don't support ATA_CMD_INIT_DEV_PARAMS */ 387 /* some newer drives don't support ATA_CMD_INIT_DEV_PARAMS */
388 hwif->tp_ops->read_status(hwif) == ATA_CMD_INIT_DEV_PARAMS) 388 hwif->tp_ops->read_status(hwif) == ATA_CMD_INIT_DEV_PARAMS)
389 return ide_stopped; 389 return ide_stopped;
@@ -513,7 +513,7 @@ static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
513 tf->lbal = drive->sect; 513 tf->lbal = drive->sect;
514 tf->lbam = drive->cyl; 514 tf->lbam = drive->cyl;
515 tf->lbah = drive->cyl >> 8; 515 tf->lbah = drive->cyl >> 8;
516 tf->device = ((drive->head - 1) | drive->select.all) & ~ATA_LBA; 516 tf->device = (drive->head - 1) | drive->select.all;
517 tf->command = ATA_CMD_INIT_DEV_PARAMS; 517 tf->command = ATA_CMD_INIT_DEV_PARAMS;
518} 518}
519 519