if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
                if (hwif->dma_ops->dma_end(drive) ||
-                   (drive->media == ide_tape && !scsi && (stat & ERR_STAT))) {
+                   (drive->media == ide_tape && !scsi && (stat & ATA_ERR))) {
                        if (drive->media == ide_floppy && !scsi)
                                printk(KERN_ERR "%s: DMA %s error\n",
                                        drive->name, rq_data_dir(pc->rq)
        }
 
        /* No more interrupts */
-       if ((stat & DRQ_STAT) == 0) {
+       if ((stat & ATA_DRQ) == 0) {
                debug_log("Packet command completed, %d bytes transferred\n",
                          pc->xferred);
 
                local_irq_enable_in_hardirq();
 
                if (drive->media == ide_tape && !scsi &&
-                   (stat & ERR_STAT) && rq->cmd[0] == REQUEST_SENSE)
-                       stat &= ~ERR_STAT;
+                   (stat & ATA_ERR) && rq->cmd[0] == REQUEST_SENSE)
+                       stat &= ~ATA_ERR;
 
-               if ((stat & ERR_STAT) || (pc->flags & PC_FLAG_DMA_ERROR)) {
+               if ((stat & ATA_ERR) || (pc->flags & PC_FLAG_DMA_ERROR)) {
                        /* Error detected */
                        debug_log("%s: I/O error\n", drive->name);
 
 cmd_finished:
                pc->error = 0;
                if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) &&
-                   (stat & SEEK_STAT) == 0) {
+                   (stat & ATA_DSC) == 0) {
                        dsc_handle(drive);
                        return ide_stopped;
                }
        /* Get the number of bytes to transfer on this interrupt. */
        ide_read_bcount_and_ireason(drive, &bcount, &ireason);
 
-       if (ireason & CD) {
+       if (ireason & ATAPI_COD) {
                printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__);
                return ide_do_reset(drive);
        }
 
-       if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) {
+       if (((ireason & ATAPI_IO) == ATAPI_IO) ==
+               !!(pc->flags & PC_FLAG_WRITING)) {
                /* Hopefully, we will never get here */
                printk(KERN_ERR "%s: We wanted to %s, but the device wants us "
                                "to %s!\n", drive->name,
-                               (ireason & IO) ? "Write" : "Read",
-                               (ireason & IO) ? "Read" : "Write");
+                               (ireason & ATAPI_IO) ? "Write" : "Read",
+                               (ireason & ATAPI_IO) ? "Read" : "Write");
                return ide_do_reset(drive);
        }
 
 {
        int retries = 100;
 
-       while (retries-- && ((ireason & CD) == 0 || (ireason & IO))) {
+       while (retries-- && ((ireason & ATAPI_COD) == 0 ||
+               (ireason & ATAPI_IO))) {
                printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing "
                                "a packet command, retrying\n", drive->name);
                udelay(100);
                        printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing "
                                        "a packet command, ignoring\n",
                                        drive->name);
-                       ireason |= CD;
-                       ireason &= ~IO;
+                       ireason |= ATAPI_COD;
+                       ireason &= ~ATAPI_IO;
                }
        }
 
        ide_startstop_t startstop;
        u8 ireason;
 
-       if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
+       if (ide_wait_stat(&startstop, drive, ATA_DRQ, ATA_BUSY, WAIT_READY)) {
                printk(KERN_ERR "%s: Strange, packet command initiated yet "
                                "DRQ isn't asserted\n", drive->name);
                return startstop;
        if (drive->media == ide_tape && !drive->scsi)
                ireason = ide_wait_ireason(drive, ireason);
 
-       if ((ireason & CD) == 0 || (ireason & IO)) {
+       if ((ireason & ATAPI_COD) == 0 || (ireason & ATAPI_IO)) {
                printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
                                "a packet command\n", drive->name);
                return ide_do_reset(drive);
 
                        ide_dump_status_no_sense(drive, "media error (blank)",
                                                 stat);
                        do_end_request = 1;
-               } else if ((err & ~ABRT_ERR) != 0) {
+               } else if ((err & ~ATA_ABORTED) != 0) {
                        /* go to the default handler for other errors */
                        ide_error(drive, "cdrom_decode_status", stat);
                        return 1;
                 * If we got a CHECK_CONDITION status, queue
                 * a request sense command.
                 */
-               if (stat & ERR_STAT)
+               if (stat & ATA_ERR)
                        cdrom_queue_request_sense(drive, NULL, NULL);
        } else {
                blk_dump_rq_flags(rq, "ide-cd: bad rq");
        return 1;
 
 end_request:
-       if (stat & ERR_STAT) {
+       if (stat & ATA_ERR) {
                unsigned long flags;
 
                spin_lock_irqsave(&ide_lock, flags);
                 */
 
                /* check for errors */
-               if (cdrom_decode_status(drive, DRQ_STAT, NULL))
+               if (cdrom_decode_status(drive, ATA_DRQ, NULL))
                        return ide_stopped;
 
                /* ok, next interrupt will be DMA interrupt */
                        drive->waiting_for_dma = 1;
        } else {
                /* otherwise, we must wait for DRQ to get set */
-               if (ide_wait_stat(&startstop, drive, DRQ_STAT,
-                               BUSY_STAT, WAIT_READY))
+               if (ide_wait_stat(&startstop, drive, ATA_DRQ,
+                                 ATA_BUSY, WAIT_READY))
                        return startstop;
        }
 
                thislen = len;
 
        /* If DRQ is clear, the command has completed. */
-       if ((stat & DRQ_STAT) == 0) {
+       if ((stat & ATA_DRQ) == 0) {
                if (blk_fs_request(rq)) {
                        /*
                         * If we're not done reading/writing, complain.
                        unsigned long elapsed = jiffies - info->start_seek;
                        int stat = hwif->tp_ops->read_status(hwif);
 
-                       if ((stat & SEEK_STAT) != SEEK_STAT) {
+                       if ((stat & ATA_DSC) != ATA_DSC) {
                                if (elapsed < IDECD_SEEK_TIMEOUT) {
                                        ide_stall_queue(drive,
                                                        IDECD_SEEK_TIMER);
 
        dma_stat = hwif->dma_ops->dma_end(drive);
        stat = hwif->tp_ops->read_status(hwif);
 
-       if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) {
+       if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | ATA_DRQ)) {
                if (!dma_stat) {
                        struct request *rq = HWGROUP(drive)->rq;
 
 
                stat = hwif->tp_ops->read_status(hwif);
                local_irq_restore(flags);
 
-               progress_indication = ((stat & SEEK_STAT) == 0) ? 0 : 0x10000;
+               progress_indication = ((stat & ATA_DSC) == 0) ? 0 : 0x10000;
        }
        if (put_user(progress_indication, arg))
                return (-EFAULT);
 
                ide_task_t *task = (ide_task_t *)rq->special;
 
                if (rq->errors == 0)
-                       rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT);
+                       rq->errors = !OK_STAT(stat, ATA_DRDY, BAD_STAT);
 
                if (task) {
                        struct ide_taskfile *tf = &task->tf;
 {
        ide_hwif_t *hwif = drive->hwif;
 
-       if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) {
+       if ((stat & ATA_BUSY) || ((stat & ATA_DF) && !drive->nowerr)) {
                /* other bits are useless when BUSY */
                rq->errors |= ERROR_RESET;
-       } else if (stat & ERR_STAT) {
+       } else if (stat & ATA_ERR) {
                /* err has different meaning on cdrom and tape */
-               if (err == ABRT_ERR) {
+               if (err == ATA_ABORTED) {
                        if (drive->select.b.lba &&
                            /* some newer drives don't support ATA_CMD_INIT_DEV_PARAMS */
                            hwif->tp_ops->read_status(hwif) == ATA_CMD_INIT_DEV_PARAMS)
                } else if ((err & BAD_CRC) == BAD_CRC) {
                        /* UDMA crc error, just retry the operation */
                        drive->crc_count++;
-               } else if (err & (BBD_ERR | ECC_ERR)) {
+               } else if (err & (ATA_BBK | ATA_UNC)) {
                        /* retries won't help these */
                        rq->errors = ERROR_MAX;
-               } else if (err & TRK0_ERR) {
+               } else if (err & ATA_TRK0NF) {
                        /* help it find track zero */
                        rq->errors |= ERROR_RECAL;
                }
        }
 
-       if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ &&
+       if ((stat & ATA_DRQ) && rq_data_dir(rq) == READ &&
            (hwif->host_flags & IDE_HFLAG_ERROR_STOPS_FIFO) == 0) {
                int nsect = drive->mult_count ? drive->mult_count : 1;
 
                return ide_stopped;
        }
 
-       if (hwif->tp_ops->read_status(hwif) & (BUSY_STAT | DRQ_STAT))
+       if (hwif->tp_ops->read_status(hwif) & (ATA_BUSY | ATA_DRQ))
                rq->errors |= ERROR_RESET;
 
        if ((rq->errors & ERROR_RESET) == ERROR_RESET) {
 {
        ide_hwif_t *hwif = drive->hwif;
 
-       if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) {
+       if ((stat & ATA_BUSY) || ((stat & ATA_DF) && !drive->nowerr)) {
                /* other bits are useless when BUSY */
                rq->errors |= ERROR_RESET;
        } else {
                /* add decoding error stuff */
        }
 
-       if (hwif->tp_ops->read_status(hwif) & (BUSY_STAT | DRQ_STAT))
+       if (hwif->tp_ops->read_status(hwif) & (ATA_BUSY | ATA_DRQ))
                /* force an abort */
                hwif->tp_ops->exec_command(hwif, ATA_CMD_IDLEIMMEDIATE);
 
                ide_check_pm_state(drive, rq);
 
        SELECT_DRIVE(drive);
-       if (ide_wait_stat(&startstop, drive, drive->ready_stat, BUSY_STAT|DRQ_STAT, WAIT_READY)) {
+       if (ide_wait_stat(&startstop, drive, drive->ready_stat,
+                         ATA_BUSY | ATA_DRQ, WAIT_READY)) {
                printk(KERN_ERR "%s: drive not ready for command\n", drive->name);
                return startstop;
        }
                if (hwif->irq == irq) {
                        stat = hwif->tp_ops->read_status(hwif);
 
-                       if (!OK_STAT(stat, READY_STAT, BAD_STAT)) {
+                       if (!OK_STAT(stat, ATA_DRDY, BAD_STAT)) {
                                /* Try to not flood the console with msgs */
                                static unsigned long last_msgtime, count;
                                ++count;
 
                /* Note: this may clear a pending IRQ!! */
                stat = hwif->tp_ops->read_status(hwif);
 
-       if (stat & BUSY_STAT)
+       if (stat & ATA_BUSY)
                /* drive busy:  definitely not interrupting */
                return 0;
 
        udelay(1);      /* spec allows drive 400ns to assert "BUSY" */
        stat = tp_ops->read_status(hwif);
 
-       if (stat & BUSY_STAT) {
+       if (stat & ATA_BUSY) {
                local_irq_set(flags);
                timeout += jiffies;
-               while ((stat = tp_ops->read_status(hwif)) & BUSY_STAT) {
+               while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) {
                        if (time_after(jiffies, timeout)) {
                                /*
                                 * One last read after the timeout in case
                                 * progress during the timeout..
                                 */
                                stat = tp_ops->read_status(hwif);
-                               if (!(stat & BUSY_STAT))
+                               if ((stat & ATA_BUSY) == 0)
                                        break;
 
                                local_irq_restore(flags);
 
                msleep(50);     /* give drive a breather */
                stat = tp_ops->read_altstatus(hwif);
-       } while (stat & BUSY_STAT);
+       } while (stat & ATA_BUSY);
 
-       msleep(50);     /* wait for IRQ and DRQ_STAT */
+       msleep(50);     /* wait for IRQ and ATA_DRQ */
        stat = tp_ops->read_status(hwif);
 
-       if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) {
+       if (!OK_STAT(stat, ATA_DRQ, BAD_R_STAT)) {
                SELECT_MASK(drive, 0);
                printk("%s: CHECK for good STATUS\n", drive->name);
                return 0;
                tp_ops->set_irq(hwif, 1);
 
        error = __ide_wait_stat(drive, drive->ready_stat,
-                               BUSY_STAT|DRQ_STAT|ERR_STAT,
+                               ATA_BUSY | ATA_DRQ | ATA_ERR,
                                WAIT_CMD, &stat);
 
        SELECT_MASK(drive, 0);
        udelay (10);
        stat = hwif->tp_ops->read_status(hwif);
 
-       if (OK_STAT(stat, 0, BUSY_STAT))
+       if (OK_STAT(stat, 0, ATA_BUSY))
                printk("%s: ATAPI reset complete\n", drive->name);
        else {
                if (time_before(jiffies, hwgroup->poll_timeout)) {
 
        tmp = hwif->tp_ops->read_status(hwif);
 
-       if (!OK_STAT(tmp, 0, BUSY_STAT)) {
+       if (!OK_STAT(tmp, 0, ATA_BUSY)) {
                if (time_before(jiffies, hwgroup->poll_timeout)) {
                        ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL);
                        /* continue polling */
                 */
                mdelay(1);
                stat = hwif->tp_ops->read_status(hwif);
-               if ((stat & BUSY_STAT) == 0)
+               if ((stat & ATA_BUSY) == 0)
                        return 0;
                /*
                 * Assume a value of 0xff means nothing is connected to
 
 static void ide_dump_ata_error(ide_drive_t *drive, u8 err)
 {
        printk("{ ");
-       if (err & ABRT_ERR)     printk("DriveStatusError ");
-       if (err & ICRC_ERR)
-               printk((err & ABRT_ERR) ? "BadCRC " : "BadSector ");
-       if (err & ECC_ERR)      printk("UncorrectableError ");
-       if (err & ID_ERR)       printk("SectorIdNotFound ");
-       if (err & TRK0_ERR)     printk("TrackZeroNotFound ");
-       if (err & MARK_ERR)     printk("AddrMarkNotFound ");
+       if (err & ATA_ABORTED)  printk("DriveStatusError ");
+       if (err & ATA_ICRC)
+               printk((err & ATA_ABORTED) ? "BadCRC " : "BadSector ");
+       if (err & ATA_UNC)      printk("UncorrectableError ");
+       if (err & ATA_IDNF)     printk("SectorIdNotFound ");
+       if (err & ATA_TRK0NF)   printk("TrackZeroNotFound ");
+       if (err & ATA_AMNF)     printk("AddrMarkNotFound ");
        printk("}");
-       if ((err & (BBD_ERR | ABRT_ERR)) == BBD_ERR ||
-           (err & (ECC_ERR|ID_ERR|MARK_ERR))) {
+       if ((err & (ATA_BBK | ATA_ABORTED)) == ATA_BBK ||
+           (err & (ATA_UNC | ATA_IDNF | ATA_AMNF))) {
                ide_dump_sector(drive);
                if (HWGROUP(drive) && HWGROUP(drive)->rq)
                        printk(", sector=%llu",
 static void ide_dump_atapi_error(ide_drive_t *drive, u8 err)
 {
        printk("{ ");
-       if (err & ILI_ERR)      printk("IllegalLengthIndication ");
-       if (err & EOM_ERR)      printk("EndOfMedia ");
-       if (err & ABRT_ERR)     printk("AbortedCommand ");
-       if (err & MCR_ERR)      printk("MediaChangeRequested ");
-       if (err & LFS_ERR)      printk("LastFailedSense=0x%02x ",
-                                      (err & LFS_ERR) >> 4);
+       if (err & ATAPI_ILI)    printk("IllegalLengthIndication ");
+       if (err & ATAPI_EOM)    printk("EndOfMedia ");
+       if (err & ATA_ABORTED)  printk("AbortedCommand ");
+       if (err & ATA_MCR)      printk("MediaChangeRequested ");
+       if (err & ATAPI_LFS)    printk("LastFailedSense=0x%02x ",
+                                      (err & ATAPI_LFS) >> 4);
        printk("}\n");
 }
 
 
        local_irq_save(flags);
        printk("%s: %s: status=0x%02x { ", drive->name, msg, stat);
-       if (stat & BUSY_STAT)
+       if (stat & ATA_BUSY)
                printk("Busy ");
        else {
-               if (stat & READY_STAT)  printk("DriveReady ");
-               if (stat & WRERR_STAT)  printk("DeviceFault ");
-               if (stat & SEEK_STAT)   printk("SeekComplete ");
-               if (stat & DRQ_STAT)    printk("DataRequest ");
-               if (stat & ECC_STAT)    printk("CorrectedError ");
-               if (stat & INDEX_STAT)  printk("Index ");
-               if (stat & ERR_STAT)    printk("Error ");
+               if (stat & ATA_DRDY)    printk("DriveReady ");
+               if (stat & ATA_DF)      printk("DeviceFault ");
+               if (stat & ATA_DSC)     printk("SeekComplete ");
+               if (stat & ATA_DRQ)     printk("DataRequest ");
+               if (stat & ATA_CORR)    printk("CorrectedError ");
+               if (stat & ATA_IDX)     printk("Index ");
+               if (stat & ATA_ERR)     printk("Error ");
        }
        printk("}\n");
-       if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) {
+       if ((stat & (ATA_BUSY | ATA_ERR)) == ATA_ERR) {
                err = ide_read_error(drive);
                printk("%s: %s: error=0x%02x ", drive->name, msg, err);
                if (drive->media == ide_disk)
 
        if (io_ports->ctl_addr) {
                a = tp_ops->read_altstatus(hwif);
                s = tp_ops->read_status(hwif);
-               if ((a ^ s) & ~INDEX_STAT)
+               if ((a ^ s) & ~ATA_IDX)
                        /* ancient Seagate drives, broken interfaces */
                        printk(KERN_INFO "%s: probing with STATUS(0x%02x) "
                                         "instead of ALTSTATUS(0x%02x)\n",
                msleep(50);
                s = use_altstatus ? tp_ops->read_altstatus(hwif)
                                  : tp_ops->read_status(hwif);
-       } while (s & BUSY_STAT);
+       } while (s & ATA_BUSY);
 
-       /* wait for IRQ and DRQ_STAT */
+       /* wait for IRQ and ATA_DRQ */
        msleep(50);
        s = tp_ops->read_status(hwif);
 
-       if (OK_STAT(s, DRQ_STAT, BAD_R_STAT)) {
+       if (OK_STAT(s, ATA_DRQ, BAD_R_STAT)) {
                unsigned long flags;
 
                /* local CPU only; some systems need this */
        do {
                msleep(50);
                stat = hwif->tp_ops->read_status(hwif);
-               if ((stat & BUSY_STAT) == 0)
+               if ((stat & ATA_BUSY) == 0)
                        return 0;
        } while (time_before(jiffies, timeout));
 
                if (drive->select.b.unit != 0) {
                        /* exit with drive0 selected */
                        SELECT_DRIVE(&hwif->drives[0]);
-                       /* allow BUSY_STAT to assert & clear */
+                       /* allow ATA_BUSY to assert & clear */
                        msleep(50);
                }
                /* no i/f present: mmm.. this should be a 4 -ml */
 
        stat = tp_ops->read_status(hwif);
 
-       if (OK_STAT(stat, READY_STAT, BUSY_STAT) ||
+       if (OK_STAT(stat, ATA_DRDY, ATA_BUSY) ||
            drive->present || cmd == ATA_CMD_ID_ATAPI) {
                /* send cmd and wait */
                if ((rc = try_to_identify(drive, cmd))) {
 
                stat = tp_ops->read_status(hwif);
 
-               if (stat == (BUSY_STAT | READY_STAT))
+               if (stat == (ATA_BUSY | ATA_DRDY))
                        return 4;
 
                if (rc == 1 && cmd == ATA_CMD_ID_ATAPI) {
 
 
        stat = hwif->tp_ops->read_status(hwif);
 
-       if (stat & SEEK_STAT) {
-               if (stat & ERR_STAT) {
+       if (stat & ATA_DSC) {
+               if (stat & ATA_ERR) {
                        /* Error detected */
                        if (pc->c[0] != TEST_UNIT_READY)
                                printk(KERN_ERR "ide-tape: %s: I/O error, ",
        }
 
        if (!test_and_clear_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags) &&
-           (stat & SEEK_STAT) == 0) {
+           (stat & ATA_DSC) == 0) {
                if (postponed_rq == NULL) {
                        tape->dsc_polling_start = jiffies;
                        tape->dsc_poll_freq = tape->best_dsc_rw_freq;
 
        local_irq_enable_in_hardirq();
        stat = hwif->tp_ops->read_status(hwif);
 
-       if (OK_STAT(stat, READY_STAT, BAD_STAT))
+       if (OK_STAT(stat, ATA_DRDY, BAD_STAT))
                drive->mult_count = drive->mult_req;
        else {
                drive->mult_req = drive->mult_count = 0;
 
        while (1) {
                stat = hwif->tp_ops->read_status(hwif);
-               if ((stat & BUSY_STAT) == 0 || retries-- == 0)
+               if ((stat & ATA_BUSY) == 0 || retries-- == 0)
                        break;
                udelay(10);
        };
 
-       if (OK_STAT(stat, READY_STAT, BAD_STAT))
+       if (OK_STAT(stat, ATA_DRDY, BAD_STAT))
                return ide_stopped;
 
-       if (stat & (ERR_STAT|DRQ_STAT))
+       if (stat & (ATA_ERR | ATA_DRQ))
                return ide_error(drive, "set_geometry_intr", stat);
 
        ide_set_handler(drive, &set_geometry_intr, WAIT_WORSTCASE, NULL);
        local_irq_enable_in_hardirq();
        stat = hwif->tp_ops->read_status(hwif);
 
-       if (!OK_STAT(stat, READY_STAT, BAD_STAT))
+       if (!OK_STAT(stat, ATA_DRDY, BAD_STAT))
                return ide_error(drive, "recal_intr", stat);
        return ide_stopped;
 }
        local_irq_enable_in_hardirq();
        stat = hwif->tp_ops->read_status(hwif);
 
-       if (!OK_STAT(stat, READY_STAT, BAD_STAT))
+       if (!OK_STAT(stat, ATA_DRDY, BAD_STAT))
                return ide_error(drive, "task_no_data_intr", stat);
                /* calls ide_end_drive_cmd */
 
        for (retries = 0; retries < 1000; retries++) {
                stat = hwif->tp_ops->read_status(hwif);
 
-               if (stat & BUSY_STAT)
+               if (stat & ATA_BUSY)
                        udelay(10);
                else
                        break;
        }
 
-       if (stat & BUSY_STAT)
+       if (stat & ATA_BUSY)
                printk(KERN_ERR "%s: drive still BUSY!\n", drive->name);
 
        return stat;
 static ide_startstop_t task_in_unexpected(ide_drive_t *drive, struct request *rq, u8 stat)
 {
        /* Command all done? */
-       if (OK_STAT(stat, READY_STAT, BUSY_STAT)) {
+       if (OK_STAT(stat, ATA_DRDY, ATA_BUSY)) {
                task_end_request(drive, rq, stat);
                return ide_stopped;
        }
        u8 stat = hwif->tp_ops->read_status(hwif);
 
        /* Error? */
-       if (stat & ERR_STAT)
+       if (stat & ATA_ERR)
                return task_error(drive, rq, __func__, stat);
 
        /* Didn't want any data? Odd. */
-       if (!(stat & DRQ_STAT))
+       if ((stat & ATA_DRQ) == 0)
                return task_in_unexpected(drive, rq, stat);
 
        ide_pio_datablock(drive, rq, 0);
                return task_error(drive, rq, __func__, stat);
 
        /* Deal with unexpected ATA data phase. */
-       if (((stat & DRQ_STAT) == 0) ^ !hwif->nleft)
+       if (((stat & ATA_DRQ) == 0) ^ !hwif->nleft)
                return task_error(drive, rq, __func__, stat);
 
        if (!hwif->nleft) {
 {
        ide_startstop_t startstop;
 
-       if (ide_wait_stat(&startstop, drive, DRQ_STAT,
+       if (ide_wait_stat(&startstop, drive, ATA_DRQ,
                          drive->bad_wstat, WAIT_DRQ)) {
                printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n",
                                drive->name,
 
                drive->media                    = ide_disk;
                drive->select.all               = (unit<<4)|0xa0;
                drive->hwif                     = hwif;
-               drive->ready_stat               = READY_STAT;
+               drive->ready_stat               = ATA_DRDY;
                drive->bad_wstat                = BAD_W_STAT;
                drive->special.b.recalibrate    = 1;
                drive->special.b.set_geometry   = 1;
 static unsigned int ide_nowerr;
 
 module_param_call(nowerr, ide_set_dev_param_mask, NULL, &ide_nowerr, 0);
-MODULE_PARM_DESC(nowerr, "ignore the WRERR_STAT bit for a device");
+MODULE_PARM_DESC(nowerr, "ignore the ATA_DF bit for a device");
 
 static unsigned int ide_cdroms;
 
                drive->noprobe = 1;
        }
        if (ide_nowerr & (1 << i)) {
-               printk(KERN_INFO "ide: ignoring the WRERR_STAT bit for %s\n",
+               printk(KERN_INFO "ide: ignoring the ATA_DF bit for %s\n",
                                 drive->name);
                drive->bad_wstat = BAD_R_STAT;
        }
                                 drive->cyl, drive->head, drive->sect);
                drive->present = 1;
                drive->media = ide_disk;
-               drive->ready_stat = READY_STAT;
+               drive->ready_stat = ATA_DRDY;
        }
 }
 
 
                do {
                        udelay(50);
                        stat = hwif->tp_ops->read_status(hwif);
-                       if (stat == 0xff)
-                               break;
-               } while ((stat & BUSY_STAT) && --timeout);
+                       if (stat == 0xff)
+                               break;
+               } while ((stat & ATA_BUSY) && --timeout);
 #endif
        }
 
 
        /* errata A308 workaround: Step5 (check data loss) */
        /* We don't check non ide_disk because it is limited to UDMA4 */
        if (!(in_be32((void __iomem *)hwif->io_ports.ctl_addr)
-             & ERR_STAT) &&
+             & ATA_ERR) &&
            drive->media == ide_disk && drive->current_speed > XFER_UDMA_4) {
                reg = in_be32((void __iomem *)intsts_port);
                if (!(reg & INTSTS_ACTEINT)) {
 
        /* SCC errata A252,A308 workaround: Step4 */
        if ((in_be32((void __iomem *)hwif->io_ports.ctl_addr)
-            & ERR_STAT) &&
+            & ATA_ERR) &&
            (int_stat & INTSTS_INTRQ))
                return 1;
 
 
 {
        ide_hwif_t *hwif = drive->hwif;
 
-       if (hwif->tp_ops->read_status(hwif) & (BUSY_STAT | DRQ_STAT))
+       if (hwif->tp_ops->read_status(hwif) & (ATA_BUSY | ATA_DRQ))
                /* force an abort */
                hwif->tp_ops->exec_command(hwif, ATA_CMD_IDLEIMMEDIATE);
 
 
 };
 
 #define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good))
-#define BAD_R_STAT             (BUSY_STAT   | ERR_STAT)
-#define BAD_W_STAT             (BAD_R_STAT  | WRERR_STAT)
-#define BAD_STAT               (BAD_R_STAT  | DRQ_STAT)
-#define DRIVE_READY            (READY_STAT  | SEEK_STAT)
 
-#define BAD_CRC                        (ABRT_ERR    | ICRC_ERR)
+#define BAD_R_STAT     (ATA_BUSY | ATA_ERR)
+#define BAD_W_STAT     (BAD_R_STAT | ATA_DF)
+#define BAD_STAT       (BAD_R_STAT | ATA_DRQ)
+#define DRIVE_READY    (ATA_DRDY | ATA_DSC)
+
+#define BAD_CRC                (ATA_ABORTED | ATA_ICRC)
 
 #define SATA_NR_PORTS          (3)     /* 16 possible ?? */
 
        u8      mult_req;       /* requested multiple sector setting */
        u8      tune_req;       /* requested drive tuning setting */
        u8      io_32bit;       /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */
-       u8      bad_wstat;      /* used for ignoring WRERR_STAT */
-       u8      nowerr;         /* used for ignoring WRERR_STAT */
+       u8      bad_wstat;      /* used for ignoring ATA_DF */
+       u8      nowerr;         /* used for ignoring ATA_DF */
        u8      sect0;          /* offset of first sector for DM6:DDO */
        u8      head;           /* "real" number of heads */
        u8      sect;           /* "real" sectors per track */