aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-disk.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-disk.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-disk.c')
-rw-r--r--drivers/ide/ide-disk.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 40253c51ace4..83da9a98dabc 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -141,18 +141,18 @@ static int lba_capacity_is_ok(u16 *id)
141} 141}
142 142
143static const u8 ide_rw_cmds[] = { 143static const u8 ide_rw_cmds[] = {
144 WIN_MULTREAD, 144 ATA_CMD_READ_MULTI,
145 WIN_MULTWRITE, 145 ATA_CMD_WRITE_MULTI,
146 WIN_MULTREAD_EXT, 146 ATA_CMD_READ_MULTI_EXT,
147 WIN_MULTWRITE_EXT, 147 ATA_CMD_WRITE_MULTI_EXT,
148 WIN_READ, 148 ATA_CMD_PIO_READ,
149 WIN_WRITE, 149 ATA_CMD_PIO_WRITE,
150 WIN_READ_EXT, 150 ATA_CMD_PIO_READ_EXT,
151 WIN_WRITE_EXT, 151 ATA_CMD_PIO_WRITE_EXT,
152 WIN_READDMA, 152 ATA_CMD_READ,
153 WIN_WRITEDMA, 153 ATA_CMD_WRITE,
154 WIN_READDMA_EXT, 154 ATA_CMD_READ_EXT,
155 WIN_WRITEDMA_EXT, 155 ATA_CMD_WRITE_EXT,
156}; 156};
157 157
158static const u8 ide_data_phases[] = { 158static const u8 ide_data_phases[] = {
@@ -323,9 +323,9 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48)
323 /* Create IDE/ATA command request structure */ 323 /* Create IDE/ATA command request structure */
324 memset(&args, 0, sizeof(ide_task_t)); 324 memset(&args, 0, sizeof(ide_task_t));
325 if (lba48) 325 if (lba48)
326 tf->command = WIN_READ_NATIVE_MAX_EXT; 326 tf->command = ATA_CMD_READ_NATIVE_MAX_EXT;
327 else 327 else
328 tf->command = WIN_READ_NATIVE_MAX; 328 tf->command = ATA_CMD_READ_NATIVE_MAX;
329 tf->device = ATA_LBA; 329 tf->device = ATA_LBA;
330 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 330 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
331 if (lba48) 331 if (lba48)
@@ -360,10 +360,10 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48)
360 tf->hob_lbal = (addr_req >>= 8) & 0xff; 360 tf->hob_lbal = (addr_req >>= 8) & 0xff;
361 tf->hob_lbam = (addr_req >>= 8) & 0xff; 361 tf->hob_lbam = (addr_req >>= 8) & 0xff;
362 tf->hob_lbah = (addr_req >>= 8) & 0xff; 362 tf->hob_lbah = (addr_req >>= 8) & 0xff;
363 tf->command = WIN_SET_MAX_EXT; 363 tf->command = ATA_CMD_SET_MAX_EXT;
364 } else { 364 } else {
365 tf->device = (addr_req >>= 8) & 0x0f; 365 tf->device = (addr_req >>= 8) & 0x0f;
366 tf->command = WIN_SET_MAX; 366 tf->command = ATA_CMD_SET_MAX;
367 } 367 }
368 tf->device |= ATA_LBA; 368 tf->device |= ATA_LBA;
369 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 369 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
@@ -482,10 +482,10 @@ static int smart_enable(ide_drive_t *drive)
482 struct ide_taskfile *tf = &args.tf; 482 struct ide_taskfile *tf = &args.tf;
483 483
484 memset(&args, 0, sizeof(ide_task_t)); 484 memset(&args, 0, sizeof(ide_task_t));
485 tf->feature = SMART_ENABLE; 485 tf->feature = ATA_SMART_ENABLE;
486 tf->lbam = SMART_LCYL_PASS; 486 tf->lbam = ATA_SMART_LBAM_PASS;
487 tf->lbah = SMART_HCYL_PASS; 487 tf->lbah = ATA_SMART_LBAH_PASS;
488 tf->command = WIN_SMART; 488 tf->command = ATA_CMD_SMART;
489 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 489 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
490 return ide_no_data_taskfile(drive, &args); 490 return ide_no_data_taskfile(drive, &args);
491} 491}
@@ -498,9 +498,9 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
498 memset(&args, 0, sizeof(ide_task_t)); 498 memset(&args, 0, sizeof(ide_task_t));
499 tf->feature = sub_cmd; 499 tf->feature = sub_cmd;
500 tf->nsect = 0x01; 500 tf->nsect = 0x01;
501 tf->lbam = SMART_LCYL_PASS; 501 tf->lbam = ATA_SMART_LBAM_PASS;
502 tf->lbah = SMART_HCYL_PASS; 502 tf->lbah = ATA_SMART_LBAH_PASS;
503 tf->command = WIN_SMART; 503 tf->command = ATA_CMD_SMART;
504 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 504 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
505 args.data_phase = TASKFILE_IN; 505 args.data_phase = TASKFILE_IN;
506 (void) smart_enable(drive); 506 (void) smart_enable(drive);
@@ -558,14 +558,14 @@ static int proc_idedisk_read_sv
558 (char *page, char **start, off_t off, int count, int *eof, void *data) 558 (char *page, char **start, off_t off, int count, int *eof, void *data)
559{ 559{
560 return proc_idedisk_read_smart(page, start, off, count, eof, data, 560 return proc_idedisk_read_smart(page, start, off, count, eof, data,
561 SMART_READ_VALUES); 561 ATA_SMART_READ_VALUES);
562} 562}
563 563
564static int proc_idedisk_read_st 564static int proc_idedisk_read_st
565 (char *page, char **start, off_t off, int count, int *eof, void *data) 565 (char *page, char **start, off_t off, int count, int *eof, void *data)
566{ 566{
567 return proc_idedisk_read_smart(page, start, off, count, eof, data, 567 return proc_idedisk_read_smart(page, start, off, count, eof, data,
568 SMART_READ_THRESHOLDS); 568 ATA_SMART_READ_THRESHOLDS);
569} 569}
570 570
571static ide_proc_entry_t idedisk_proc[] = { 571static ide_proc_entry_t idedisk_proc[] = {
@@ -589,9 +589,9 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
589 memset(task, 0, sizeof(*task)); 589 memset(task, 0, sizeof(*task));
590 if (ide_id_has_flush_cache_ext(drive->id) && 590 if (ide_id_has_flush_cache_ext(drive->id) &&
591 (drive->capacity64 >= (1UL << 28))) 591 (drive->capacity64 >= (1UL << 28)))
592 task->tf.command = WIN_FLUSH_CACHE_EXT; 592 task->tf.command = ATA_CMD_FLUSH_EXT;
593 else 593 else
594 task->tf.command = WIN_FLUSH_CACHE; 594 task->tf.command = ATA_CMD_FLUSH;
595 task->tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE | 595 task->tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE |
596 IDE_TFLAG_DYN; 596 IDE_TFLAG_DYN;
597 task->data_phase = TASKFILE_NO_DATA; 597 task->data_phase = TASKFILE_NO_DATA;
@@ -686,8 +686,8 @@ static int write_cache(ide_drive_t *drive, int arg)
686 if (ide_id_has_flush_cache(drive->id)) { 686 if (ide_id_has_flush_cache(drive->id)) {
687 memset(&args, 0, sizeof(ide_task_t)); 687 memset(&args, 0, sizeof(ide_task_t));
688 args.tf.feature = arg ? 688 args.tf.feature = arg ?
689 SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE; 689 SETFEATURES_WC_ON : SETFEATURES_WC_OFF;
690 args.tf.command = WIN_SETFEATURES; 690 args.tf.command = ATA_CMD_SET_FEATURES;
691 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 691 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
692 err = ide_no_data_taskfile(drive, &args); 692 err = ide_no_data_taskfile(drive, &args);
693 if (err == 0) 693 if (err == 0)
@@ -705,9 +705,9 @@ static int do_idedisk_flushcache(ide_drive_t *drive)
705 705
706 memset(&args, 0, sizeof(ide_task_t)); 706 memset(&args, 0, sizeof(ide_task_t));
707 if (ide_id_has_flush_cache_ext(drive->id)) 707 if (ide_id_has_flush_cache_ext(drive->id))
708 args.tf.command = WIN_FLUSH_CACHE_EXT; 708 args.tf.command = ATA_CMD_FLUSH_EXT;
709 else 709 else
710 args.tf.command = WIN_FLUSH_CACHE; 710 args.tf.command = ATA_CMD_FLUSH;
711 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 711 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
712 return ide_no_data_taskfile(drive, &args); 712 return ide_no_data_taskfile(drive, &args);
713} 713}
@@ -720,9 +720,9 @@ static int set_acoustic(ide_drive_t *drive, int arg)
720 return -EINVAL; 720 return -EINVAL;
721 721
722 memset(&args, 0, sizeof(ide_task_t)); 722 memset(&args, 0, sizeof(ide_task_t));
723 args.tf.feature = arg ? SETFEATURES_EN_AAM : SETFEATURES_DIS_AAM; 723 args.tf.feature = arg ? SETFEATURES_AAM_ON : SETFEATURES_AAM_OFF;
724 args.tf.nsect = arg; 724 args.tf.nsect = arg;
725 args.tf.command = WIN_SETFEATURES; 725 args.tf.command = ATA_CMD_SET_FEATURES;
726 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 726 args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
727 ide_no_data_taskfile(drive, &args); 727 ide_no_data_taskfile(drive, &args);
728 drive->acoustic = arg; 728 drive->acoustic = arg;
@@ -985,7 +985,7 @@ static int idedisk_set_doorlock(ide_drive_t *drive, int on)
985 ide_task_t task; 985 ide_task_t task;
986 986
987 memset(&task, 0, sizeof(task)); 987 memset(&task, 0, sizeof(task));
988 task.tf.command = on ? WIN_DOORLOCK : WIN_DOORUNLOCK; 988 task.tf.command = on ? ATA_CMD_MEDIA_LOCK : ATA_CMD_MEDIA_UNLOCK;
989 task.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 989 task.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
990 990
991 return ide_no_data_taskfile(drive, &task); 991 return ide_no_data_taskfile(drive, &task);