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
commit3a7d24841ad794ae64c90d7d00d62a83741912aa (patch)
treed71a36678fa88ed1e0b279390b6169f5018186bf /drivers/ide/ide-taskfile.c
parentf26b3d75959e9a0e43a2e1e1148c075592746c3d (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>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c26
1 files changed, 13 insertions, 13 deletions
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)
390static ide_startstop_t task_in_unexpected(ide_drive_t *drive, struct request *rq, u8 stat) 390static 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,