summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2006-07-07 00:01:16 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2006-07-07 00:01:16 +0000
commite8f94f74c0af0f445dedd4ceac1c53a524869ffb (patch)
tree37e592df0bd744cd7480d88f6c11aa72efd5acfd /sys/dev
parentfb4f00cf586bc50496aaa117e7e6f3f3772d4d1b (diff)
Check for SATA and RAID subclasses if we have a matching PCI ID.
This should remove the need for most if not all of the override flags. "looks safe to me" miod@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pciide.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index 44ab84074c4..f22c2d9c7d6 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide.c,v 1.243 2006/06/26 22:14:59 miod Exp $ */
+/* $OpenBSD: pciide.c,v 1.244 2006/07/07 00:01:15 jsg Exp $ */
/* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */
/*
@@ -1051,22 +1051,36 @@ pciide_match(struct device *parent, void *match, void *aux)
return (0);
/*
- * Check the ID register to see that it's a PCI IDE controller.
- * If it is, we assume that we can deal with it; it _should_
- * work in a standardized way...
- */
- if (PCI_CLASS(pa->pa_class) == PCI_CLASS_MASS_STORAGE &&
- PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_MASS_STORAGE_IDE) {
- return (1);
- }
-
- /*
* Some controllers (e.g. promise Ultra-33) don't claim to be PCI IDE
* controllers. Let see if we can deal with it anyway.
*/
pp = pciide_lookup_product(pa->pa_id);
- if (pp && (pp->ide_flags & IDE_PCI_CLASS_OVERRIDE)) {
+ if (pp && (pp->ide_flags & IDE_PCI_CLASS_OVERRIDE))
return (1);
+
+ /*
+ * Check the ID register to see that it's a PCI IDE controller.
+ * If it is, we assume that we can deal with it; it _should_
+ * work in a standardized way...
+ */
+ if (PCI_CLASS(pa->pa_class) == PCI_CLASS_MASS_STORAGE) {
+ switch (PCI_SUBCLASS(pa->pa_class)) {
+ case PCI_SUBCLASS_MASS_STORAGE_IDE:
+ return (1);
+
+ /*
+ * We only match these if we know they have
+ * a match, as we may not support native interfaces
+ * on them.
+ */
+ case PCI_SUBCLASS_MASS_STORAGE_SATA:
+ case PCI_SUBCLASS_MASS_STORAGE_RAID:
+ if (pp)
+ return (1);
+ else
+ return (0);
+ break;
+ }
}
return (0);