summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-02-22 18:12:25 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-02-22 18:12:25 +0000
commit1f76b598ec5708bd93cc072333c458fa3661f0ec (patch)
tree719b7ecd35af8d9fa5f4f3bebeefbd572fed0fb2 /sys/dev/pci
parent0b1953b8e5af849c83ee8ecc360dbf3b9c1a2980 (diff)
IBM makes a pcn card that shows up as:
Trident Microsystems 4DWAVE DX (ethernet network, revision 0x25) Unfortunately, this is an autri sound card. Special case the match routines for both drivers so if_pcn properly picks it up and autri does not. From NetBSD ok mickey@, tested by martin@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/autri.c19
-rw-r--r--sys/dev/pci/if_pcn.c13
2 files changed, 28 insertions, 4 deletions
diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c
index a73a2cb0bd5..f6ee18c3dad 100644
--- a/sys/dev/pci/autri.c
+++ b/sys/dev/pci/autri.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autri.c,v 1.16 2005/08/09 04:10:10 mickey Exp $ */
+/* $OpenBSD: autri.c,v 1.17 2006/02/22 18:12:24 brad Exp $ */
/*
* Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro.
@@ -471,10 +471,9 @@ autri_flags_codec(void *v)
*
*/
const struct pci_matchid autri_devices[] = {
- { PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_4DWAVE_DX },
{ PCI_VENDOR_TRIDENT, PCI_PRODUCT_TRIDENT_4DWAVE_NX },
{ PCI_VENDOR_SIS, PCI_PRODUCT_SIS_7018 },
- { PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M5451 },
+ { PCI_VENDOR_ALI, PCI_PRODUCT_ALI_M5451 }
};
int
@@ -483,6 +482,20 @@ autri_match(parent, match, aux)
void *match;
void *aux;
{
+ struct pci_attach_args *pa = aux;
+
+ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_TRIDENT &&
+ PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_TRIDENT_4DWAVE_DX) {
+ /*
+ * IBM makes a pcn network card and improperly
+ * sets the vendor and product ID's. Avoid matching.
+ */
+ if (PCI_CLASS(pa->pa_class) == PCI_CLASS_NETWORK)
+ return (0);
+ else
+ return (1);
+ }
+
return (pci_matchbyid((struct pci_attach_args *)aux, autri_devices,
sizeof(autri_devices)/sizeof(autri_devices[0])));
}
diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c
index 91044ee1448..54b6b56f0bd 100644
--- a/sys/dev/pci/if_pcn.c
+++ b/sys/dev/pci/if_pcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pcn.c,v 1.5 2006/02/03 06:38:11 brad Exp $ */
+/* $OpenBSD: if_pcn.c,v 1.6 2006/02/22 18:12:24 brad Exp $ */
/* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */
/*
@@ -508,6 +508,17 @@ pcn_match(struct device *parent, void *match, void *aux)
{
struct pci_attach_args *pa = aux;
+ /*
+ * IBM makes a PCI variant of this card which shows up as a
+ * Trident Microsystems 4DWAVE DX (ethernet network, revision 0x25)
+ * this card is truly a pcn card, so we have a special case match for
+ * it.
+ */
+ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_TRIDENT &&
+ PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_TRIDENT_4DWAVE_DX &&
+ PCI_CLASS(pa->pa_class) == PCI_CLASS_NETWORK)
+ return(1);
+
if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_AMD)
return (0);