aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:21 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:21 -0400
commitaaaade3f059fa1b57283d4a7c8351a42ec747bf0 (patch)
tree3c2e80f0317fc52d9866b0bb83b8cc89ed764b57 /drivers/ide/ide-taskfile.c
parenta4f19040a3a6cd431efe0a10b9d2e8d5e3904865 (diff)
ide: WIN_* -> ATA_CMD_*
* Use ATA_CMD_* defines instead of WIN_* ones. While at it: * EXABYTE_ENABLE_NEXT -> ATA_EXABYTE_ENABLE_NEST * SETFEATURES_{EN,DIS}_WCACHE -> SETFEATURES_WC_{ON,OFF} * SETFEATURES_{EN,DIS}_AAM -> SETFEATURES_AAM_{ON,OFF} * SMART_* -> ATA_SMART_* * Remove stale comment from ide-proc.c. Partially based on earlier work by Chris Wedgwood. Acked-by: Chris Wedgwood <cw@f00f.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index f889373d7f95..9224f6797186 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -44,9 +44,9 @@ int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf)
44 memset(&args, 0, sizeof(ide_task_t)); 44 memset(&args, 0, sizeof(ide_task_t));
45 args.tf.nsect = 0x01; 45 args.tf.nsect = 0x01;
46 if (drive->media == ide_disk) 46 if (drive->media == ide_disk)
47 args.tf.command = WIN_IDENTIFY; 47 args.tf.command = ATA_CMD_ID_ATA;
48 else 48 else
49 args.tf.command = WIN_PIDENTIFY; 49 args.tf.command = ATA_CMD_ID_ATAPI;
50 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 50 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
51 args.data_phase = TASKFILE_IN; 51 args.data_phase = TASKFILE_IN;
52 return ide_raw_taskfile(drive, &args, buf, 1); 52 return ide_raw_taskfile(drive, &args, buf, 1);
@@ -99,12 +99,17 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
99 case TASKFILE_NO_DATA: 99 case TASKFILE_NO_DATA:
100 if (handler == NULL) 100 if (handler == NULL)
101 handler = task_no_data_intr; 101 handler = task_no_data_intr;
102 /* WIN_{SPECIFY,RESTORE,SETMULT} use custom handlers */
103 if (task->tf_flags & IDE_TFLAG_CUSTOM_HANDLER) { 102 if (task->tf_flags & IDE_TFLAG_CUSTOM_HANDLER) {
104 switch (tf->command) { 103 switch (tf->command) {
105 case WIN_SPECIFY: handler = set_geometry_intr; break; 104 case ATA_CMD_INIT_DEV_PARAMS:
106 case WIN_RESTORE: handler = recal_intr; break; 105 handler = set_geometry_intr;
107 case WIN_SETMULT: handler = set_multmode_intr; break; 106 break;
107 case ATA_CMD_RESTORE:
108 handler = recal_intr;
109 break;
110 case ATA_CMD_SET_MULTI:
111 handler = set_multmode_intr;
112 break;
108 } 113 }
109 } 114 }
110 ide_execute_command(drive, tf->command, handler, 115 ide_execute_command(drive, tf->command, handler,
@@ -121,7 +126,7 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
121EXPORT_SYMBOL_GPL(do_rw_taskfile); 126EXPORT_SYMBOL_GPL(do_rw_taskfile);
122 127
123/* 128/*
124 * set_multmode_intr() is invoked on completion of a WIN_SETMULT cmd. 129 * set_multmode_intr() is invoked on completion of a ATA_CMD_SET_MULTI cmd.
125 */ 130 */
126static ide_startstop_t set_multmode_intr(ide_drive_t *drive) 131static ide_startstop_t set_multmode_intr(ide_drive_t *drive)
127{ 132{
@@ -142,7 +147,7 @@ static ide_startstop_t set_multmode_intr(ide_drive_t *drive)
142} 147}
143 148
144/* 149/*
145 * set_geometry_intr() is invoked on completion of a WIN_SPECIFY cmd. 150 * set_geometry_intr() is invoked on completion of a ATA_CMD_INIT_DEV_PARAMS cmd.
146 */ 151 */
147static ide_startstop_t set_geometry_intr(ide_drive_t *drive) 152static ide_startstop_t set_geometry_intr(ide_drive_t *drive)
148{ 153{
@@ -170,7 +175,7 @@ static ide_startstop_t set_geometry_intr(ide_drive_t *drive)
170} 175}
171 176
172/* 177/*
173 * recal_intr() is invoked on completion of a WIN_RESTORE (recalibrate) cmd. 178 * recal_intr() is invoked on completion of a ATA_CMD_RESTORE (recalibrate) cmd.
174 */ 179 */
175static ide_startstop_t recal_intr(ide_drive_t *drive) 180static ide_startstop_t recal_intr(ide_drive_t *drive)
176{ 181{
@@ -747,7 +752,7 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
747 752
748 memset(&tfargs, 0, sizeof(ide_task_t)); 753 memset(&tfargs, 0, sizeof(ide_task_t));
749 tf->feature = args[2]; 754 tf->feature = args[2];
750 if (args[0] == WIN_SMART) { 755 if (args[0] == ATA_CMD_SMART) {
751 tf->nsect = args[3]; 756 tf->nsect = args[3];
752 tf->lbal = args[1]; 757 tf->lbal = args[1];
753 tf->lbam = 0x4f; 758 tf->lbam = 0x4f;
@@ -769,7 +774,7 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
769 return -ENOMEM; 774 return -ENOMEM;
770 } 775 }
771 776
772 if (tf->command == WIN_SETFEATURES && 777 if (tf->command == ATA_CMD_SET_FEATURES &&
773 tf->feature == SETFEATURES_XFER && 778 tf->feature == SETFEATURES_XFER &&
774 tf->nsect >= XFER_SW_DMA_0 && 779 tf->nsect >= XFER_SW_DMA_0 &&
775 (id[ATA_ID_UDMA_MODES] || 780 (id[ATA_ID_UDMA_MODES] ||