summaryrefslogtreecommitdiff
path: root/sys/dev/pci/autri.c
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/autri.c
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/autri.c')
-rw-r--r--sys/dev/pci/autri.c19
1 files changed, 16 insertions, 3 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])));
}