aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h29
1 files changed, 9 insertions, 20 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 2eb99cab4a3d..3b691cce00e1 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -82,24 +82,10 @@ typedef unsigned char byte; /* used everywhere */
82 82
83#define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET 83#define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET
84#define IDE_COMMAND_OFFSET IDE_STATUS_OFFSET 84#define IDE_COMMAND_OFFSET IDE_STATUS_OFFSET
85 85#define IDE_ALTSTATUS_OFFSET IDE_CONTROL_OFFSET
86#define IDE_DATA_REG (HWIF(drive)->io_ports[IDE_DATA_OFFSET]) 86#define IDE_IREASON_OFFSET IDE_NSECTOR_OFFSET
87#define IDE_ERROR_REG (HWIF(drive)->io_ports[IDE_ERROR_OFFSET]) 87#define IDE_BCOUNTL_OFFSET IDE_LCYL_OFFSET
88#define IDE_NSECTOR_REG (HWIF(drive)->io_ports[IDE_NSECTOR_OFFSET]) 88#define IDE_BCOUNTH_OFFSET IDE_HCYL_OFFSET
89#define IDE_SECTOR_REG (HWIF(drive)->io_ports[IDE_SECTOR_OFFSET])
90#define IDE_LCYL_REG (HWIF(drive)->io_ports[IDE_LCYL_OFFSET])
91#define IDE_HCYL_REG (HWIF(drive)->io_ports[IDE_HCYL_OFFSET])
92#define IDE_SELECT_REG (HWIF(drive)->io_ports[IDE_SELECT_OFFSET])
93#define IDE_STATUS_REG (HWIF(drive)->io_ports[IDE_STATUS_OFFSET])
94#define IDE_CONTROL_REG (HWIF(drive)->io_ports[IDE_CONTROL_OFFSET])
95#define IDE_IRQ_REG (HWIF(drive)->io_ports[IDE_IRQ_OFFSET])
96
97#define IDE_FEATURE_REG IDE_ERROR_REG
98#define IDE_COMMAND_REG IDE_STATUS_REG
99#define IDE_ALTSTATUS_REG IDE_CONTROL_REG
100#define IDE_IREASON_REG IDE_NSECTOR_REG
101#define IDE_BCOUNTL_REG IDE_LCYL_REG
102#define IDE_BCOUNTH_REG IDE_HCYL_REG
103 89
104#define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) 90#define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good))
105#define BAD_R_STAT (BUSY_STAT | ERR_STAT) 91#define BAD_R_STAT (BUSY_STAT | ERR_STAT)
@@ -369,7 +355,7 @@ typedef struct ide_drive_s {
369 u8 wcache; /* status of write cache */ 355 u8 wcache; /* status of write cache */
370 u8 acoustic; /* acoustic management */ 356 u8 acoustic; /* acoustic management */
371 u8 media; /* disk, cdrom, tape, floppy, ... */ 357 u8 media; /* disk, cdrom, tape, floppy, ... */
372 u8 ctl; /* "normal" value for IDE_CONTROL_REG */ 358 u8 ctl; /* "normal" value for Control register */
373 u8 ready_stat; /* min status value for drive ready */ 359 u8 ready_stat; /* min status value for drive ready */
374 u8 mult_count; /* current multiple sector setting */ 360 u8 mult_count; /* current multiple sector setting */
375 u8 mult_req; /* requested multiple sector setting */ 361 u8 mult_req; /* requested multiple sector setting */
@@ -1273,7 +1259,10 @@ static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
1273 1259
1274static inline void ide_set_irq(ide_drive_t *drive, int on) 1260static inline void ide_set_irq(ide_drive_t *drive, int on)
1275{ 1261{
1276 drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG); 1262 ide_hwif_t *hwif = drive->hwif;
1263
1264 hwif->OUTB(drive->ctl | (on ? 0 : 2),
1265 hwif->io_ports[IDE_CONTROL_OFFSET]);
1277} 1266}
1278 1267
1279static inline u8 ide_read_status(ide_drive_t *drive) 1268static inline u8 ide_read_status(ide_drive_t *drive)