aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorSøren Schmidt <sos@FreeBSD.org>2007-02-17 16:56:39 +0000
committerSøren Schmidt <sos@FreeBSD.org>2007-02-17 16:56:39 +0000
commitcfaed55fd51f32cf208c42895ffac09c78f9ff85 (patch)
tree31424ae52139540ad3eabf13397afd2881b3526c /sys/dev/ata
parentba20889705fa9bb44a3612b886254ebc7869befe (diff)
Notes
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/ata-pci.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index fc3585ad1242..1acd68d179ec 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -59,10 +59,14 @@ static MALLOC_DEFINE(M_ATAPCI, "ata_pci", "ATA driver PCI");
int
ata_legacy(device_t dev)
{
- return ((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV) &&
- ((pci_read_config(dev, PCIR_PROGIF, 1) &
- (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) !=
- (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)));
+ return (((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV)&&
+ ((pci_read_config(dev, PCIR_PROGIF, 1) &
+ (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) !=
+ (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))) ||
+ (!pci_read_config(dev, PCIR_BAR(0), 4) &&
+ !pci_read_config(dev, PCIR_BAR(1), 4) &&
+ !pci_read_config(dev, PCIR_BAR(2), 4) &&
+ !pci_read_config(dev, PCIR_BAR(3), 4)));
}
int
@@ -211,11 +215,7 @@ ata_pci_attach(device_t dev)
/* attach all channels on this controller */
for (unit = 0; unit < ctlr->channels; unit++) {
- if (unit == 0 && (pci_get_progif(dev) & 0x81) == 0x80) {
- device_add_child(dev, "ata", unit);
- continue;
- }
- if (unit == 1 && (pci_get_progif(dev) & 0x84) == 0x80) {
+ if ((unit == 0 || unit == 1) && ata_legacy(dev)) {
device_add_child(dev, "ata", unit);
continue;
}