summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2004-04-27 12:54:59 +0000
committersos <sos@FreeBSD.org>2004-04-27 12:54:59 +0000
commit18295a0f2ed43821c4d4b3d88ca5e34fa2168138 (patch)
treee005a991d91b180f66c0770365bf46ec9d167c65 /sys/dev/ata
parent2f4f821770e5da4c08af37ec655e02ea3ee63233 (diff)
downloadFreeBSD-src-18295a0f2ed43821c4d4b3d88ca5e34fa2168138.zip
FreeBSD-src-18295a0f2ed43821c4d4b3d88ca5e34fa2168138.tar.gz
Use pci_get_progif to decide if this is one of the primary/secondary
channels. This also work when PCI native mode has been selected (patch for /sys/dev/pci/pci.c needed for that) since pci_get_progif uses the saved value for progif, not the one stored after we may have changed from legacy mode to native PCI mode.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/ata-pci.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index d6519cd..090f7b9 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -164,8 +164,7 @@ ata_pci_attach(device_t dev)
{
struct ata_pci_controller *ctlr = device_get_softc(dev);
u_int32_t cmd;
- u_int8_t progif;
- int unit, prisec = 0;
+ int unit;
/* do chipset specific setups only needed once */
if (ata_legacy(dev) || pci_read_config(dev, 0x18, 4) & IOMASK)
@@ -176,10 +175,6 @@ ata_pci_attach(device_t dev)
ctlr->dmainit = ata_pci_dmainit;
ctlr->locking = ata_pci_locknoop;
- progif = pci_read_config(dev, PCIR_PROGIF, 1);
- if ((progif & 0x80))
- prisec = 1;
-
/* if needed try to enable busmastering */
cmd = pci_read_config(dev, PCIR_COMMAND, 2);
if (!(cmd & PCIM_CMD_BUSMASTEREN)) {
@@ -199,7 +194,7 @@ ata_pci_attach(device_t dev)
/* attach all channels on this controller */
for (unit = 0; unit < ctlr->channels; unit++)
- device_add_child(dev, "ata", prisec ?
+ device_add_child(dev, "ata", (pci_get_progif(dev) & 0x85) == 0x80 ?
unit : devclass_find_free_unit(ata_devclass, 2));
return bus_generic_attach(dev);
OpenPOWER on IntegriCloud