summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2004-05-28 15:49:45 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2004-05-28 15:49:45 +0000
commit8459d0ca1f47615dedac65d6d6912317913f4447 (patch)
treeb5a3d804df62d7a6cfee83d093109985627d4b9f
parent7109087ba0f03535a45c3f0f2248b1016017c795 (diff)
Clean up subsysid lookups + print subsysid string during boot.
Add: * Adaptec 1210SA, 2410SA, 2610SA, 2810SA, 21610SA * Dell CERC-SATA, PERC 320/DC
-rw-r--r--sys/dev/pci/aac_pci.c65
1 files changed, 60 insertions, 5 deletions
diff --git a/sys/dev/pci/aac_pci.c b/sys/dev/pci/aac_pci.c
index 3a1667aa620..959dad798d4 100644
--- a/sys/dev/pci/aac_pci.c
+++ b/sys/dev/pci/aac_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aac_pci.c,v 1.11 2004/05/21 20:33:39 marco Exp $ */
+/* $OpenBSD: aac_pci.c,v 1.12 2004/05/28 15:49:44 marco Exp $ */
/*-
* Copyright (c) 2000 Michael Smith
@@ -62,6 +62,32 @@
int aac_pci_probe(struct device *, void *, void *);
void aac_pci_attach(struct device *, struct device *, void *);
+/* Adaptec */
+#define PCI_PRODUCT_ADP2_AACADPSATA2C 0x0289
+#define PCI_PRODUCT_ADP2_AACADPSATA4C 0x0290
+#define PCI_PRODUCT_ADP2_AACADPSATA6C 0x0291
+#define PCI_PRODUCT_ADP2_AACADPSATA8C 0x0292
+#define PCI_PRODUCT_ADP2_AACADPSATA16C 0x0293
+
+/* Dell */
+#define PCI_PRODUCT_ADP2_AACCERCSATA6C 0x0291
+#define PCI_PRODUCT_ADP2_AACPERC320DC 0x0287
+
+struct aac_sub_ident {
+ u_int16_t subvendor;
+ u_int16_t subdevice;
+ char *desc;
+} aac_sub_identifiers[] = {
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AACADPSATA2C, "Adaptec 1210SA" }, /* guess */
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AACADPSATA4C, "Adaptec 2410SA" },
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AACADPSATA6C, "Adaptec 2610SA" },
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AACADPSATA8C, "Adaptec 2810SA" }, /* guess */
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AACADPSATA16C, "Adaptec 21610SA" }, /* guess */
+ { PCI_VENDOR_DELL, PCI_PRODUCT_ADP2_AACCERCSATA6C, "Dell CERC-SATA" },
+ { PCI_VENDOR_DELL, PCI_PRODUCT_ADP2_AACPERC320DC, "Dell PERC 320/DC" },
+ { 0, 0, "" }
+};
+
struct aac_ident {
u_int16_t vendor;
u_int16_t device;
@@ -96,9 +122,27 @@ struct aac_ident {
PCI_PRODUCT_DELL_PERC_3SI, AAC_HWIF_I960RX },
{ PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_3SI_2, PCI_VENDOR_DELL,
PCI_PRODUCT_DELL_PERC_3SI_2_SUB, AAC_HWIF_I960RX },
- /* Adaptec CERC-SATA */
+ /* Adaptec SATA RAID 2 channel XXX guess */
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_ASR2200S, PCI_VENDOR_ADP2,
+ PCI_PRODUCT_ADP2_AACADPSATA2C, AAC_HWIF_I960RX },
+ /* Adaptec SATA RAID 4 channel */
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_ASR2200S, PCI_VENDOR_ADP2,
+ PCI_PRODUCT_ADP2_AACADPSATA4C, AAC_HWIF_I960RX },
+ /* Adaptec SATA RAID 6 channel XXX guess */
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_ASR2200S, PCI_VENDOR_ADP2,
+ PCI_PRODUCT_ADP2_AACADPSATA6C, AAC_HWIF_I960RX },
+ /* Adaptec SATA RAID 8 channel XXX guess */
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_ASR2200S, PCI_VENDOR_ADP2,
+ PCI_PRODUCT_ADP2_AACADPSATA8C, AAC_HWIF_I960RX },
+ /* Adaptec SATA RAID 16 channel XXX guess */
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_ASR2200S, PCI_VENDOR_ADP2,
+ PCI_PRODUCT_ADP2_AACADPSATA16C, AAC_HWIF_I960RX },
+ /* Dell CERC-SATA */
+ { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_ASR2200S, PCI_VENDOR_DELL,
+ PCI_PRODUCT_ADP2_AACCERCSATA6C, AAC_HWIF_I960RX },
+ /* Dell PERC 320/DC */
{ PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_ASR2200S, PCI_VENDOR_DELL,
- PCI_PRODUCT_ADP2_AACCERCSATA, AAC_HWIF_I960RX },
+ PCI_PRODUCT_ADP2_AACPERC320DC, AAC_HWIF_I960RX },
/* Adaptec ADP-2622 */
{ PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AAC2622, PCI_VENDOR_ADP2,
PCI_PRODUCT_ADP2_AAC2622, AAC_HWIF_I960RX },
@@ -161,9 +205,22 @@ aac_pci_attach(parent, self, aux)
const char *intrstr;
int state = 0;
struct aac_ident *m;
+ struct aac_sub_ident *subid;
u_int32_t subsysid;
printf(": ");
+ subsysid = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
+ if ((PCI_VENDOR(pa->pa_id) != PCI_VENDOR(subsysid)) ||
+ (PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT(subsysid))) {
+ for (subid = aac_sub_identifiers; subid->subvendor != 0;
+ subid++) {
+ if (subid->subvendor == PCI_VENDOR(subsysid) &&
+ subid->subdevice == PCI_PRODUCT(subsysid)) {
+ printf("%s ", subid->desc);
+ break;
+ }
+ }
+ }
/*
* Verify that the adapter is correctly set up in PCI space.
@@ -216,8 +273,6 @@ aac_pci_attach(parent, self, aux)
for (m = aac_identifiers; m->vendor != 0; m++)
if (m->vendor == PCI_VENDOR(pa->pa_id) &&
m->device == PCI_PRODUCT(pa->pa_id)) {
- subsysid = pci_conf_read(pa->pa_pc, pa->pa_tag,
- PCI_SUBSYS_ID_REG);
if (m->subvendor == PCI_VENDOR(subsysid) &&
m->subdevice == PCI_PRODUCT(subsysid)) {
sc->sc_hwif = m->hwif;