From e8f94f74c0af0f445dedd4ceac1c53a524869ffb Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Fri, 7 Jul 2006 00:01:16 +0000 Subject: 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@ --- sys/dev/pci/pciide.c | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'sys') 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 $ */ /* @@ -1050,23 +1050,37 @@ pciide_match(struct device *parent, void *match, void *aux) PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_PCTECH_RZ1000) 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); -- cgit v1.2.3