aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:12 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:12 -0500
commit0e38a66a1e69821ab57a06d5a7b11f0df9275bf4 (patch)
treee287752203edfe30f3bdc5966eb8f4c91b508c45
parent22c525b976778cce5bb6f8fdcc70046168c54b1a (diff)
ide: remove atapi_error_t (take 2)
Remove atapi_error_t. While at it: * replace 'HWIF(drive)' by 'drive->hwif' v2: * Add {ILI,EOM,LFS}_ERR defines to <linux/hdreg.h>. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-floppy.c3
-rw-r--r--drivers/ide/ide-lib.c21
-rw-r--r--drivers/ide/ide-tape.c3
-rw-r--r--include/linux/hdreg.h3
-rw-r--r--include/linux/ide.h30
5 files changed, 15 insertions, 45 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 7b94c7aff256..2a37a08ddd57 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -772,9 +772,8 @@ static void idefloppy_retry_pc (ide_drive_t *drive)
772{ 772{
773 idefloppy_pc_t *pc; 773 idefloppy_pc_t *pc;
774 struct request *rq; 774 struct request *rq;
775 atapi_error_t error;
776 775
777 error.all = HWIF(drive)->INB(IDE_ERROR_REG); 776 (void)drive->hwif->INB(IDE_ERROR_REG);
778 pc = idefloppy_next_pc_storage(drive); 777 pc = idefloppy_next_pc_storage(drive);
779 rq = idefloppy_next_rq_storage(drive); 778 rq = idefloppy_next_rq_storage(drive);
780 idefloppy_create_request_sense_cmd(pc); 779 idefloppy_create_request_sense_cmd(pc);
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index dc7e539b4d0b..562f5efae9c6 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -562,9 +562,8 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat)
562static u8 ide_dump_atapi_status(ide_drive_t *drive, const char *msg, u8 stat) 562static u8 ide_dump_atapi_status(ide_drive_t *drive, const char *msg, u8 stat)
563{ 563{
564 unsigned long flags; 564 unsigned long flags;
565 atapi_error_t error; 565 u8 err = 0;
566 566
567 error.all = 0;
568 local_irq_save(flags); 567 local_irq_save(flags);
569 printk("%s: %s: status=0x%02x { ", drive->name, msg, stat); 568 printk("%s: %s: status=0x%02x { ", drive->name, msg, stat);
570 if (stat & BUSY_STAT) 569 if (stat & BUSY_STAT)
@@ -580,19 +579,19 @@ static u8 ide_dump_atapi_status(ide_drive_t *drive, const char *msg, u8 stat)
580 } 579 }
581 printk("}\n"); 580 printk("}\n");
582 if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { 581 if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) {
583 error.all = HWIF(drive)->INB(IDE_ERROR_REG); 582 err = drive->hwif->INB(IDE_ERROR_REG);
584 printk("%s: %s: error=0x%02x { ", drive->name, msg, error.all); 583 printk("%s: %s: error=0x%02x { ", drive->name, msg, err);
585 if (error.b.ili) printk("IllegalLengthIndication "); 584 if (err & ILI_ERR) printk("IllegalLengthIndication ");
586 if (error.b.eom) printk("EndOfMedia "); 585 if (err & EOM_ERR) printk("EndOfMedia ");
587 if (error.b.abrt) printk("AbortedCommand "); 586 if (err & ABRT_ERR) printk("AbortedCommand ");
588 if (error.b.mcr) printk("MediaChangeRequested "); 587 if (err & MCR_ERR) printk("MediaChangeRequested ");
589 if (error.b.sense_key) printk("LastFailedSense=0x%02x ", 588 if (err & LFS_ERR) printk("LastFailedSense=0x%02x ",
590 error.b.sense_key); 589 (err & LFS_ERR) >> 4);
591 printk("}\n"); 590 printk("}\n");
592 } 591 }
593 ide_dump_opcode(drive); 592 ide_dump_opcode(drive);
594 local_irq_restore(flags); 593 local_irq_restore(flags);
595 return error.all; 594 return err;
596} 595}
597 596
598/** 597/**
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index c91039505436..2c03f469f06e 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1808,9 +1808,8 @@ static ide_startstop_t idetape_retry_pc (ide_drive_t *drive)
1808 idetape_tape_t *tape = drive->driver_data; 1808 idetape_tape_t *tape = drive->driver_data;
1809 idetape_pc_t *pc; 1809 idetape_pc_t *pc;
1810 struct request *rq; 1810 struct request *rq;
1811 atapi_error_t error;
1812 1811
1813 error.all = HWIF(drive)->INB(IDE_ERROR_REG); 1812 (void)drive->hwif->INB(IDE_ERROR_REG);
1814 pc = idetape_next_pc_storage(drive); 1813 pc = idetape_next_pc_storage(drive);
1815 rq = idetape_next_rq_storage(drive); 1814 rq = idetape_next_rq_storage(drive);
1816 idetape_create_request_sense_cmd(pc); 1815 idetape_create_request_sense_cmd(pc);
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h
index df17bf767d98..0521f1234f15 100644
--- a/include/linux/hdreg.h
+++ b/include/linux/hdreg.h
@@ -44,7 +44,9 @@
44 44
45/* Bits for HD_ERROR */ 45/* Bits for HD_ERROR */
46#define MARK_ERR 0x01 /* Bad address mark */ 46#define MARK_ERR 0x01 /* Bad address mark */
47#define ILI_ERR 0x01 /* Illegal Length Indication (ATAPI) */
47#define TRK0_ERR 0x02 /* couldn't find track 0 */ 48#define TRK0_ERR 0x02 /* couldn't find track 0 */
49#define EOM_ERR 0x02 /* End Of Media (ATAPI) */
48#define ABRT_ERR 0x04 /* Command aborted */ 50#define ABRT_ERR 0x04 /* Command aborted */
49#define MCR_ERR 0x08 /* media change request */ 51#define MCR_ERR 0x08 /* media change request */
50#define ID_ERR 0x10 /* ID field not found */ 52#define ID_ERR 0x10 /* ID field not found */
@@ -52,6 +54,7 @@
52#define ECC_ERR 0x40 /* Uncorrectable ECC error */ 54#define ECC_ERR 0x40 /* Uncorrectable ECC error */
53#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */ 55#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */
54#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */ 56#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */
57#define LFS_ERR 0xf0 /* Last Failed Sense (ATAPI) */
55 58
56/* Bits of HD_NSECTOR */ 59/* Bits of HD_NSECTOR */
57#define CD 0x01 60#define CD 0x01
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 921cf717f22a..0c1b0aaa2865 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -417,36 +417,6 @@ typedef union {
417} atapi_ireason_t; 417} atapi_ireason_t;
418 418
419/* 419/*
420 * The ATAPI error register.
421 *
422 * ili : Illegal Length Indication
423 * eom : End Of Media Detected
424 * abrt : Aborted command - As defined by ATA
425 * mcr : Media Change Requested - As defined by ATA
426 * sense_key : Sense key of the last failed packet command
427 */
428typedef union {
429 unsigned all :8;
430 struct {
431#if defined(__LITTLE_ENDIAN_BITFIELD)
432 unsigned ili :1;
433 unsigned eom :1;
434 unsigned abrt :1;
435 unsigned mcr :1;
436 unsigned sense_key :4;
437#elif defined(__BIG_ENDIAN_BITFIELD)
438 unsigned sense_key :4;
439 unsigned mcr :1;
440 unsigned abrt :1;
441 unsigned eom :1;
442 unsigned ili :1;
443#else
444#error "Please fix <asm/byteorder.h>"
445#endif
446 } b;
447} atapi_error_t;
448
449/*
450 * Status returned from various ide_ functions 420 * Status returned from various ide_ functions
451 */ 421 */
452typedef enum { 422typedef enum {