aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSøren Schmidt <sos@FreeBSD.org>2004-04-27 12:54:59 +0000
committerSøren Schmidt <sos@FreeBSD.org>2004-04-27 12:54:59 +0000
commit1b7cfe4458af540253677dd563914c62d3de10b5 (patch)
treee005a991d91b180f66c0770365bf46ec9d167c65 /sys
parentfa483345d2152f2f8698d0e93c0497e8a62cf3d7 (diff)
downloadsrc-1b7cfe4458af540253677dd563914c62d3de10b5.tar.gz
src-1b7cfe4458af540253677dd563914c62d3de10b5.zip
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.
Notes
Notes: svn path=/head/; revision=128676
Diffstat (limited to 'sys')
-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 d6519cde3496..090f7b907803 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);