summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2003-10-28 19:01:48 +0000
committersos <sos@FreeBSD.org>2003-10-28 19:01:48 +0000
commitb0cc5e450bc6c18f3bfbaff4380a063a7868c0f9 (patch)
treef802d022a489c8827d3ba5652dfc21d530ca5761 /sys/dev
parent208696733a419f6f2b87aa24339e64bfd62d276e (diff)
downloadFreeBSD-src-b0cc5e450bc6c18f3bfbaff4380a063a7868c0f9.zip
FreeBSD-src-b0cc5e450bc6c18f3bfbaff4380a063a7868c0f9.tar.gz
This should allow us to boot with DMA enabled on unknown PCI ATA
chipsets, well at least newer ones...
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/ata-chipset.c3
-rw-r--r--sys/dev/ata/ata-pci.c70
2 files changed, 48 insertions, 25 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c
index 83aedea..0758222 100644
--- a/sys/dev/ata/ata-chipset.c
+++ b/sys/dev/ata/ata-chipset.c
@@ -160,6 +160,7 @@ ata_generic_intr(void *data)
static void
ata_generic_setmode(struct ata_device *atadev, int mode)
{
+ mode = ata_limit_mode(atadev, mode, ATA_UDMA2);
mode = ata_check_80pin(atadev, mode);
if (!ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode))
atadev->mode = mode;
@@ -2050,7 +2051,7 @@ ata_via_ident(device_t dev)
{ 0, 0, 0, 0, 0, 0 }};
char buffer[64];
- if (!(idx = ata_find_chip(dev, ids, pci_get_slot(dev))))
+ if (!(idx = ata_find_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index 01ca793..325ed27 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -68,42 +68,64 @@ ata_pci_probe(device_t dev)
switch (pci_get_vendor(dev)) {
case ATA_ACARD_ID:
- return ata_acard_ident(dev);
+ if (!ata_acard_ident(dev))
+ return 0;
+ break;
case ATA_ACER_LABS_ID:
- return ata_ali_ident(dev);
+ if (!ata_ali_ident(dev))
+ return 0;
+ break;
case ATA_AMD_ID:
- return ata_amd_ident(dev);
+ if (!ata_amd_ident(dev))
+ return 0;
+ break;
case ATA_CYRIX_ID:
- return ata_cyrix_ident(dev);
+ if (!ata_cyrix_ident(dev))
+ return 0;
+ break;
case ATA_CYPRESS_ID:
- return ata_cypress_ident(dev);
+ if (!ata_cypress_ident(dev))
+ return 0;
+ break;
case ATA_HIGHPOINT_ID:
- return ata_highpoint_ident(dev);
+ if (!ata_highpoint_ident(dev))
+ return 0;
+ break;
case ATA_INTEL_ID:
- return ata_intel_ident(dev);
- case ATA_NATIONAL_ID:
- return ata_national_ident(dev);
+ if (!ata_intel_ident(dev))
+ return 0;
+ break;
case ATA_NVIDIA_ID:
- return ata_nvidia_ident(dev);
+ if (!ata_nvidia_ident(dev))
+ return 0;
+ break;
case ATA_PROMISE_ID:
- return ata_promise_ident(dev);
+ if (!ata_promise_ident(dev))
+ return 0;
+ break;
case ATA_SERVERWORKS_ID:
- return ata_serverworks_ident(dev);
+ if (!ata_serverworks_ident(dev))
+ return 0;
+ break;
case ATA_SILICON_IMAGE_ID:
- return ata_sii_ident(dev);
+ if (!ata_sii_ident(dev))
+ return 0;
+ break;
case ATA_SIS_ID:
- return ata_sis_ident(dev);
+ if (!ata_sis_ident(dev))
+ return 0;
+ break;
case ATA_VIA_ID:
- return ata_via_ident(dev);
-
+ if (!ata_via_ident(dev))
+ return 0;
+ break;
case 0x16ca:
if (pci_get_devid(dev) == 0x000116ca) {
ata_generic_ident(dev);
device_set_desc(dev, "Cenatek Rocket Drive controller");
return 0;
}
- return ENXIO;
-
+ break;
case 0x1042:
if (pci_get_devid(dev)==0x10001042 || pci_get_devid(dev)==0x10011042) {
ata_generic_ident(dev);
@@ -111,14 +133,14 @@ ata_pci_probe(device_t dev)
"RZ 100? ATA controller !WARNING! buggy HW data loss possible");
return 0;
}
- return ENXIO;
+ break;
+ }
/* unknown chipset, try generic DMA if it seems possible */
- default:
- if (pci_get_class(dev) == PCIC_STORAGE &&
- (pci_get_subclass(dev) == PCIS_STORAGE_IDE))
- return ata_generic_ident(dev);
- }
+ if ((pci_get_class(dev) == PCIC_STORAGE) &&
+ (pci_get_subclass(dev) == PCIS_STORAGE_IDE))
+ return ata_generic_ident(dev);
+
return ENXIO;
}
OpenPOWER on IntegriCloud