]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-disk.c
dz.c: Resource management
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-disk.c
index 041be43a62cbd5fc4b06abbaff39cb254fa9d1ad..3c69822507e2a59216e8d2690362c961a940579b 100644 (file)
@@ -1,10 +1,9 @@
 /*
- *  linux/drivers/ide/ide-disk.c       Version 1.18    Mar 05, 2003
- *
- *  Copyright (C) 1994-1998  Linus Torvalds & authors (see below)
- *  Copyright (C) 1998-2002  Linux ATA Development
- *                             Andre Hedrick <andre@linux-ide.org>
- *  Copyright (C) 2003      Red Hat <alan@redhat.com>
+ *  Copyright (C) 1994-1998       Linus Torvalds & authors (see below)
+ *  Copyright (C) 1998-2002       Linux ATA Development
+ *                                   Andre Hedrick <andre@linux-ide.org>
+ *  Copyright (C) 2003            Red Hat <alan@redhat.com>
+ *  Copyright (C) 2003-2005, 2007  Bartlomiej Zolnierkiewicz
  */
 
 /*
@@ -201,7 +200,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
 
        memset(&task, 0, sizeof(task));
        task.tf_flags = IDE_TFLAG_NO_SELECT_MASK;  /* FIXME? */
-       task.tf_flags |= (IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE);
+       task.tf_flags |= (IDE_TFLAG_TF | IDE_TFLAG_DEVICE);
 
        if (drive->select.b.lba) {
                if (lba48) {
@@ -220,7 +219,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
                        tf->lbam   = (u8)(block >>  8);
                        tf->lbah   = (u8)(block >> 16);
 
-                       task.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB);
+                       task.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_HOB);
                } else {
                        tf->nsect  = nsectors & 0xff;
                        tf->lbal   = block;
@@ -314,9 +313,9 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48)
        else
                tf->command = WIN_READ_NATIVE_MAX;
        tf->device  = ATA_LBA;
-       args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+       args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
        if (lba48)
-               args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB);
+               args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_HOB);
        /* submit command request */
        ide_no_data_taskfile(drive, &args);
 
@@ -353,9 +352,9 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48)
                tf->command  = WIN_SET_MAX;
        }
        tf->device |= ATA_LBA;
-       args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+       args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
        if (lba48)
-               args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB);
+               args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_HOB);
        /* submit command request */
        ide_no_data_taskfile(drive, &args);
        /* if OK, compute maximum address value */
@@ -495,7 +494,7 @@ static int smart_enable(ide_drive_t *drive)
        tf->lbam    = SMART_LCYL_PASS;
        tf->lbah    = SMART_HCYL_PASS;
        tf->command = WIN_SMART;
-       args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+       args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
        return ide_no_data_taskfile(drive, &args);
 }
 
@@ -510,7 +509,7 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
        tf->lbam    = SMART_LCYL_PASS;
        tf->lbah    = SMART_HCYL_PASS;
        tf->command = WIN_SMART;
-       args.tf_flags   = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+       args.tf_flags   = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
        args.data_phase = TASKFILE_IN;
        (void) smart_enable(drive);
        return ide_raw_taskfile(drive, &args, buf, 1);
@@ -620,8 +619,10 @@ static int set_multcount(ide_drive_t *drive, int arg)
 
        if (drive->special.b.set_multmode)
                return -EBUSY;
+
        ide_init_drive_cmd (&rq);
-       rq.cmd_type = REQ_TYPE_ATA_CMD;
+       rq.cmd_type = REQ_TYPE_ATA_TASKFILE;
+
        drive->mult_req = arg;
        drive->special.b.set_multmode = 1;
        (void) ide_do_drive_cmd (drive, &rq, ide_wait);
@@ -689,7 +690,7 @@ static int write_cache(ide_drive_t *drive, int arg)
                args.tf.feature = arg ?
                        SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE;
                args.tf.command = WIN_SETFEATURES;
-               args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+               args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
                err = ide_no_data_taskfile(drive, &args);
                if (err == 0)
                        drive->wcache = arg;
@@ -709,7 +710,7 @@ static int do_idedisk_flushcache (ide_drive_t *drive)
                args.tf.command = WIN_FLUSH_CACHE_EXT;
        else
                args.tf.command = WIN_FLUSH_CACHE;
-       args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+       args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
        return ide_no_data_taskfile(drive, &args);
 }
 
@@ -724,7 +725,7 @@ static int set_acoustic (ide_drive_t *drive, int arg)
        args.tf.feature = arg ? SETFEATURES_EN_AAM : SETFEATURES_DIS_AAM;
        args.tf.nsect   = arg;
        args.tf.command = WIN_SETFEATURES;
-       args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+       args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
        ide_no_data_taskfile(drive, &args);
        drive->acoustic = arg;
        return 0;
@@ -975,7 +976,7 @@ static int idedisk_set_doorlock(ide_drive_t *drive, int on)
 
        memset(&task, 0, sizeof(task));
        task.tf.command = on ? WIN_DOORLOCK : WIN_DOORUNLOCK;
-       task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+       task.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
 
        return ide_no_data_taskfile(drive, &task);
 }