Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104999
b: refs/heads/master
c: 1f6d8a0
h: refs/heads/master
i:
  104997: eacb05e
  104995: 0a769bb
  104991: 1c3c8cb
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 23, 2008
1 parent 577eeb4 commit 0897715
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b73c7ee25da6133f97f47ffd3557288417da7c76
refs/heads/master: 1f6d8a0fd8f6cc5ee2219a8cf9b2da16dfd67397
13 changes: 11 additions & 2 deletions trunk/drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ static u8 ide_read_status(ide_hwif_t *hwif)
return inb(hwif->io_ports.status_addr);
}

static u8 ide_read_altstatus(ide_hwif_t *hwif)
{
if (hwif->host_flags & IDE_HFLAG_MMIO)
return readb((void __iomem *)hwif->io_ports.ctl_addr);
else
return inb(hwif->io_ports.ctl_addr);
}

static u8 ide_read_sff_dma_status(ide_hwif_t *hwif)
{
if (hwif->host_flags & IDE_HFLAG_MMIO)
Expand Down Expand Up @@ -349,6 +357,7 @@ void default_hwif_transport(ide_hwif_t *hwif)
{
hwif->exec_command = ide_exec_command;
hwif->read_status = ide_read_status;
hwif->read_altstatus = ide_read_altstatus;
hwif->read_sff_dma_status = ide_read_sff_dma_status;

hwif->tf_load = ide_tf_load;
Expand Down Expand Up @@ -511,7 +520,7 @@ int drive_is_ready (ide_drive_t *drive)
* about possible isa-pnp and pci-pnp issues yet.
*/
if (hwif->io_ports.ctl_addr)
stat = ide_read_altstatus(drive);
stat = hwif->read_altstatus(hwif);
else
/* Note: this may clear a pending IRQ!! */
stat = hwif->read_status(hwif);
Expand Down Expand Up @@ -724,7 +733,7 @@ int ide_driveid_update(ide_drive_t *drive)
}

msleep(50); /* give drive a breather */
stat = ide_read_altstatus(drive);
stat = hwif->read_altstatus(hwif);
} while (stat & BUSY_STAT);

msleep(50); /* wait for IRQ and DRQ_STAT */
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
msleep(50);

if (io_ports->ctl_addr) {
a = ide_read_altstatus(drive);
a = hwif->read_altstatus(hwif);
s = hwif->read_status(hwif);
if ((a ^ s) & ~INDEX_STAT)
/* ancient Seagate drives, broken interfaces */
Expand Down Expand Up @@ -306,7 +306,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
}
/* give drive a breather */
msleep(50);
s = use_altstatus ? ide_read_altstatus(drive)
s = use_altstatus ? hwif->read_altstatus(hwif)
: hwif->read_status(hwif);
} while (s & BUSY_STAT);

Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/ide/pci/scc_pata.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ static u8 scc_read_status(ide_hwif_t *hwif)
return (u8)in_be32((void *)hwif->io_ports.status_addr);
}

static u8 scc_read_altstatus(ide_hwif_t *hwif)
{
return (u8)in_be32((void *)hwif->io_ports.ctl_addr);
}

static u8 scc_read_sff_dma_status(ide_hwif_t *hwif)
{
return (u8)in_be32((void *)(hwif->dma_base + 4));
Expand Down Expand Up @@ -794,6 +799,7 @@ static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif)

hwif->exec_command = scc_exec_command;
hwif->read_status = scc_read_status;
hwif->read_altstatus = scc_read_altstatus;
hwif->read_sff_dma_status = scc_read_sff_dma_status;

hwif->tf_load = scc_tf_load;
Expand Down
8 changes: 1 addition & 7 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ typedef struct hwif_s {

void (*exec_command)(struct hwif_s *, u8);
u8 (*read_status)(struct hwif_s *);
u8 (*read_altstatus)(struct hwif_s *);
u8 (*read_sff_dma_status)(struct hwif_s *);

void (*tf_load)(ide_drive_t *, struct ide_task_s *);
Expand Down Expand Up @@ -1363,13 +1364,6 @@ static inline void ide_set_irq(ide_drive_t *drive, int on)
hwif->io_ports.ctl_addr);
}

static inline u8 ide_read_altstatus(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;

return hwif->INB(hwif->io_ports.ctl_addr);
}

static inline u8 ide_read_error(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
Expand Down

0 comments on commit 0897715

Please sign in to comment.