diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:21 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:21 -0400 |
commit | 3a7d24841ad794ae64c90d7d00d62a83741912aa (patch) | |
tree | d71a36678fa88ed1e0b279390b6169f5018186bf | |
parent | f26b3d75959e9a0e43a2e1e1148c075592746c3d (diff) |
ide: use ATA_* defines instead of *_STAT and *_ERR ones
* ERR_STAT -> ATA_ERR
* INDEX_STAT -> ATA_IDX
* ECC_STAT -> ATA_CORR
* DRQ_STAT -> ATA_DRQ
* SEEK_STAT -> ATA_DSC
* WRERR_STAT -> ATA_DF
* READY_STAT -> ATA_DRDY
* BUSY_STAT -> ATA_BUSY
* MARK_ERR -> ATA_AMNF
* TRK0_ERR -> ATA_TRK0NF
* ABRT_ERR -> ATA_ABORTED
* MCR_ERR -> ATA_MCR
* ID_ERR -> ATA_IDNF
* MC_ERR -> ATA_MC
* ECC_ERR -> ATA_UNC
* ICRC_ERR -> ATA_ICRC
* BBD_ERR -> ATA_BBK
Also:
* ILI_ERR -> ATAPI_ILI
* EOM_ERR -> ATAPI_EOM
* LFS_ERR -> ATAPI_LFS
* CD -> ATAPI_COD
* IO -> ATAPI_IO
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-atapi.c | 32 | ||||
-rw-r--r-- | drivers/ide/ide-cd.c | 16 | ||||
-rw-r--r-- | drivers/ide/ide-dma.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 25 | ||||
-rw-r--r-- | drivers/ide/ide-iops.c | 22 | ||||
-rw-r--r-- | drivers/ide/ide-lib.c | 48 | ||||
-rw-r--r-- | drivers/ide/ide-probe.c | 16 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 6 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 26 | ||||
-rw-r--r-- | drivers/ide/ide.c | 8 | ||||
-rw-r--r-- | drivers/ide/pci/ns87415.c | 6 | ||||
-rw-r--r-- | drivers/ide/pci/scc_pata.c | 4 | ||||
-rw-r--r-- | drivers/scsi/ide-scsi.c | 2 | ||||
-rw-r--r-- | include/linux/ide.h | 15 |
15 files changed, 117 insertions, 113 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 2433fce6c111..12674e6519e6 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -41,7 +41,7 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
41 | 41 | ||
42 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { | 42 | if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) { |
43 | if (hwif->dma_ops->dma_end(drive) || | 43 | if (hwif->dma_ops->dma_end(drive) || |
44 | (drive->media == ide_tape && !scsi && (stat & ERR_STAT))) { | 44 | (drive->media == ide_tape && !scsi && (stat & ATA_ERR))) { |
45 | if (drive->media == ide_floppy && !scsi) | 45 | if (drive->media == ide_floppy && !scsi) |
46 | printk(KERN_ERR "%s: DMA %s error\n", | 46 | printk(KERN_ERR "%s: DMA %s error\n", |
47 | drive->name, rq_data_dir(pc->rq) | 47 | drive->name, rq_data_dir(pc->rq) |
@@ -56,7 +56,7 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
56 | } | 56 | } |
57 | 57 | ||
58 | /* No more interrupts */ | 58 | /* No more interrupts */ |
59 | if ((stat & DRQ_STAT) == 0) { | 59 | if ((stat & ATA_DRQ) == 0) { |
60 | debug_log("Packet command completed, %d bytes transferred\n", | 60 | debug_log("Packet command completed, %d bytes transferred\n", |
61 | pc->xferred); | 61 | pc->xferred); |
62 | 62 | ||
@@ -65,10 +65,10 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
65 | local_irq_enable_in_hardirq(); | 65 | local_irq_enable_in_hardirq(); |
66 | 66 | ||
67 | if (drive->media == ide_tape && !scsi && | 67 | if (drive->media == ide_tape && !scsi && |
68 | (stat & ERR_STAT) && rq->cmd[0] == REQUEST_SENSE) | 68 | (stat & ATA_ERR) && rq->cmd[0] == REQUEST_SENSE) |
69 | stat &= ~ERR_STAT; | 69 | stat &= ~ATA_ERR; |
70 | 70 | ||
71 | if ((stat & ERR_STAT) || (pc->flags & PC_FLAG_DMA_ERROR)) { | 71 | if ((stat & ATA_ERR) || (pc->flags & PC_FLAG_DMA_ERROR)) { |
72 | /* Error detected */ | 72 | /* Error detected */ |
73 | debug_log("%s: I/O error\n", drive->name); | 73 | debug_log("%s: I/O error\n", drive->name); |
74 | 74 | ||
@@ -95,7 +95,7 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
95 | cmd_finished: | 95 | cmd_finished: |
96 | pc->error = 0; | 96 | pc->error = 0; |
97 | if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) && | 97 | if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) && |
98 | (stat & SEEK_STAT) == 0) { | 98 | (stat & ATA_DSC) == 0) { |
99 | dsc_handle(drive); | 99 | dsc_handle(drive); |
100 | return ide_stopped; | 100 | return ide_stopped; |
101 | } | 101 | } |
@@ -117,17 +117,18 @@ cmd_finished: | |||
117 | /* Get the number of bytes to transfer on this interrupt. */ | 117 | /* Get the number of bytes to transfer on this interrupt. */ |
118 | ide_read_bcount_and_ireason(drive, &bcount, &ireason); | 118 | ide_read_bcount_and_ireason(drive, &bcount, &ireason); |
119 | 119 | ||
120 | if (ireason & CD) { | 120 | if (ireason & ATAPI_COD) { |
121 | printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__); | 121 | printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__); |
122 | return ide_do_reset(drive); | 122 | return ide_do_reset(drive); |
123 | } | 123 | } |
124 | 124 | ||
125 | if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) { | 125 | if (((ireason & ATAPI_IO) == ATAPI_IO) == |
126 | !!(pc->flags & PC_FLAG_WRITING)) { | ||
126 | /* Hopefully, we will never get here */ | 127 | /* Hopefully, we will never get here */ |
127 | printk(KERN_ERR "%s: We wanted to %s, but the device wants us " | 128 | printk(KERN_ERR "%s: We wanted to %s, but the device wants us " |
128 | "to %s!\n", drive->name, | 129 | "to %s!\n", drive->name, |
129 | (ireason & IO) ? "Write" : "Read", | 130 | (ireason & ATAPI_IO) ? "Write" : "Read", |
130 | (ireason & IO) ? "Read" : "Write"); | 131 | (ireason & ATAPI_IO) ? "Read" : "Write"); |
131 | return ide_do_reset(drive); | 132 | return ide_do_reset(drive); |
132 | } | 133 | } |
133 | 134 | ||
@@ -205,7 +206,8 @@ static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) | |||
205 | { | 206 | { |
206 | int retries = 100; | 207 | int retries = 100; |
207 | 208 | ||
208 | while (retries-- && ((ireason & CD) == 0 || (ireason & IO))) { | 209 | while (retries-- && ((ireason & ATAPI_COD) == 0 || |
210 | (ireason & ATAPI_IO))) { | ||
209 | printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing " | 211 | printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing " |
210 | "a packet command, retrying\n", drive->name); | 212 | "a packet command, retrying\n", drive->name); |
211 | udelay(100); | 213 | udelay(100); |
@@ -214,8 +216,8 @@ static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) | |||
214 | printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing " | 216 | printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing " |
215 | "a packet command, ignoring\n", | 217 | "a packet command, ignoring\n", |
216 | drive->name); | 218 | drive->name); |
217 | ireason |= CD; | 219 | ireason |= ATAPI_COD; |
218 | ireason &= ~IO; | 220 | ireason &= ~ATAPI_IO; |
219 | } | 221 | } |
220 | } | 222 | } |
221 | 223 | ||
@@ -231,7 +233,7 @@ ide_startstop_t ide_transfer_pc(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
231 | ide_startstop_t startstop; | 233 | ide_startstop_t startstop; |
232 | u8 ireason; | 234 | u8 ireason; |
233 | 235 | ||
234 | if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) { | 236 | if (ide_wait_stat(&startstop, drive, ATA_DRQ, ATA_BUSY, WAIT_READY)) { |
235 | printk(KERN_ERR "%s: Strange, packet command initiated yet " | 237 | printk(KERN_ERR "%s: Strange, packet command initiated yet " |
236 | "DRQ isn't asserted\n", drive->name); | 238 | "DRQ isn't asserted\n", drive->name); |
237 | return startstop; | 239 | return startstop; |
@@ -241,7 +243,7 @@ ide_startstop_t ide_transfer_pc(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
241 | if (drive->media == ide_tape && !drive->scsi) | 243 | if (drive->media == ide_tape && !drive->scsi) |
242 | ireason = ide_wait_ireason(drive, ireason); | 244 | ireason = ide_wait_ireason(drive, ireason); |
243 | 245 | ||
244 | if ((ireason & CD) == 0 || (ireason & IO)) { | 246 | if ((ireason & ATAPI_COD) == 0 || (ireason & ATAPI_IO)) { |
245 | printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing " | 247 | printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing " |
246 | "a packet command\n", drive->name); | 248 | "a packet command\n", drive->name); |
247 | return ide_do_reset(drive); | 249 | return ide_do_reset(drive); |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 77e0f9ab7698..239557f8920e 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -436,7 +436,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
436 | ide_dump_status_no_sense(drive, "media error (blank)", | 436 | ide_dump_status_no_sense(drive, "media error (blank)", |
437 | stat); | 437 | stat); |
438 | do_end_request = 1; | 438 | do_end_request = 1; |
439 | } else if ((err & ~ABRT_ERR) != 0) { | 439 | } else if ((err & ~ATA_ABORTED) != 0) { |
440 | /* go to the default handler for other errors */ | 440 | /* go to the default handler for other errors */ |
441 | ide_error(drive, "cdrom_decode_status", stat); | 441 | ide_error(drive, "cdrom_decode_status", stat); |
442 | return 1; | 442 | return 1; |
@@ -457,7 +457,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
457 | * If we got a CHECK_CONDITION status, queue | 457 | * If we got a CHECK_CONDITION status, queue |
458 | * a request sense command. | 458 | * a request sense command. |
459 | */ | 459 | */ |
460 | if (stat & ERR_STAT) | 460 | if (stat & ATA_ERR) |
461 | cdrom_queue_request_sense(drive, NULL, NULL); | 461 | cdrom_queue_request_sense(drive, NULL, NULL); |
462 | } else { | 462 | } else { |
463 | blk_dump_rq_flags(rq, "ide-cd: bad rq"); | 463 | blk_dump_rq_flags(rq, "ide-cd: bad rq"); |
@@ -468,7 +468,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
468 | return 1; | 468 | return 1; |
469 | 469 | ||
470 | end_request: | 470 | end_request: |
471 | if (stat & ERR_STAT) { | 471 | if (stat & ATA_ERR) { |
472 | unsigned long flags; | 472 | unsigned long flags; |
473 | 473 | ||
474 | spin_lock_irqsave(&ide_lock, flags); | 474 | spin_lock_irqsave(&ide_lock, flags); |
@@ -574,7 +574,7 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive, | |||
574 | */ | 574 | */ |
575 | 575 | ||
576 | /* check for errors */ | 576 | /* check for errors */ |
577 | if (cdrom_decode_status(drive, DRQ_STAT, NULL)) | 577 | if (cdrom_decode_status(drive, ATA_DRQ, NULL)) |
578 | return ide_stopped; | 578 | return ide_stopped; |
579 | 579 | ||
580 | /* ok, next interrupt will be DMA interrupt */ | 580 | /* ok, next interrupt will be DMA interrupt */ |
@@ -582,8 +582,8 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive, | |||
582 | drive->waiting_for_dma = 1; | 582 | drive->waiting_for_dma = 1; |
583 | } else { | 583 | } else { |
584 | /* otherwise, we must wait for DRQ to get set */ | 584 | /* otherwise, we must wait for DRQ to get set */ |
585 | if (ide_wait_stat(&startstop, drive, DRQ_STAT, | 585 | if (ide_wait_stat(&startstop, drive, ATA_DRQ, |
586 | BUSY_STAT, WAIT_READY)) | 586 | ATA_BUSY, WAIT_READY)) |
587 | return startstop; | 587 | return startstop; |
588 | } | 588 | } |
589 | 589 | ||
@@ -938,7 +938,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
938 | thislen = len; | 938 | thislen = len; |
939 | 939 | ||
940 | /* If DRQ is clear, the command has completed. */ | 940 | /* If DRQ is clear, the command has completed. */ |
941 | if ((stat & DRQ_STAT) == 0) { | 941 | if ((stat & ATA_DRQ) == 0) { |
942 | if (blk_fs_request(rq)) { | 942 | if (blk_fs_request(rq)) { |
943 | /* | 943 | /* |
944 | * If we're not done reading/writing, complain. | 944 | * If we're not done reading/writing, complain. |
@@ -1206,7 +1206,7 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
1206 | unsigned long elapsed = jiffies - info->start_seek; | 1206 | unsigned long elapsed = jiffies - info->start_seek; |
1207 | int stat = hwif->tp_ops->read_status(hwif); | 1207 | int stat = hwif->tp_ops->read_status(hwif); |
1208 | 1208 | ||
1209 | if ((stat & SEEK_STAT) != SEEK_STAT) { | 1209 | if ((stat & ATA_DSC) != ATA_DSC) { |
1210 | if (elapsed < IDECD_SEEK_TIMEOUT) { | 1210 | if (elapsed < IDECD_SEEK_TIMEOUT) { |
1211 | ide_stall_queue(drive, | 1211 | ide_stall_queue(drive, |
1212 | IDECD_SEEK_TIMER); | 1212 | IDECD_SEEK_TIMER); |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 15e608f52eba..ef2f1504c0d5 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -106,7 +106,7 @@ ide_startstop_t ide_dma_intr (ide_drive_t *drive) | |||
106 | dma_stat = hwif->dma_ops->dma_end(drive); | 106 | dma_stat = hwif->dma_ops->dma_end(drive); |
107 | stat = hwif->tp_ops->read_status(hwif); | 107 | stat = hwif->tp_ops->read_status(hwif); |
108 | 108 | ||
109 | if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { | 109 | if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | ATA_DRQ)) { |
110 | if (!dma_stat) { | 110 | if (!dma_stat) { |
111 | struct request *rq = HWGROUP(drive)->rq; | 111 | struct request *rq = HWGROUP(drive)->rq; |
112 | 112 | ||
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 67f93a46f510..59baa9643f8b 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -945,7 +945,7 @@ static int idefloppy_get_format_progress(ide_drive_t *drive, int __user *arg) | |||
945 | stat = hwif->tp_ops->read_status(hwif); | 945 | stat = hwif->tp_ops->read_status(hwif); |
946 | local_irq_restore(flags); | 946 | local_irq_restore(flags); |
947 | 947 | ||
948 | progress_indication = ((stat & SEEK_STAT) == 0) ? 0 : 0x10000; | 948 | progress_indication = ((stat & ATA_DSC) == 0) ? 0 : 0x10000; |
949 | } | 949 | } |
950 | if (put_user(progress_indication, arg)) | 950 | if (put_user(progress_indication, arg)) |
951 | return (-EFAULT); | 951 | return (-EFAULT); |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index ce9ecd138836..8dd7b46b41b7 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -322,7 +322,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) | |||
322 | ide_task_t *task = (ide_task_t *)rq->special; | 322 | ide_task_t *task = (ide_task_t *)rq->special; |
323 | 323 | ||
324 | if (rq->errors == 0) | 324 | if (rq->errors == 0) |
325 | rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT); | 325 | rq->errors = !OK_STAT(stat, ATA_DRDY, BAD_STAT); |
326 | 326 | ||
327 | if (task) { | 327 | if (task) { |
328 | struct ide_taskfile *tf = &task->tf; | 328 | struct ide_taskfile *tf = &task->tf; |
@@ -373,12 +373,12 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8 | |||
373 | { | 373 | { |
374 | ide_hwif_t *hwif = drive->hwif; | 374 | ide_hwif_t *hwif = drive->hwif; |
375 | 375 | ||
376 | if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) { | 376 | if ((stat & ATA_BUSY) || ((stat & ATA_DF) && !drive->nowerr)) { |
377 | /* other bits are useless when BUSY */ | 377 | /* other bits are useless when BUSY */ |
378 | rq->errors |= ERROR_RESET; | 378 | rq->errors |= ERROR_RESET; |
379 | } else if (stat & ERR_STAT) { | 379 | } else if (stat & ATA_ERR) { |
380 | /* err has different meaning on cdrom and tape */ | 380 | /* err has different meaning on cdrom and tape */ |
381 | if (err == ABRT_ERR) { | 381 | if (err == ATA_ABORTED) { |
382 | if (drive->select.b.lba && | 382 | if (drive->select.b.lba && |
383 | /* some newer drives don't support ATA_CMD_INIT_DEV_PARAMS */ | 383 | /* some newer drives don't support ATA_CMD_INIT_DEV_PARAMS */ |
384 | hwif->tp_ops->read_status(hwif) == ATA_CMD_INIT_DEV_PARAMS) | 384 | hwif->tp_ops->read_status(hwif) == ATA_CMD_INIT_DEV_PARAMS) |
@@ -386,16 +386,16 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8 | |||
386 | } else if ((err & BAD_CRC) == BAD_CRC) { | 386 | } else if ((err & BAD_CRC) == BAD_CRC) { |
387 | /* UDMA crc error, just retry the operation */ | 387 | /* UDMA crc error, just retry the operation */ |
388 | drive->crc_count++; | 388 | drive->crc_count++; |
389 | } else if (err & (BBD_ERR | ECC_ERR)) { | 389 | } else if (err & (ATA_BBK | ATA_UNC)) { |
390 | /* retries won't help these */ | 390 | /* retries won't help these */ |
391 | rq->errors = ERROR_MAX; | 391 | rq->errors = ERROR_MAX; |
392 | } else if (err & TRK0_ERR) { | 392 | } else if (err & ATA_TRK0NF) { |
393 | /* help it find track zero */ | 393 | /* help it find track zero */ |
394 | rq->errors |= ERROR_RECAL; | 394 | rq->errors |= ERROR_RECAL; |
395 | } | 395 | } |
396 | } | 396 | } |
397 | 397 | ||
398 | if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && | 398 | if ((stat & ATA_DRQ) && rq_data_dir(rq) == READ && |
399 | (hwif->host_flags & IDE_HFLAG_ERROR_STOPS_FIFO) == 0) { | 399 | (hwif->host_flags & IDE_HFLAG_ERROR_STOPS_FIFO) == 0) { |
400 | int nsect = drive->mult_count ? drive->mult_count : 1; | 400 | int nsect = drive->mult_count ? drive->mult_count : 1; |
401 | 401 | ||
@@ -407,7 +407,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8 | |||
407 | return ide_stopped; | 407 | return ide_stopped; |
408 | } | 408 | } |
409 | 409 | ||
410 | if (hwif->tp_ops->read_status(hwif) & (BUSY_STAT | DRQ_STAT)) | 410 | if (hwif->tp_ops->read_status(hwif) & (ATA_BUSY | ATA_DRQ)) |
411 | rq->errors |= ERROR_RESET; | 411 | rq->errors |= ERROR_RESET; |
412 | 412 | ||
413 | if ((rq->errors & ERROR_RESET) == ERROR_RESET) { | 413 | if ((rq->errors & ERROR_RESET) == ERROR_RESET) { |
@@ -427,14 +427,14 @@ static ide_startstop_t ide_atapi_error(ide_drive_t *drive, struct request *rq, u | |||
427 | { | 427 | { |
428 | ide_hwif_t *hwif = drive->hwif; | 428 | ide_hwif_t *hwif = drive->hwif; |
429 | 429 | ||
430 | if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) { | 430 | if ((stat & ATA_BUSY) || ((stat & ATA_DF) && !drive->nowerr)) { |
431 | /* other bits are useless when BUSY */ | 431 | /* other bits are useless when BUSY */ |
432 | rq->errors |= ERROR_RESET; | 432 | rq->errors |= ERROR_RESET; |
433 | } else { | 433 | } else { |
434 | /* add decoding error stuff */ | 434 | /* add decoding error stuff */ |
435 | } | 435 | } |
436 | 436 | ||
437 | if (hwif->tp_ops->read_status(hwif) & (BUSY_STAT | DRQ_STAT)) | 437 | if (hwif->tp_ops->read_status(hwif) & (ATA_BUSY | ATA_DRQ)) |
438 | /* force an abort */ | 438 | /* force an abort */ |
439 | hwif->tp_ops->exec_command(hwif, ATA_CMD_IDLEIMMEDIATE); | 439 | hwif->tp_ops->exec_command(hwif, ATA_CMD_IDLEIMMEDIATE); |
440 | 440 | ||
@@ -804,7 +804,8 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
804 | ide_check_pm_state(drive, rq); | 804 | ide_check_pm_state(drive, rq); |
805 | 805 | ||
806 | SELECT_DRIVE(drive); | 806 | SELECT_DRIVE(drive); |
807 | if (ide_wait_stat(&startstop, drive, drive->ready_stat, BUSY_STAT|DRQ_STAT, WAIT_READY)) { | 807 | if (ide_wait_stat(&startstop, drive, drive->ready_stat, |
808 | ATA_BUSY | ATA_DRQ, WAIT_READY)) { | ||
808 | printk(KERN_ERR "%s: drive not ready for command\n", drive->name); | 809 | printk(KERN_ERR "%s: drive not ready for command\n", drive->name); |
809 | return startstop; | 810 | return startstop; |
810 | } | 811 | } |
@@ -1324,7 +1325,7 @@ static void unexpected_intr (int irq, ide_hwgroup_t *hwgroup) | |||
1324 | if (hwif->irq == irq) { | 1325 | if (hwif->irq == irq) { |
1325 | stat = hwif->tp_ops->read_status(hwif); | 1326 | stat = hwif->tp_ops->read_status(hwif); |
1326 | 1327 | ||
1327 | if (!OK_STAT(stat, READY_STAT, BAD_STAT)) { | 1328 | if (!OK_STAT(stat, ATA_DRDY, BAD_STAT)) { |
1328 | /* Try to not flood the console with msgs */ | 1329 | /* Try to not flood the console with msgs */ |
1329 | static unsigned long last_msgtime, count; | 1330 | static unsigned long last_msgtime, count; |
1330 | ++count; | 1331 | ++count; |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 21647a2eaff9..8cfa6125c7a4 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -473,7 +473,7 @@ int drive_is_ready (ide_drive_t *drive) | |||
473 | /* Note: this may clear a pending IRQ!! */ | 473 | /* Note: this may clear a pending IRQ!! */ |
474 | stat = hwif->tp_ops->read_status(hwif); | 474 | stat = hwif->tp_ops->read_status(hwif); |
475 | 475 | ||
476 | if (stat & BUSY_STAT) | 476 | if (stat & ATA_BUSY) |
477 | /* drive busy: definitely not interrupting */ | 477 | /* drive busy: definitely not interrupting */ |
478 | return 0; | 478 | return 0; |
479 | 479 | ||
@@ -505,10 +505,10 @@ static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long ti | |||
505 | udelay(1); /* spec allows drive 400ns to assert "BUSY" */ | 505 | udelay(1); /* spec allows drive 400ns to assert "BUSY" */ |
506 | stat = tp_ops->read_status(hwif); | 506 | stat = tp_ops->read_status(hwif); |
507 | 507 | ||
508 | if (stat & BUSY_STAT) { | 508 | if (stat & ATA_BUSY) { |
509 | local_irq_set(flags); | 509 | local_irq_set(flags); |
510 | timeout += jiffies; | 510 | timeout += jiffies; |
511 | while ((stat = tp_ops->read_status(hwif)) & BUSY_STAT) { | 511 | while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { |
512 | if (time_after(jiffies, timeout)) { | 512 | if (time_after(jiffies, timeout)) { |
513 | /* | 513 | /* |
514 | * One last read after the timeout in case | 514 | * One last read after the timeout in case |
@@ -516,7 +516,7 @@ static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long ti | |||
516 | * progress during the timeout.. | 516 | * progress during the timeout.. |
517 | */ | 517 | */ |
518 | stat = tp_ops->read_status(hwif); | 518 | stat = tp_ops->read_status(hwif); |
519 | if (!(stat & BUSY_STAT)) | 519 | if ((stat & ATA_BUSY) == 0) |
520 | break; | 520 | break; |
521 | 521 | ||
522 | local_irq_restore(flags); | 522 | local_irq_restore(flags); |
@@ -685,12 +685,12 @@ int ide_driveid_update(ide_drive_t *drive) | |||
685 | 685 | ||
686 | msleep(50); /* give drive a breather */ | 686 | msleep(50); /* give drive a breather */ |
687 | stat = tp_ops->read_altstatus(hwif); | 687 | stat = tp_ops->read_altstatus(hwif); |
688 | } while (stat & BUSY_STAT); | 688 | } while (stat & ATA_BUSY); |
689 | 689 | ||
690 | msleep(50); /* wait for IRQ and DRQ_STAT */ | 690 | msleep(50); /* wait for IRQ and ATA_DRQ */ |
691 | stat = tp_ops->read_status(hwif); | 691 | stat = tp_ops->read_status(hwif); |
692 | 692 | ||
693 | if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) { | 693 | if (!OK_STAT(stat, ATA_DRQ, BAD_R_STAT)) { |
694 | SELECT_MASK(drive, 0); | 694 | SELECT_MASK(drive, 0); |
695 | printk("%s: CHECK for good STATUS\n", drive->name); | 695 | printk("%s: CHECK for good STATUS\n", drive->name); |
696 | return 0; | 696 | return 0; |
@@ -776,7 +776,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed) | |||
776 | tp_ops->set_irq(hwif, 1); | 776 | tp_ops->set_irq(hwif, 1); |
777 | 777 | ||
778 | error = __ide_wait_stat(drive, drive->ready_stat, | 778 | error = __ide_wait_stat(drive, drive->ready_stat, |
779 | BUSY_STAT|DRQ_STAT|ERR_STAT, | 779 | ATA_BUSY | ATA_DRQ | ATA_ERR, |
780 | WAIT_CMD, &stat); | 780 | WAIT_CMD, &stat); |
781 | 781 | ||
782 | SELECT_MASK(drive, 0); | 782 | SELECT_MASK(drive, 0); |
@@ -923,7 +923,7 @@ static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive) | |||
923 | udelay (10); | 923 | udelay (10); |
924 | stat = hwif->tp_ops->read_status(hwif); | 924 | stat = hwif->tp_ops->read_status(hwif); |
925 | 925 | ||
926 | if (OK_STAT(stat, 0, BUSY_STAT)) | 926 | if (OK_STAT(stat, 0, ATA_BUSY)) |
927 | printk("%s: ATAPI reset complete\n", drive->name); | 927 | printk("%s: ATAPI reset complete\n", drive->name); |
928 | else { | 928 | else { |
929 | if (time_before(jiffies, hwgroup->poll_timeout)) { | 929 | if (time_before(jiffies, hwgroup->poll_timeout)) { |
@@ -969,7 +969,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive) | |||
969 | 969 | ||
970 | tmp = hwif->tp_ops->read_status(hwif); | 970 | tmp = hwif->tp_ops->read_status(hwif); |
971 | 971 | ||
972 | if (!OK_STAT(tmp, 0, BUSY_STAT)) { | 972 | if (!OK_STAT(tmp, 0, ATA_BUSY)) { |
973 | if (time_before(jiffies, hwgroup->poll_timeout)) { | 973 | if (time_before(jiffies, hwgroup->poll_timeout)) { |
974 | ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL); | 974 | ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL); |
975 | /* continue polling */ | 975 | /* continue polling */ |
@@ -1183,7 +1183,7 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout) | |||
1183 | */ | 1183 | */ |
1184 | mdelay(1); | 1184 | mdelay(1); |
1185 | stat = hwif->tp_ops->read_status(hwif); | 1185 | stat = hwif->tp_ops->read_status(hwif); |
1186 | if ((stat & BUSY_STAT) == 0) | 1186 | if ((stat & ATA_BUSY) == 0) |
1187 | return 0; | 1187 | return 0; |
1188 | /* | 1188 | /* |
1189 | * Assume a value of 0xff means nothing is connected to | 1189 | * Assume a value of 0xff means nothing is connected to |
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 738c007a04d3..c5c37bfd8b09 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
@@ -340,16 +340,16 @@ static void ide_dump_sector(ide_drive_t *drive) | |||
340 | static void ide_dump_ata_error(ide_drive_t *drive, u8 err) | 340 | static void ide_dump_ata_error(ide_drive_t *drive, u8 err) |
341 | { | 341 | { |
342 | printk("{ "); | 342 | printk("{ "); |
343 | if (err & ABRT_ERR) printk("DriveStatusError "); | 343 | if (err & ATA_ABORTED) printk("DriveStatusError "); |
344 | if (err & ICRC_ERR) | 344 | if (err & ATA_ICRC) |
345 | printk((err & ABRT_ERR) ? "BadCRC " : "BadSector "); | 345 | printk((err & ATA_ABORTED) ? "BadCRC " : "BadSector "); |
346 | if (err & ECC_ERR) printk("UncorrectableError "); | 346 | if (err & ATA_UNC) printk("UncorrectableError "); |
347 | if (err & ID_ERR) printk("SectorIdNotFound "); | 347 | if (err & ATA_IDNF) printk("SectorIdNotFound "); |
348 | if (err & TRK0_ERR) printk("TrackZeroNotFound "); | 348 | if (err & ATA_TRK0NF) printk("TrackZeroNotFound "); |
349 | if (err & MARK_ERR) printk("AddrMarkNotFound "); | 349 | if (err & ATA_AMNF) printk("AddrMarkNotFound "); |
350 | printk("}"); | 350 | printk("}"); |
351 | if ((err & (BBD_ERR | ABRT_ERR)) == BBD_ERR || | 351 | if ((err & (ATA_BBK | ATA_ABORTED)) == ATA_BBK || |
352 | (err & (ECC_ERR|ID_ERR|MARK_ERR))) { | 352 | (err & (ATA_UNC | ATA_IDNF | ATA_AMNF))) { |
353 | ide_dump_sector(drive); | 353 | ide_dump_sector(drive); |
354 | if (HWGROUP(drive) && HWGROUP(drive)->rq) | 354 | if (HWGROUP(drive) && HWGROUP(drive)->rq) |
355 | printk(", sector=%llu", | 355 | printk(", sector=%llu", |
@@ -361,12 +361,12 @@ static void ide_dump_ata_error(ide_drive_t *drive, u8 err) | |||
361 | static void ide_dump_atapi_error(ide_drive_t *drive, u8 err) | 361 | static void ide_dump_atapi_error(ide_drive_t *drive, u8 err) |
362 | { | 362 | { |
363 | printk("{ "); | 363 | printk("{ "); |
364 | if (err & ILI_ERR) printk("IllegalLengthIndication "); | 364 | if (err & ATAPI_ILI) printk("IllegalLengthIndication "); |
365 | if (err & EOM_ERR) printk("EndOfMedia "); | 365 | if (err & ATAPI_EOM) printk("EndOfMedia "); |
366 | if (err & ABRT_ERR) printk("AbortedCommand "); | 366 | if (err & ATA_ABORTED) printk("AbortedCommand "); |
367 | if (err & MCR_ERR) printk("MediaChangeRequested "); | 367 | if (err & ATA_MCR) printk("MediaChangeRequested "); |
368 | if (err & LFS_ERR) printk("LastFailedSense=0x%02x ", | 368 | if (err & ATAPI_LFS) printk("LastFailedSense=0x%02x ", |
369 | (err & LFS_ERR) >> 4); | 369 | (err & ATAPI_LFS) >> 4); |
370 | printk("}\n"); | 370 | printk("}\n"); |
371 | } | 371 | } |
372 | 372 | ||
@@ -388,19 +388,19 @@ u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat) | |||
388 | 388 | ||
389 | local_irq_save(flags); | 389 | local_irq_save(flags); |
390 | printk("%s: %s: status=0x%02x { ", drive->name, msg, stat); | 390 | printk("%s: %s: status=0x%02x { ", drive->name, msg, stat); |
391 | if (stat & BUSY_STAT) | 391 | if (stat & ATA_BUSY) |
392 | printk("Busy "); | 392 | printk("Busy "); |
393 | else { | 393 | else { |
394 | if (stat & READY_STAT) printk("DriveReady "); | 394 | if (stat & ATA_DRDY) printk("DriveReady "); |
395 | if (stat & WRERR_STAT) printk("DeviceFault "); | 395 | if (stat & ATA_DF) printk("DeviceFault "); |
396 | if (stat & SEEK_STAT) printk("SeekComplete "); | 396 | if (stat & ATA_DSC) printk("SeekComplete "); |
397 | if (stat & DRQ_STAT) printk("DataRequest "); | 397 | if (stat & ATA_DRQ) printk("DataRequest "); |
398 | if (stat & ECC_STAT) printk("CorrectedError "); | 398 | if (stat & ATA_CORR) printk("CorrectedError "); |
399 | if (stat & INDEX_STAT) printk("Index "); | 399 | if (stat & ATA_IDX) printk("Index "); |
400 | if (stat & ERR_STAT) printk("Error "); | 400 | if (stat & ATA_ERR) printk("Error "); |
401 | } | 401 | } |
402 | printk("}\n"); | 402 | printk("}\n"); |
403 | if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { | 403 | if ((stat & (ATA_BUSY | ATA_ERR)) == ATA_ERR) { |
404 | err = ide_read_error(drive); | 404 | err = ide_read_error(drive); |
405 | printk("%s: %s: error=0x%02x ", drive->name, msg, err); | 405 | printk("%s: %s: error=0x%02x ", drive->name, msg, err); |
406 | if (drive->media == ide_disk) | 406 | if (drive->media == ide_disk) |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 4829daacb342..7578ad48080f 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -264,7 +264,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) | |||
264 | if (io_ports->ctl_addr) { | 264 | if (io_ports->ctl_addr) { |
265 | a = tp_ops->read_altstatus(hwif); | 265 | a = tp_ops->read_altstatus(hwif); |
266 | s = tp_ops->read_status(hwif); | 266 | s = tp_ops->read_status(hwif); |
267 | if ((a ^ s) & ~INDEX_STAT) | 267 | if ((a ^ s) & ~ATA_IDX) |
268 | /* ancient Seagate drives, broken interfaces */ | 268 | /* ancient Seagate drives, broken interfaces */ |
269 | printk(KERN_INFO "%s: probing with STATUS(0x%02x) " | 269 | printk(KERN_INFO "%s: probing with STATUS(0x%02x) " |
270 | "instead of ALTSTATUS(0x%02x)\n", | 270 | "instead of ALTSTATUS(0x%02x)\n", |
@@ -301,13 +301,13 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) | |||
301 | msleep(50); | 301 | msleep(50); |
302 | s = use_altstatus ? tp_ops->read_altstatus(hwif) | 302 | s = use_altstatus ? tp_ops->read_altstatus(hwif) |
303 | : tp_ops->read_status(hwif); | 303 | : tp_ops->read_status(hwif); |
304 | } while (s & BUSY_STAT); | 304 | } while (s & ATA_BUSY); |
305 | 305 | ||
306 | /* wait for IRQ and DRQ_STAT */ | 306 | /* wait for IRQ and ATA_DRQ */ |
307 | msleep(50); | 307 | msleep(50); |
308 | s = tp_ops->read_status(hwif); | 308 | s = tp_ops->read_status(hwif); |
309 | 309 | ||
310 | if (OK_STAT(s, DRQ_STAT, BAD_R_STAT)) { | 310 | if (OK_STAT(s, ATA_DRQ, BAD_R_STAT)) { |
311 | unsigned long flags; | 311 | unsigned long flags; |
312 | 312 | ||
313 | /* local CPU only; some systems need this */ | 313 | /* local CPU only; some systems need this */ |
@@ -391,7 +391,7 @@ static int ide_busy_sleep(ide_hwif_t *hwif) | |||
391 | do { | 391 | do { |
392 | msleep(50); | 392 | msleep(50); |
393 | stat = hwif->tp_ops->read_status(hwif); | 393 | stat = hwif->tp_ops->read_status(hwif); |
394 | if ((stat & BUSY_STAT) == 0) | 394 | if ((stat & ATA_BUSY) == 0) |
395 | return 0; | 395 | return 0; |
396 | } while (time_before(jiffies, timeout)); | 396 | } while (time_before(jiffies, timeout)); |
397 | 397 | ||
@@ -460,7 +460,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
460 | if (drive->select.b.unit != 0) { | 460 | if (drive->select.b.unit != 0) { |
461 | /* exit with drive0 selected */ | 461 | /* exit with drive0 selected */ |
462 | SELECT_DRIVE(&hwif->drives[0]); | 462 | SELECT_DRIVE(&hwif->drives[0]); |
463 | /* allow BUSY_STAT to assert & clear */ | 463 | /* allow ATA_BUSY to assert & clear */ |
464 | msleep(50); | 464 | msleep(50); |
465 | } | 465 | } |
466 | /* no i/f present: mmm.. this should be a 4 -ml */ | 466 | /* no i/f present: mmm.. this should be a 4 -ml */ |
@@ -469,7 +469,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
469 | 469 | ||
470 | stat = tp_ops->read_status(hwif); | 470 | stat = tp_ops->read_status(hwif); |
471 | 471 | ||
472 | if (OK_STAT(stat, READY_STAT, BUSY_STAT) || | 472 | if (OK_STAT(stat, ATA_DRDY, ATA_BUSY) || |
473 | drive->present || cmd == ATA_CMD_ID_ATAPI) { | 473 | drive->present || cmd == ATA_CMD_ID_ATAPI) { |
474 | /* send cmd and wait */ | 474 | /* send cmd and wait */ |
475 | if ((rc = try_to_identify(drive, cmd))) { | 475 | if ((rc = try_to_identify(drive, cmd))) { |
@@ -479,7 +479,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
479 | 479 | ||
480 | stat = tp_ops->read_status(hwif); | 480 | stat = tp_ops->read_status(hwif); |
481 | 481 | ||
482 | if (stat == (BUSY_STAT | READY_STAT)) | 482 | if (stat == (ATA_BUSY | ATA_DRDY)) |
483 | return 4; | 483 | return 4; |
484 | 484 | ||
485 | if (rc == 1 && cmd == ATA_CMD_ID_ATAPI) { | 485 | if (rc == 1 && cmd == ATA_CMD_ID_ATAPI) { |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 2c4c6674db61..2745e5d26848 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -920,8 +920,8 @@ static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive) | |||
920 | 920 | ||
921 | stat = hwif->tp_ops->read_status(hwif); | 921 | stat = hwif->tp_ops->read_status(hwif); |
922 | 922 | ||
923 | if (stat & SEEK_STAT) { | 923 | if (stat & ATA_DSC) { |
924 | if (stat & ERR_STAT) { | 924 | if (stat & ATA_ERR) { |
925 | /* Error detected */ | 925 | /* Error detected */ |
926 | if (pc->c[0] != TEST_UNIT_READY) | 926 | if (pc->c[0] != TEST_UNIT_READY) |
927 | printk(KERN_ERR "ide-tape: %s: I/O error, ", | 927 | printk(KERN_ERR "ide-tape: %s: I/O error, ", |
@@ -1022,7 +1022,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | if (!test_and_clear_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags) && | 1024 | if (!test_and_clear_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags) && |
1025 | (stat & SEEK_STAT) == 0) { | 1025 | (stat & ATA_DSC) == 0) { |
1026 | if (postponed_rq == NULL) { | 1026 | if (postponed_rq == NULL) { |
1027 | tape->dsc_polling_start = jiffies; | 1027 | tape->dsc_polling_start = jiffies; |
1028 | tape->dsc_poll_freq = tape->best_dsc_rw_freq; | 1028 | tape->dsc_poll_freq = tape->best_dsc_rw_freq; |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 9224f6797186..b1fb815dbf68 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -136,7 +136,7 @@ static ide_startstop_t set_multmode_intr(ide_drive_t *drive) | |||
136 | local_irq_enable_in_hardirq(); | 136 | local_irq_enable_in_hardirq(); |
137 | stat = hwif->tp_ops->read_status(hwif); | 137 | stat = hwif->tp_ops->read_status(hwif); |
138 | 138 | ||
139 | if (OK_STAT(stat, READY_STAT, BAD_STAT)) | 139 | if (OK_STAT(stat, ATA_DRDY, BAD_STAT)) |
140 | drive->mult_count = drive->mult_req; | 140 | drive->mult_count = drive->mult_req; |
141 | else { | 141 | else { |
142 | drive->mult_req = drive->mult_count = 0; | 142 | drive->mult_req = drive->mult_count = 0; |
@@ -159,15 +159,15 @@ static ide_startstop_t set_geometry_intr(ide_drive_t *drive) | |||
159 | 159 | ||
160 | while (1) { | 160 | while (1) { |
161 | stat = hwif->tp_ops->read_status(hwif); | 161 | stat = hwif->tp_ops->read_status(hwif); |
162 | if ((stat & BUSY_STAT) == 0 || retries-- == 0) | 162 | if ((stat & ATA_BUSY) == 0 || retries-- == 0) |
163 | break; | 163 | break; |
164 | udelay(10); | 164 | udelay(10); |
165 | }; | 165 | }; |
166 | 166 | ||
167 | if (OK_STAT(stat, READY_STAT, BAD_STAT)) | 167 | if (OK_STAT(stat, ATA_DRDY, BAD_STAT)) |
168 | return ide_stopped; | 168 | return ide_stopped; |
169 | 169 | ||
170 | if (stat & (ERR_STAT|DRQ_STAT)) | 170 | if (stat & (ATA_ERR | ATA_DRQ)) |
171 | return ide_error(drive, "set_geometry_intr", stat); | 171 | return ide_error(drive, "set_geometry_intr", stat); |
172 | 172 | ||
173 | ide_set_handler(drive, &set_geometry_intr, WAIT_WORSTCASE, NULL); | 173 | ide_set_handler(drive, &set_geometry_intr, WAIT_WORSTCASE, NULL); |
@@ -185,7 +185,7 @@ static ide_startstop_t recal_intr(ide_drive_t *drive) | |||
185 | local_irq_enable_in_hardirq(); | 185 | local_irq_enable_in_hardirq(); |
186 | stat = hwif->tp_ops->read_status(hwif); | 186 | stat = hwif->tp_ops->read_status(hwif); |
187 | 187 | ||
188 | if (!OK_STAT(stat, READY_STAT, BAD_STAT)) | 188 | if (!OK_STAT(stat, ATA_DRDY, BAD_STAT)) |
189 | return ide_error(drive, "recal_intr", stat); | 189 | return ide_error(drive, "recal_intr", stat); |
190 | return ide_stopped; | 190 | return ide_stopped; |
191 | } | 191 | } |
@@ -202,7 +202,7 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive) | |||
202 | local_irq_enable_in_hardirq(); | 202 | local_irq_enable_in_hardirq(); |
203 | stat = hwif->tp_ops->read_status(hwif); | 203 | stat = hwif->tp_ops->read_status(hwif); |
204 | 204 | ||
205 | if (!OK_STAT(stat, READY_STAT, BAD_STAT)) | 205 | if (!OK_STAT(stat, ATA_DRDY, BAD_STAT)) |
206 | return ide_error(drive, "task_no_data_intr", stat); | 206 | return ide_error(drive, "task_no_data_intr", stat); |
207 | /* calls ide_end_drive_cmd */ | 207 | /* calls ide_end_drive_cmd */ |
208 | 208 | ||
@@ -225,13 +225,13 @@ static u8 wait_drive_not_busy(ide_drive_t *drive) | |||
225 | for (retries = 0; retries < 1000; retries++) { | 225 | for (retries = 0; retries < 1000; retries++) { |
226 | stat = hwif->tp_ops->read_status(hwif); | 226 | stat = hwif->tp_ops->read_status(hwif); |
227 | 227 | ||
228 | if (stat & BUSY_STAT) | 228 | if (stat & ATA_BUSY) |
229 | udelay(10); | 229 | udelay(10); |
230 | else | 230 | else |
231 | break; | 231 | break; |
232 | } | 232 | } |
233 | 233 | ||
234 | if (stat & BUSY_STAT) | 234 | if (stat & ATA_BUSY) |
235 | printk(KERN_ERR "%s: drive still BUSY!\n", drive->name); | 235 | printk(KERN_ERR "%s: drive still BUSY!\n", drive->name); |
236 | 236 | ||
237 | return stat; | 237 | return stat; |
@@ -390,7 +390,7 @@ void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat) | |||
390 | static ide_startstop_t task_in_unexpected(ide_drive_t *drive, struct request *rq, u8 stat) | 390 | static ide_startstop_t task_in_unexpected(ide_drive_t *drive, struct request *rq, u8 stat) |
391 | { | 391 | { |
392 | /* Command all done? */ | 392 | /* Command all done? */ |
393 | if (OK_STAT(stat, READY_STAT, BUSY_STAT)) { | 393 | if (OK_STAT(stat, ATA_DRDY, ATA_BUSY)) { |
394 | task_end_request(drive, rq, stat); | 394 | task_end_request(drive, rq, stat); |
395 | return ide_stopped; | 395 | return ide_stopped; |
396 | } | 396 | } |
@@ -410,11 +410,11 @@ static ide_startstop_t task_in_intr(ide_drive_t *drive) | |||
410 | u8 stat = hwif->tp_ops->read_status(hwif); | 410 | u8 stat = hwif->tp_ops->read_status(hwif); |
411 | 411 | ||
412 | /* Error? */ | 412 | /* Error? */ |
413 | if (stat & ERR_STAT) | 413 | if (stat & ATA_ERR) |
414 | return task_error(drive, rq, __func__, stat); | 414 | return task_error(drive, rq, __func__, stat); |
415 | 415 | ||
416 | /* Didn't want any data? Odd. */ | 416 | /* Didn't want any data? Odd. */ |
417 | if (!(stat & DRQ_STAT)) | 417 | if ((stat & ATA_DRQ) == 0) |
418 | return task_in_unexpected(drive, rq, stat); | 418 | return task_in_unexpected(drive, rq, stat); |
419 | 419 | ||
420 | ide_pio_datablock(drive, rq, 0); | 420 | ide_pio_datablock(drive, rq, 0); |
@@ -447,7 +447,7 @@ static ide_startstop_t task_out_intr (ide_drive_t *drive) | |||
447 | return task_error(drive, rq, __func__, stat); | 447 | return task_error(drive, rq, __func__, stat); |
448 | 448 | ||
449 | /* Deal with unexpected ATA data phase. */ | 449 | /* Deal with unexpected ATA data phase. */ |
450 | if (((stat & DRQ_STAT) == 0) ^ !hwif->nleft) | 450 | if (((stat & ATA_DRQ) == 0) ^ !hwif->nleft) |
451 | return task_error(drive, rq, __func__, stat); | 451 | return task_error(drive, rq, __func__, stat); |
452 | 452 | ||
453 | if (!hwif->nleft) { | 453 | if (!hwif->nleft) { |
@@ -466,7 +466,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq) | |||
466 | { | 466 | { |
467 | ide_startstop_t startstop; | 467 | ide_startstop_t startstop; |
468 | 468 | ||
469 | if (ide_wait_stat(&startstop, drive, DRQ_STAT, | 469 | if (ide_wait_stat(&startstop, drive, ATA_DRQ, |
470 | drive->bad_wstat, WAIT_DRQ)) { | 470 | drive->bad_wstat, WAIT_DRQ)) { |
471 | printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n", | 471 | printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n", |
472 | drive->name, | 472 | drive->name, |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 21b3a767e7d7..7fddfe161795 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -119,7 +119,7 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif) | |||
119 | drive->media = ide_disk; | 119 | drive->media = ide_disk; |
120 | drive->select.all = (unit<<4)|0xa0; | 120 | drive->select.all = (unit<<4)|0xa0; |
121 | drive->hwif = hwif; | 121 | drive->hwif = hwif; |
122 | drive->ready_stat = READY_STAT; | 122 | drive->ready_stat = ATA_DRDY; |
123 | drive->bad_wstat = BAD_W_STAT; | 123 | drive->bad_wstat = BAD_W_STAT; |
124 | drive->special.b.recalibrate = 1; | 124 | drive->special.b.recalibrate = 1; |
125 | drive->special.b.set_geometry = 1; | 125 | drive->special.b.set_geometry = 1; |
@@ -884,7 +884,7 @@ MODULE_PARM_DESC(noprobe, "skip probing for a device"); | |||
884 | static unsigned int ide_nowerr; | 884 | static unsigned int ide_nowerr; |
885 | 885 | ||
886 | module_param_call(nowerr, ide_set_dev_param_mask, NULL, &ide_nowerr, 0); | 886 | module_param_call(nowerr, ide_set_dev_param_mask, NULL, &ide_nowerr, 0); |
887 | MODULE_PARM_DESC(nowerr, "ignore the WRERR_STAT bit for a device"); | 887 | MODULE_PARM_DESC(nowerr, "ignore the ATA_DF bit for a device"); |
888 | 888 | ||
889 | static unsigned int ide_cdroms; | 889 | static unsigned int ide_cdroms; |
890 | 890 | ||
@@ -949,7 +949,7 @@ static void ide_dev_apply_params(ide_drive_t *drive) | |||
949 | drive->noprobe = 1; | 949 | drive->noprobe = 1; |
950 | } | 950 | } |
951 | if (ide_nowerr & (1 << i)) { | 951 | if (ide_nowerr & (1 << i)) { |
952 | printk(KERN_INFO "ide: ignoring the WRERR_STAT bit for %s\n", | 952 | printk(KERN_INFO "ide: ignoring the ATA_DF bit for %s\n", |
953 | drive->name); | 953 | drive->name); |
954 | drive->bad_wstat = BAD_R_STAT; | 954 | drive->bad_wstat = BAD_R_STAT; |
955 | } | 955 | } |
@@ -970,7 +970,7 @@ static void ide_dev_apply_params(ide_drive_t *drive) | |||
970 | drive->cyl, drive->head, drive->sect); | 970 | drive->cyl, drive->head, drive->sect); |
971 | drive->present = 1; | 971 | drive->present = 1; |
972 | drive->media = ide_disk; | 972 | drive->media = ide_disk; |
973 | drive->ready_stat = READY_STAT; | 973 | drive->ready_stat = ATA_DRDY; |
974 | } | 974 | } |
975 | } | 975 | } |
976 | 976 | ||
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index ffefcd15196c..17685f0ade13 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c | |||
@@ -274,9 +274,9 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) | |||
274 | do { | 274 | do { |
275 | udelay(50); | 275 | udelay(50); |
276 | stat = hwif->tp_ops->read_status(hwif); | 276 | stat = hwif->tp_ops->read_status(hwif); |
277 | if (stat == 0xff) | 277 | if (stat == 0xff) |
278 | break; | 278 | break; |
279 | } while ((stat & BUSY_STAT) && --timeout); | 279 | } while ((stat & ATA_BUSY) && --timeout); |
280 | #endif | 280 | #endif |
281 | } | 281 | } |
282 | 282 | ||
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c index 44cccd1e086a..192a6a70a631 100644 --- a/drivers/ide/pci/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c | |||
@@ -400,7 +400,7 @@ static int scc_dma_end(ide_drive_t *drive) | |||
400 | /* errata A308 workaround: Step5 (check data loss) */ | 400 | /* errata A308 workaround: Step5 (check data loss) */ |
401 | /* We don't check non ide_disk because it is limited to UDMA4 */ | 401 | /* We don't check non ide_disk because it is limited to UDMA4 */ |
402 | if (!(in_be32((void __iomem *)hwif->io_ports.ctl_addr) | 402 | if (!(in_be32((void __iomem *)hwif->io_ports.ctl_addr) |
403 | & ERR_STAT) && | 403 | & ATA_ERR) && |
404 | drive->media == ide_disk && drive->current_speed > XFER_UDMA_4) { | 404 | drive->media == ide_disk && drive->current_speed > XFER_UDMA_4) { |
405 | reg = in_be32((void __iomem *)intsts_port); | 405 | reg = in_be32((void __iomem *)intsts_port); |
406 | if (!(reg & INTSTS_ACTEINT)) { | 406 | if (!(reg & INTSTS_ACTEINT)) { |
@@ -504,7 +504,7 @@ static int scc_dma_test_irq(ide_drive_t *drive) | |||
504 | 504 | ||
505 | /* SCC errata A252,A308 workaround: Step4 */ | 505 | /* SCC errata A252,A308 workaround: Step4 */ |
506 | if ((in_be32((void __iomem *)hwif->io_ports.ctl_addr) | 506 | if ((in_be32((void __iomem *)hwif->io_ports.ctl_addr) |
507 | & ERR_STAT) && | 507 | & ATA_ERR) && |
508 | (int_stat & INTSTS_INTRQ)) | 508 | (int_stat & INTSTS_INTRQ)) |
509 | return 1; | 509 | return 1; |
510 | 510 | ||
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 167c3b625218..daa5f3115ddc 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -244,7 +244,7 @@ idescsi_atapi_error(ide_drive_t *drive, struct request *rq, u8 stat, u8 err) | |||
244 | { | 244 | { |
245 | ide_hwif_t *hwif = drive->hwif; | 245 | ide_hwif_t *hwif = drive->hwif; |
246 | 246 | ||
247 | if (hwif->tp_ops->read_status(hwif) & (BUSY_STAT | DRQ_STAT)) | 247 | if (hwif->tp_ops->read_status(hwif) & (ATA_BUSY | ATA_DRQ)) |
248 | /* force an abort */ | 248 | /* force an abort */ |
249 | hwif->tp_ops->exec_command(hwif, ATA_CMD_IDLEIMMEDIATE); | 249 | hwif->tp_ops->exec_command(hwif, ATA_CMD_IDLEIMMEDIATE); |
250 | 250 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index e887927e00e6..d963c1929c84 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -87,12 +87,13 @@ struct ide_io_ports { | |||
87 | }; | 87 | }; |
88 | 88 | ||
89 | #define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) | 89 | #define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) |
90 | #define BAD_R_STAT (BUSY_STAT | ERR_STAT) | ||
91 | #define BAD_W_STAT (BAD_R_STAT | WRERR_STAT) | ||
92 | #define BAD_STAT (BAD_R_STAT | DRQ_STAT) | ||
93 | #define DRIVE_READY (READY_STAT | SEEK_STAT) | ||
94 | 90 | ||
95 | #define BAD_CRC (ABRT_ERR | ICRC_ERR) | 91 | #define BAD_R_STAT (ATA_BUSY | ATA_ERR) |
92 | #define BAD_W_STAT (BAD_R_STAT | ATA_DF) | ||
93 | #define BAD_STAT (BAD_R_STAT | ATA_DRQ) | ||
94 | #define DRIVE_READY (ATA_DRDY | ATA_DSC) | ||
95 | |||
96 | #define BAD_CRC (ATA_ABORTED | ATA_ICRC) | ||
96 | 97 | ||
97 | #define SATA_NR_PORTS (3) /* 16 possible ?? */ | 98 | #define SATA_NR_PORTS (3) /* 16 possible ?? */ |
98 | 99 | ||
@@ -438,8 +439,8 @@ struct ide_drive_s { | |||
438 | u8 mult_req; /* requested multiple sector setting */ | 439 | u8 mult_req; /* requested multiple sector setting */ |
439 | u8 tune_req; /* requested drive tuning setting */ | 440 | u8 tune_req; /* requested drive tuning setting */ |
440 | u8 io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ | 441 | u8 io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ |
441 | u8 bad_wstat; /* used for ignoring WRERR_STAT */ | 442 | u8 bad_wstat; /* used for ignoring ATA_DF */ |
442 | u8 nowerr; /* used for ignoring WRERR_STAT */ | 443 | u8 nowerr; /* used for ignoring ATA_DF */ |
443 | u8 sect0; /* offset of first sector for DM6:DDO */ | 444 | u8 sect0; /* offset of first sector for DM6:DDO */ |
444 | u8 head; /* "real" number of heads */ | 445 | u8 head; /* "real" number of heads */ |
445 | u8 sect; /* "real" sectors per track */ | 446 | u8 sect; /* "real" sectors per track */ |