summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-08-03 22:18:14 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-08-03 22:18:14 +0000
commit771971db2be91deb8935eb67680f64b6d1b69502 (patch)
treed587dfa9aaab8d089ba17eac98879640623f8839 /sys/dev/pci
parent2d5ad0c55466db0cdec908dd9b42c5845c5e1a28 (diff)
Let ahci(4) match on _CLS instead of _HID when attaching at acpi(4). Avoids
having to add many more _HID entries to the match table. ok deraadt@, mlarkin@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/ahci_pci.c7
-rw-r--r--sys/dev/pci/pcireg.h3
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/pci/ahci_pci.c b/sys/dev/pci/ahci_pci.c
index 793610d3a83..79044b52dd5 100644
--- a/sys/dev/pci/ahci_pci.c
+++ b/sys/dev/pci/ahci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahci_pci.c,v 1.14 2018/01/03 20:10:40 kettenis Exp $ */
+/* $OpenBSD: ahci_pci.c,v 1.15 2018/08/03 22:18:13 kettenis Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -43,7 +43,6 @@
#define AHCI_PCI_BAR 0x24
#define AHCI_PCI_ATI_SB600_MAGIC 0x40
#define AHCI_PCI_ATI_SB600_LOCKED 0x01
-#define AHCI_PCI_INTERFACE 0x01
struct ahci_pci_softc {
struct ahci_softc psc_ahci;
@@ -232,7 +231,7 @@ ahci_ati_sb_idetoahci(struct ahci_softc *sc, struct pci_attach_args *pa)
pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_CLASS_REG,
PCI_CLASS_MASS_STORAGE << PCI_CLASS_SHIFT |
PCI_SUBCLASS_MASS_STORAGE_SATA << PCI_SUBCLASS_SHIFT |
- AHCI_PCI_INTERFACE << PCI_INTERFACE_SHIFT |
+ PCI_INTERFACE_SATA_AHCI10 << PCI_INTERFACE_SHIFT |
PCI_REVISION(pa->pa_class) << PCI_REVISION_SHIFT);
pci_conf_write(pa->pa_pc, pa->pa_tag,
@@ -310,7 +309,7 @@ ahci_pci_match(struct device *parent, void *match, void *aux)
if (PCI_CLASS(pa->pa_class) == PCI_CLASS_MASS_STORAGE &&
PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_MASS_STORAGE_SATA &&
- PCI_INTERFACE(pa->pa_class) == AHCI_PCI_INTERFACE)
+ PCI_INTERFACE(pa->pa_class) == PCI_INTERFACE_SATA_AHCI10)
return (2);
return (0);
diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h
index feaa9bc6f47..90ef9275a05 100644
--- a/sys/dev/pci/pcireg.h
+++ b/sys/dev/pci/pcireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcireg.h,v 1.55 2017/08/09 21:42:44 mlarkin Exp $ */
+/* $OpenBSD: pcireg.h,v 1.56 2018/08/03 22:18:13 kettenis Exp $ */
/* $NetBSD: pcireg.h,v 1.26 2000/05/10 16:58:42 thorpej Exp $ */
/*
@@ -168,6 +168,7 @@ typedef u_int8_t pci_revision_t;
#define PCI_SUBCLASS_MASS_STORAGE_RAID 0x04
#define PCI_SUBCLASS_MASS_STORAGE_ATA 0x05
#define PCI_SUBCLASS_MASS_STORAGE_SATA 0x06
+#define PCI_INTERFACE_SATA_AHCI10 0x01
#define PCI_SUBCLASS_MASS_STORAGE_SAS 0x07
#define PCI_SUBCLASS_MASS_STORAGE_NVM 0x08
#define PCI_SUBCLASS_MASS_STORAGE_UFS 0x09