Fri Oct 2 21:27:45 2009 UTC ()
match VT8237A


(jmcneill)
diff -r1.11 -r1.12 src/sys/arch/i386/pci/viapcib.c

cvs diff -r1.11 -r1.12 src/sys/arch/i386/pci/viapcib.c (expand / switch to unified diff)

--- src/sys/arch/i386/pci/viapcib.c 2008/07/20 16:59:53 1.11
+++ src/sys/arch/i386/pci/viapcib.c 2009/10/02 21:27:45 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: viapcib.c,v 1.11 2008/07/20 16:59:53 martin Exp $ */ 1/* $NetBSD: viapcib.c,v 1.12 2009/10/02 21:27:45 jmcneill Exp $ */
2/* $FreeBSD: src/sys/pci/viapm.c,v 1.10 2005/05/29 04:42:29 nyan Exp $ */ 2/* $FreeBSD: src/sys/pci/viapm.c,v 1.10 2005/05/29 04:42:29 nyan Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2005, 2006 Jared D. McNeill <jmcneill@invisible.ca> 5 * Copyright (c) 2005, 2006 Jared D. McNeill <jmcneill@invisible.ca>
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions, and the following disclaimer in the 14 * notice, this list of conditions, and the following disclaimer in the
@@ -45,27 +45,27 @@ @@ -45,27 +45,27 @@
45 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 45 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 46 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 47 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
48 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 48 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 49 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE. 54 * SUCH DAMAGE.
55 */ 55 */
56 56
57#include <sys/cdefs.h> 57#include <sys/cdefs.h>
58__KERNEL_RCSID(0, "$NetBSD: viapcib.c,v 1.11 2008/07/20 16:59:53 martin Exp $"); 58__KERNEL_RCSID(0, "$NetBSD: viapcib.c,v 1.12 2009/10/02 21:27:45 jmcneill Exp $");
59 59
60#include <sys/types.h> 60#include <sys/types.h>
61#include <sys/param.h> 61#include <sys/param.h>
62#include <sys/systm.h> 62#include <sys/systm.h>
63#include <sys/device.h> 63#include <sys/device.h>
64#include <sys/proc.h> 64#include <sys/proc.h>
65#include <sys/simplelock.h> 65#include <sys/simplelock.h>
66#include <sys/bus.h> 66#include <sys/bus.h>
67 67
68#include <dev/pci/pcireg.h> 68#include <dev/pci/pcireg.h>
69#include <dev/pci/pcivar.h> 69#include <dev/pci/pcivar.h>
70#include <dev/pci/pcidevs.h> 70#include <dev/pci/pcidevs.h>
71 71
@@ -138,26 +138,27 @@ CFATTACH_DECL_NEW(viapcib, sizeof(struct @@ -138,26 +138,27 @@ CFATTACH_DECL_NEW(viapcib, sizeof(struct
138 viapcib_match, viapcib_attach, NULL, NULL); 138 viapcib_match, viapcib_attach, NULL, NULL);
139 139
140static int 140static int
141viapcib_match(device_t parent, cfdata_t match, void *opaque) 141viapcib_match(device_t parent, cfdata_t match, void *opaque)
142{ 142{
143 struct pci_attach_args *pa = opaque; 143 struct pci_attach_args *pa = opaque;
144 144
145 if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_VIATECH) 145 if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_VIATECH)
146 return 0; 146 return 0;
147 147
148 switch (PCI_PRODUCT(pa->pa_id)) { 148 switch (PCI_PRODUCT(pa->pa_id)) {
149 case PCI_PRODUCT_VIATECH_VT8235: 149 case PCI_PRODUCT_VIATECH_VT8235:
150 case PCI_PRODUCT_VIATECH_VT8237: 150 case PCI_PRODUCT_VIATECH_VT8237:
 151 case PCI_PRODUCT_VIATECH_VT8237A_ISA:
151 return 2; /* match above generic pcib(4) */ 152 return 2; /* match above generic pcib(4) */
152 } 153 }
153 154
154 return 0; 155 return 0;
155} 156}
156 157
157static void 158static void
158viapcib_attach(device_t parent, device_t self, void *opaque) 159viapcib_attach(device_t parent, device_t self, void *opaque)
159{ 160{
160 struct viapcib_softc *sc = device_private(self); 161 struct viapcib_softc *sc = device_private(self);
161 struct pci_attach_args *pa = opaque; 162 struct pci_attach_args *pa = opaque;
162 pcireg_t addr, val; 163 pcireg_t addr, val;
163 164