aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-27 13:13:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-27 13:13:06 -0400
commitfba5c1af5c4fd6645fe62ea84ccde0981282cf66 (patch)
tree834022eb683e0badd5a1e5eb5957f74c0e69ebb4 /drivers/ide/ide-io.c
parentf222eba0f9d98376d363b51fcc2361fb56929844 (diff)
parent077e3bdb9ec34d7cb5751b5be81a4a0f6f0eb5dc (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (49 commits) ide-tape: remove tape->merge_stage ide-tape: mv tape->merge_stage_size tape->merge_bh_size ide-tape: mv idetape_empty_write_pipeline ide_tape_flush_merge_buffer ide-tape: mv idetape_discard_read_pipeline ide_tape_discard_merge_buffer ide-tape: make __idetape_discard_read_pipeline() of type void ide: remove now unused ide_pci_create_host_proc() ide: remove /proc/ide/ali ide-tape: improve buffer pages freeing strategy ide-tape: mv tape->pages_per_stage tape->pages_per_buffer ide-tape: mv tape->stage_size tape->buffer_size ide-tape: improve buffer allocation strategy ide: add struct ide_io_ports (take 3) ide: make ide_unregister() take 'ide_hwif_t *' as an argument (take 2) ide: sanitize ide_unregister() usage mpc8xx-ide: use ide_find_port() ide: add "noacpi" / "acpigtf" / "acpionboot" parameters gayle: add "doubler" parameter ide: add "cdrom=" and "chs=" parameters ide: add "nodma|noflush|noprobe|nowerr=" parameters ide: remove obsoleted "hdx=autotune" kernel parameter ...
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 0fe89a599275..3a2d8930d17f 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -298,48 +298,43 @@ static void ide_complete_pm_request (ide_drive_t *drive, struct request *rq)
298void ide_tf_read(ide_drive_t *drive, ide_task_t *task) 298void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
299{ 299{
300 ide_hwif_t *hwif = drive->hwif; 300 ide_hwif_t *hwif = drive->hwif;
301 struct ide_io_ports *io_ports = &hwif->io_ports;
301 struct ide_taskfile *tf = &task->tf; 302 struct ide_taskfile *tf = &task->tf;
302 303
303 if (task->tf_flags & IDE_TFLAG_IN_DATA) { 304 if (task->tf_flags & IDE_TFLAG_IN_DATA) {
304 u16 data = hwif->INW(hwif->io_ports[IDE_DATA_OFFSET]); 305 u16 data = hwif->INW(io_ports->data_addr);
305 306
306 tf->data = data & 0xff; 307 tf->data = data & 0xff;
307 tf->hob_data = (data >> 8) & 0xff; 308 tf->hob_data = (data >> 8) & 0xff;
308 } 309 }
309 310
310 /* be sure we're looking at the low order bits */ 311 /* be sure we're looking at the low order bits */
311 hwif->OUTB(drive->ctl & ~0x80, hwif->io_ports[IDE_CONTROL_OFFSET]); 312 hwif->OUTB(drive->ctl & ~0x80, io_ports->ctl_addr);
312 313
313 if (task->tf_flags & IDE_TFLAG_IN_NSECT) 314 if (task->tf_flags & IDE_TFLAG_IN_NSECT)
314 tf->nsect = hwif->INB(hwif->io_ports[IDE_NSECTOR_OFFSET]); 315 tf->nsect = hwif->INB(io_ports->nsect_addr);
315 if (task->tf_flags & IDE_TFLAG_IN_LBAL) 316 if (task->tf_flags & IDE_TFLAG_IN_LBAL)
316 tf->lbal = hwif->INB(hwif->io_ports[IDE_SECTOR_OFFSET]); 317 tf->lbal = hwif->INB(io_ports->lbal_addr);
317 if (task->tf_flags & IDE_TFLAG_IN_LBAM) 318 if (task->tf_flags & IDE_TFLAG_IN_LBAM)
318 tf->lbam = hwif->INB(hwif->io_ports[IDE_LCYL_OFFSET]); 319 tf->lbam = hwif->INB(io_ports->lbam_addr);
319 if (task->tf_flags & IDE_TFLAG_IN_LBAH) 320 if (task->tf_flags & IDE_TFLAG_IN_LBAH)
320 tf->lbah = hwif->INB(hwif->io_ports[IDE_HCYL_OFFSET]); 321 tf->lbah = hwif->INB(io_ports->lbah_addr);
321 if (task->tf_flags & IDE_TFLAG_IN_DEVICE) 322 if (task->tf_flags & IDE_TFLAG_IN_DEVICE)
322 tf->device = hwif->INB(hwif->io_ports[IDE_SELECT_OFFSET]); 323 tf->device = hwif->INB(io_ports->device_addr);
323 324
324 if (task->tf_flags & IDE_TFLAG_LBA48) { 325 if (task->tf_flags & IDE_TFLAG_LBA48) {
325 hwif->OUTB(drive->ctl | 0x80, 326 hwif->OUTB(drive->ctl | 0x80, io_ports->ctl_addr);
326 hwif->io_ports[IDE_CONTROL_OFFSET]);
327 327
328 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) 328 if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
329 tf->hob_feature = 329 tf->hob_feature = hwif->INB(io_ports->feature_addr);
330 hwif->INB(hwif->io_ports[IDE_FEATURE_OFFSET]);
331 if (task->tf_flags & IDE_TFLAG_IN_HOB_NSECT) 330 if (task->tf_flags & IDE_TFLAG_IN_HOB_NSECT)
332 tf->hob_nsect = 331 tf->hob_nsect = hwif->INB(io_ports->nsect_addr);
333 hwif->INB(hwif->io_ports[IDE_NSECTOR_OFFSET]);
334 if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAL) 332 if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAL)
335 tf->hob_lbal = 333 tf->hob_lbal = hwif->INB(io_ports->lbal_addr);
336 hwif->INB(hwif->io_ports[IDE_SECTOR_OFFSET]);
337 if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAM) 334 if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAM)
338 tf->hob_lbam = 335 tf->hob_lbam = hwif->INB(io_ports->lbam_addr);
339 hwif->INB(hwif->io_ports[IDE_LCYL_OFFSET]);
340 if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAH) 336 if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAH)
341 tf->hob_lbah = 337 tf->hob_lbah = hwif->INB(io_ports->lbah_addr);
342 hwif->INB(hwif->io_ports[IDE_HCYL_OFFSET]);
343 } 338 }
344} 339}
345 340
@@ -454,7 +449,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8
454 if (err == ABRT_ERR) { 449 if (err == ABRT_ERR) {
455 if (drive->select.b.lba && 450 if (drive->select.b.lba &&
456 /* some newer drives don't support WIN_SPECIFY */ 451 /* some newer drives don't support WIN_SPECIFY */
457 hwif->INB(hwif->io_ports[IDE_COMMAND_OFFSET]) == 452 hwif->INB(hwif->io_ports.command_addr) ==
458 WIN_SPECIFY) 453 WIN_SPECIFY)
459 return ide_stopped; 454 return ide_stopped;
460 } else if ((err & BAD_CRC) == BAD_CRC) { 455 } else if ((err & BAD_CRC) == BAD_CRC) {
@@ -507,8 +502,7 @@ static ide_startstop_t ide_atapi_error(ide_drive_t *drive, struct request *rq, u
507 502
508 if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT)) 503 if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT))
509 /* force an abort */ 504 /* force an abort */
510 hwif->OUTB(WIN_IDLEIMMEDIATE, 505 hwif->OUTB(WIN_IDLEIMMEDIATE, hwif->io_ports.command_addr);
511 hwif->io_ports[IDE_COMMAND_OFFSET]);
512 506
513 if (rq->errors >= ERROR_MAX) { 507 if (rq->errors >= ERROR_MAX) {
514 ide_kill_rq(drive, rq); 508 ide_kill_rq(drive, rq);
@@ -1421,7 +1415,7 @@ static void unexpected_intr (int irq, ide_hwgroup_t *hwgroup)
1421 */ 1415 */
1422 do { 1416 do {
1423 if (hwif->irq == irq) { 1417 if (hwif->irq == irq) {
1424 stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); 1418 stat = hwif->INB(hwif->io_ports.status_addr);
1425 if (!OK_STAT(stat, READY_STAT, BAD_STAT)) { 1419 if (!OK_STAT(stat, READY_STAT, BAD_STAT)) {
1426 /* Try to not flood the console with msgs */ 1420 /* Try to not flood the console with msgs */
1427 static unsigned long last_msgtime, count; 1421 static unsigned long last_msgtime, count;
@@ -1511,7 +1505,7 @@ irqreturn_t ide_intr (int irq, void *dev_id)
1511 * Whack the status register, just in case 1505 * Whack the status register, just in case
1512 * we have a leftover pending IRQ. 1506 * we have a leftover pending IRQ.
1513 */ 1507 */
1514 (void) hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); 1508 (void) hwif->INB(hwif->io_ports.status_addr);
1515#endif /* CONFIG_BLK_DEV_IDEPCI */ 1509#endif /* CONFIG_BLK_DEV_IDEPCI */
1516 } 1510 }
1517 spin_unlock_irqrestore(&ide_lock, flags); 1511 spin_unlock_irqrestore(&ide_lock, flags);