Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82558
b: refs/heads/master
c: 7704ca2
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Feb 2, 2008
1 parent 5740c58 commit 07caf1e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 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: 909f4369bca30f9a186316a3bf2b4a9c1e702a25
refs/heads/master: 7704ca2a3ee4b3690c5dcc99ea4f8dcf10d7bbdb
32 changes: 17 additions & 15 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,22 @@ static void hwif_register_devices(ide_hwif_t *hwif)
}
}

static void ide_port_init_devices(ide_hwif_t *hwif)
{
int i;

for (i = 0; i < MAX_DRIVES; i++) {
ide_drive_t *drive = &hwif->drives[i];

if (hwif->host_flags & IDE_HFLAG_IO_32BIT)
drive->io_32bit = 1;
if (hwif->host_flags & IDE_HFLAG_UNMASK_IRQS)
drive->unmask = 1;
if ((hwif->host_flags & IDE_HFLAG_NO_AUTOTUNE) == 0)
drive->autotune = 1;
}
}

static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
const struct ide_port_info *d)
{
Expand All @@ -1314,16 +1330,6 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
if ((d->host_flags & IDE_HFLAG_SERIALIZE) && hwif->mate)
hwif->mate->serialized = hwif->serialized = 1;

if (d->host_flags & IDE_HFLAG_IO_32BIT) {
hwif->drives[0].io_32bit = 1;
hwif->drives[1].io_32bit = 1;
}

if (d->host_flags & IDE_HFLAG_UNMASK_IRQS) {
hwif->drives[0].unmask = 1;
hwif->drives[1].unmask = 1;
}

hwif->swdma_mask = d->swdma_mask;
hwif->mwdma_mask = d->mwdma_mask;
hwif->ultra_mask = d->udma_mask;
Expand All @@ -1332,11 +1338,6 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;

if ((d->host_flags & IDE_HFLAG_NO_AUTOTUNE) == 0) {
hwif->drives[0].autotune = 1;
hwif->drives[1].autotune = 1;
}

if (d->host_flags & IDE_HFLAG_RQSIZE_256)
hwif->rqsize = 256;

Expand Down Expand Up @@ -1371,6 +1372,7 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
mate = (i & 1) ? NULL : hwif;

ide_init_port(hwif, i & 1, d);
ide_port_init_devices(hwif);
}

for (i = 0; i < MAX_HWIFS; i++) {
Expand Down

0 comments on commit 07caf1e

Please sign in to comment.