Deleted Added
full compact
28c28
< * $FreeBSD: head/sys/dev/ata/ata-all.c 66698 2000-10-05 23:09:57Z jhb $
---
> * $FreeBSD: head/sys/dev/ata/ata-all.c 67058 2000-10-13 11:21:27Z sos $
133c133
< scp->unit = device_get_unit(dev);
---
> scp->channel = 0;
180c180
< scp->unit = device_get_unit(dev);
---
> scp->channel = 0;
371d370
< device_set_ivars(child, (void *)(uintptr_t) unit);
397,398c396,397
< device_printf(dev, "Busmastering DMA %s\n",
< sc->bmio ? "enabled" : "not supported");
---
> if (!sc->bmio)
> device_printf(dev, "Busmastering DMA not supported\n");
495d493
< int unit = (uintptr_t) device_get_ivars(child);
502c500
< retval += printf(" irq %d", 14 + unit);
---
> retval += printf(" irq %d", 14 + scp->channel);
514c512
< int unit = (intptr_t)device_get_ivars(child);
---
> int channel = ((struct ata_softc *)device_get_softc(child))->channel;
522c520
< start = (unit == 0 ? IO_WD1 : IO_WD2);
---
> start = (channel == 0 ? IO_WD1 : IO_WD2);
527c525
< myrid = 0x10 + 8 * unit;
---
> myrid = 0x10 + 8 * channel;
533c531
< start = (unit == 0 ? IO_WD1 : IO_WD2) + ATA_ALTOFFSET;
---
> start = (channel == 0 ? IO_WD1 : IO_WD2) + ATA_ALTOFFSET;
538c536
< myrid = 0x14 + 8 * unit;
---
> myrid = 0x14 + 8 * channel;
544c542
< if (unit == 0) {
---
> if (channel == 0) {
579c577
< return alpha_platform_alloc_ide_intr(unit);
---
> return alpha_platform_alloc_ide_intr(channel);
581c579
< int irq = (unit == 0 ? 14 : 15);
---
> int irq = (channel == 0 ? 14 : 15);
604c602
< int unit = (uintptr_t) device_get_ivars(child);
---
> int channel = ((struct ata_softc *)device_get_softc(child))->channel;
613c611
< myrid = 0x10 + 8 * unit;
---
> myrid = 0x10 + 8 * channel;
620c618
< myrid = 0x14 + 8 * unit;
---
> myrid = 0x14 + 8 * channel;
645c643
< return alpha_platform_release_ide_intr(unit, r);
---
> return alpha_platform_release_ide_intr(channel, r);
725a724,725
> device_t *list;
> int count, i;
727,728c727,733
< /* kids of pci ata chipsets has their physical unit number in ivars */
< scp->unit = (uintptr_t) device_get_ivars(dev);
---
> /* find channel number on this controller */
> device_get_children(device_get_parent(dev), &list, &count);
> for (i = 0; i < count; i++) {
> if (list[i] == dev)
> scp->channel = i;
> }
>
729a735,742
>
> /* is this an ATA RAID setup ? */
> if (((pci_get_subclass(device_get_parent(dev)) == PCIS_STORAGE_RAID) &&
> (scp->chiptype == 0x4d33105a || scp->chiptype == 0x4d38105a ||
> scp->chiptype == 0x4d30105a || scp->chiptype == 0x0d30105a)) ||
> scp->chiptype == 0x00041103) {
> scp->flags |= ATA_RAID;
> }
1085c1098
< (scp->unit ? 0x08 : 0x04)))
---
> (scp->channel ? 0x08 : 0x04)))
1094c1107
< (scp->unit ? 0x00004000 : 0x00000400)))
---
> (scp->channel ? 0x00004000 : 0x00000400)))