Mon Jan 30 19:41:24 2012 UTC ()
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


(drochner)
diff -r1.32 -r1.33 src/sys/arch/x86/pci/pchb.c
diff -r1.13 -r1.14 src/sys/arch/x86/pci/pcib.c
diff -r1.26 -r1.27 src/sys/dev/pci/ahcisata_pci.c
diff -r1.26 -r1.27 src/sys/dev/pci/ubsec.c
diff -r1.34 -r1.35 src/sys/dev/pci/amdpm.c
diff -r1.37 -r1.38 src/sys/dev/pci/auixp.c
diff -r1.37 -r1.38 src/sys/dev/pci/voodoofb.c
diff -r1.48 -r1.49 src/sys/dev/pci/autri.c
diff -r1.48 -r1.49 src/sys/dev/pci/hifn7751.c
diff -r1.27 -r1.28 src/sys/dev/pci/btvmei.c
diff -r1.27 -r1.28 src/sys/dev/pci/r128fb.c
diff -r1.30 -r1.31 src/sys/dev/pci/chipsfb.c
diff -r1.44 -r1.45 src/sys/dev/pci/cmpci.c
diff -r1.9 -r1.10 src/sys/dev/pci/coram.c
diff -r1.9 -r1.10 src/sys/dev/pci/siisata_pci.c
diff -r1.9 -r1.10 src/sys/dev/pci/wcfb.c
diff -r1.63 -r1.64 src/sys/dev/pci/cs4280.c
diff -r1.46 -r1.47 src/sys/dev/pci/cs4281.c
diff -r1.10 -r1.11 src/sys/dev/pci/cxdtv.c
diff -r1.53 -r1.54 src/sys/dev/pci/ehci_pci.c
diff -r1.53 -r1.54 src/sys/dev/pci/if_stge.c
diff -r1.53 -r1.54 src/sys/dev/pci/if_wi_pci.c
diff -r1.53 -r1.54 src/sys/dev/pci/uhci_pci.c
diff -r1.53 -r1.54 src/sys/dev/pci/vga_pci.c
diff -r1.61 -r1.62 src/sys/dev/pci/emuxki.c
diff -r1.61 -r1.62 src/sys/dev/pci/if_iwn.c
diff -r1.57 -r1.58 src/sys/dev/pci/esa.c
diff -r1.55 -r1.56 src/sys/dev/pci/esm.c
diff -r1.39 -r1.40 src/sys/dev/pci/fwohci_pci.c
diff -r1.39 -r1.40 src/sys/dev/pci/if_epic_pci.c
diff -r1.39 -r1.40 src/sys/dev/pci/twa.c
diff -r1.32 -r1.33 src/sys/dev/pci/genfb_pci.c
diff -r1.32 -r1.33 src/sys/dev/pci/if_an_pci.c
diff -r1.32 -r1.33 src/sys/dev/pci/if_dge.c
diff -r1.17 -r1.18 src/sys/dev/pci/gtp.c
diff -r1.17 -r1.18 src/sys/dev/pci/iha_pci.c
diff -r1.25 -r1.26 src/sys/dev/pci/ichsmb.c
diff -r1.14 -r1.15 src/sys/dev/pci/if_cas.c
diff -r1.2 -r1.3 src/sys/dev/pci/if_et.c
diff -r1.77 -r1.78 src/sys/dev/pci/if_fxp_pci.c
diff -r1.43 -r1.44 src/sys/dev/pci/if_gem_pci.c
diff -r1.52 -r1.53 src/sys/dev/pci/if_ipw.c
diff -r1.52 -r1.53 src/sys/dev/pci/radeonfb.c
diff -r1.52 -r1.53 src/sys/dev/pci/yds.c
diff -r1.88 -r1.89 src/sys/dev/pci/if_iwi.c
diff -r1.16 -r1.17 src/sys/dev/pci/if_mtd_pci.c
diff -r1.54 -r1.55 src/sys/dev/pci/if_nfe.c
diff -r1.18 -r1.19 src/sys/dev/pci/if_ral_pci.c
diff -r1.40 -r1.41 src/sys/dev/pci/if_re_pci.c
diff -r1.42 -r1.43 src/sys/dev/pci/if_rtk_pci.c
diff -r1.51 -r1.52 src/sys/dev/pci/if_vge.c
diff -r1.51 -r1.52 src/sys/dev/pci/pciide_common.c
diff -r1.108 -r1.109 src/sys/dev/pci/if_vr.c
diff -r1.3 -r1.4 src/sys/dev/pci/if_vte.c
diff -r1.225 -r1.226 src/sys/dev/pci/if_wm.c
diff -r1.49 -r1.50 src/sys/dev/pci/if_wpi.c
diff -r1.22 -r1.23 src/sys/dev/pci/igsfb_pci.c
diff -r1.11 -r1.12 src/sys/dev/pci/jmide.c
diff -r1.11 -r1.12 src/sys/dev/pci/pm2fb.c
diff -r1.19 -r1.20 src/sys/dev/pci/joy_pci.c
diff -r1.72 -r1.73 src/sys/dev/pci/machfb.c
diff -r1.20 -r1.21 src/sys/dev/pci/mpt_pci.c
diff -r1.6 -r1.7 src/sys/dev/pci/mvsata_pci.c
diff -r1.1 -r1.2 src/sys/dev/pci/nca_pci.c
diff -r1.1 -r1.2 src/sys/dev/pci/sisfb.c
diff -r1.21 -r1.22 src/sys/dev/pci/nfsmb.c
diff -r1.47 -r1.48 src/sys/dev/pci/ohci_pci.c
diff -r1.203 -r1.204 src/sys/dev/pci/pccbb.c
diff -r1.45 -r1.46 src/sys/dev/pci/pcscp.c
diff -r1.38 -r1.39 src/sys/dev/pci/piixpm.c
diff -r1.12 -r1.13 src/sys/dev/pci/radeonfbvar.h
diff -r1.4 -r1.5 src/sys/dev/pci/sdhc_pci.c
diff -r1.8 -r1.9 src/sys/dev/pci/voyager.c

cvs diff -r1.32 -r1.33 src/sys/arch/x86/pci/pchb.c (expand / switch to unified diff)

--- src/sys/arch/x86/pci/pchb.c 2011/08/20 20:01:08 1.32
+++ src/sys/arch/x86/pci/pchb.c 2012/01/30 19:41:18 1.33
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pchb.c,v 1.32 2011/08/20 20:01:08 jakllsch Exp $ */ 1/* $NetBSD: pchb.c,v 1.33 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.32 2011/08/20 20:01:08 jakllsch Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.33 2012/01/30 19:41:18 drochner Exp $");
34 34
35#include <sys/types.h> 35#include <sys/types.h>
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39 39
40#include <sys/bus.h> 40#include <sys/bus.h>
41 41
42#include <dev/pci/pcivar.h> 42#include <dev/pci/pcivar.h>
43#include <dev/pci/pcireg.h> 43#include <dev/pci/pcireg.h>
44 44
45#include <dev/pci/pcidevs.h> 45#include <dev/pci/pcidevs.h>
46 46
@@ -145,51 +145,46 @@ pchb_get_bus_number(pci_chipset_tag_t pc @@ -145,51 +145,46 @@ pchb_get_bus_number(pci_chipset_tag_t pc
145 break; 145 break;
146 } 146 }
147 return pbnum; 147 return pbnum;
148 } 148 }
149 } 149 }
150 return -1; 150 return -1;
151} 151}
152 152
153static void 153static void
154pchbattach(device_t parent, device_t self, void *aux) 154pchbattach(device_t parent, device_t self, void *aux)
155{ 155{
156 struct pchb_softc *sc = device_private(self); 156 struct pchb_softc *sc = device_private(self);
157 const struct pci_attach_args *pa = aux; 157 const struct pci_attach_args *pa = aux;
158 char devinfo[256]; 
159 struct pcibus_attach_args pba; 158 struct pcibus_attach_args pba;
160 struct agpbus_attach_args apa; 159 struct agpbus_attach_args apa;
161 pcireg_t bcreg; 160 pcireg_t bcreg;
162 u_char bdnum, pbnum = 0; /* XXX: gcc */ 161 u_char bdnum, pbnum = 0; /* XXX: gcc */
163 pcitag_t tag; 162 pcitag_t tag;
164 int doattach, attachflags, has_agp; 163 int doattach, attachflags, has_agp;
165 164
166 aprint_naive("\n"); 
167 
168 doattach = 0; 165 doattach = 0;
169 has_agp = 0; 166 has_agp = 0;
170 attachflags = pa->pa_flags; 167 attachflags = pa->pa_flags;
171 168
172 sc->sc_dev = self; 169 sc->sc_dev = self;
173 sc->sc_pa = *pa; 170 sc->sc_pa = *pa;
174 171
175 /* 172 /*
176 * Print out a description, and configure certain chipsets which 173 * Print out a description, and configure certain chipsets which
177 * have auxiliary PCI buses. 174 * have auxiliary PCI buses.
178 */ 175 */
179 176
180 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 177 pci_aprint_devinfo(pa, NULL);
181 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
182 PCI_REVISION(pa->pa_class)); 
183 178
184 switch (PCI_VENDOR(pa->pa_id)) { 179 switch (PCI_VENDOR(pa->pa_id)) {
185 /* 180 /*
186 * i386 stuff. 181 * i386 stuff.
187 */ 182 */
188 case PCI_VENDOR_SERVERWORKS: 183 case PCI_VENDOR_SERVERWORKS:
189 pbnum = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x44) & 0xff; 184 pbnum = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x44) & 0xff;
190 185
191 if (pbnum == 0) 186 if (pbnum == 0)
192 break; 187 break;
193 188
194 /* 189 /*
195 * This host bridge has a second PCI bus. 190 * This host bridge has a second PCI bus.

cvs diff -r1.13 -r1.14 src/sys/arch/x86/pci/pcib.c (expand / switch to unified diff)

--- src/sys/arch/x86/pci/pcib.c 2011/07/01 18:22:08 1.13
+++ src/sys/arch/x86/pci/pcib.c 2012/01/30 19:41:18 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pcib.c,v 1.13 2011/07/01 18:22:08 dyoung Exp $ */ 1/* $NetBSD: pcib.c,v 1.14 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.13 2011/07/01 18:22:08 dyoung Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.14 2012/01/30 19:41:18 drochner Exp $");
34 34
35#include <sys/types.h> 35#include <sys/types.h>
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39 39
40#include <sys/bus.h> 40#include <sys/bus.h>
41 41
42#include <dev/isa/isavar.h> 42#include <dev/isa/isavar.h>
43 43
44#include <dev/pci/pcivar.h> 44#include <dev/pci/pcivar.h>
45#include <dev/pci/pcireg.h> 45#include <dev/pci/pcireg.h>
46 46
@@ -175,37 +175,32 @@ pcibmatch(device_t parent, cfdata_t matc @@ -175,37 +175,32 @@ pcibmatch(device_t parent, cfdata_t matc
175 if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE && 175 if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
176 PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_ISA) { 176 PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_ISA) {
177 return (1); 177 return (1);
178 } 178 }
179 179
180 return (0); 180 return (0);
181} 181}
182 182
183void 183void
184pcibattach(device_t parent, device_t self, void *aux) 184pcibattach(device_t parent, device_t self, void *aux)
185{ 185{
186 struct pcib_softc *sc = device_private(self); 186 struct pcib_softc *sc = device_private(self);
187 struct pci_attach_args *pa = aux; 187 struct pci_attach_args *pa = aux;
188 char devinfo[256]; 
189 
190 aprint_naive("\n"); 
191 188
192 /* 189 /*
193 * Just print out a description and defer configuration 190 * Just print out a description and defer configuration
194 * until all PCI devices have been attached. 191 * until all PCI devices have been attached.
195 */ 192 */
196 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 193 pci_aprint_devinfo(pa, NULL);
197 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
198 PCI_REVISION(pa->pa_class)); 
199 194
200 sc->sc_pc = pa->pa_pc; 195 sc->sc_pc = pa->pa_pc;
201 sc->sc_tag = pa->pa_tag; 196 sc->sc_tag = pa->pa_tag;
202 197
203 /* If a more specific pcib implementation has already registered a 198 /* If a more specific pcib implementation has already registered a
204 * power handler, don't overwrite it. 199 * power handler, don't overwrite it.
205 */ 200 */
206 if (!device_pmf_is_registered(self)) { 201 if (!device_pmf_is_registered(self)) {
207 if (!pmf_device_register(self, NULL, NULL)) 202 if (!pmf_device_register(self, NULL, NULL))
208 aprint_error_dev(self, "couldn't establish power handler\n"); 203 aprint_error_dev(self, "couldn't establish power handler\n");
209 } 204 }
210 205
211 config_defer(self, pcib_callback); 206 config_defer(self, pcib_callback);

cvs diff -r1.26 -r1.27 src/sys/dev/pci/ahcisata_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/ahcisata_pci.c 2011/08/06 14:56:33 1.26
+++ src/sys/dev/pci/ahcisata_pci.c 2012/01/30 19:41:18 1.27
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ahcisata_pci.c,v 1.26 2011/08/06 14:56:33 jakllsch Exp $ */ 1/* $NetBSD: ahcisata_pci.c,v 1.27 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Manuel Bouyer. 4 * Copyright (c) 2006 Manuel Bouyer.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.26 2011/08/06 14:56:33 jakllsch Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.27 2012/01/30 19:41:18 drochner Exp $");
30 30
31#include <sys/types.h> 31#include <sys/types.h>
32#include <sys/malloc.h> 32#include <sys/malloc.h>
33#include <sys/param.h> 33#include <sys/param.h>
34#include <sys/kernel.h> 34#include <sys/kernel.h>
35#include <sys/systm.h> 35#include <sys/systm.h>
36#include <sys/disklabel.h> 36#include <sys/disklabel.h>
37#include <sys/pmf.h> 37#include <sys/pmf.h>
38 38
39#include <dev/pci/pcivar.h> 39#include <dev/pci/pcivar.h>
40#include <dev/pci/pcidevs.h> 40#include <dev/pci/pcidevs.h>
41#include <dev/pci/pciidereg.h> 41#include <dev/pci/pciidereg.h>
42#include <dev/pci/pciidevar.h> 42#include <dev/pci/pciidevar.h>
@@ -161,46 +161,43 @@ ahci_pci_match(device_t parent, cfdata_t @@ -161,46 +161,43 @@ ahci_pci_match(device_t parent, cfdata_t
161 (force == true)) 161 (force == true))
162 ret = 3; 162 ret = 3;
163 163
164 bus_space_unmap(regt, regh, size); 164 bus_space_unmap(regt, regh, size);
165 return ret; 165 return ret;
166} 166}
167 167
168static void 168static void
169ahci_pci_attach(device_t parent, device_t self, void *aux) 169ahci_pci_attach(device_t parent, device_t self, void *aux)
170{ 170{
171 struct pci_attach_args *pa = aux; 171 struct pci_attach_args *pa = aux;
172 struct ahci_pci_softc *psc = device_private(self); 172 struct ahci_pci_softc *psc = device_private(self);
173 struct ahci_softc *sc = &psc->ah_sc; 173 struct ahci_softc *sc = &psc->ah_sc;
174 char devinfo[256]; 
175 const char *intrstr; 174 const char *intrstr;
176 bool ahci_cap_64bit; 175 bool ahci_cap_64bit;
177 bool ahci_bad_64bit; 176 bool ahci_bad_64bit;
178 pci_intr_handle_t intrhandle; 177 pci_intr_handle_t intrhandle;
179 178
180 sc->sc_atac.atac_dev = self; 179 sc->sc_atac.atac_dev = self;
181 180
182 if (pci_mapreg_map(pa, AHCI_PCI_ABAR, 181 if (pci_mapreg_map(pa, AHCI_PCI_ABAR,
183 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0, 182 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
184 &sc->sc_ahcit, &sc->sc_ahcih, NULL, &sc->sc_ahcis) != 0) { 183 &sc->sc_ahcit, &sc->sc_ahcih, NULL, &sc->sc_ahcis) != 0) {
185 aprint_error_dev(self, "can't map ahci registers\n"); 184 aprint_error_dev(self, "can't map ahci registers\n");
186 return; 185 return;
187 } 186 }
188 psc->sc_pc = pa->pa_pc; 187 psc->sc_pc = pa->pa_pc;
189 psc->sc_pcitag = pa->pa_tag; 188 psc->sc_pcitag = pa->pa_tag;
190 189
191 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 190 pci_aprint_devinfo(pa, "AHCI disk controller");
192 aprint_naive(": AHCI disk controller\n"); 
193 aprint_normal(": %s\n", devinfo); 
194  191
195 if (pci_intr_map(pa, &intrhandle) != 0) { 192 if (pci_intr_map(pa, &intrhandle) != 0) {
196 aprint_error_dev(self, "couldn't map interrupt\n"); 193 aprint_error_dev(self, "couldn't map interrupt\n");
197 return; 194 return;
198 } 195 }
199 intrstr = pci_intr_string(pa->pa_pc, intrhandle); 196 intrstr = pci_intr_string(pa->pa_pc, intrhandle);
200 psc->sc_ih = pci_intr_establish(pa->pa_pc, intrhandle, IPL_BIO, ahci_intr, sc); 197 psc->sc_ih = pci_intr_establish(pa->pa_pc, intrhandle, IPL_BIO, ahci_intr, sc);
201 if (psc->sc_ih == NULL) { 198 if (psc->sc_ih == NULL) {
202 aprint_error_dev(self, "couldn't establish interrupt\n"); 199 aprint_error_dev(self, "couldn't establish interrupt\n");
203 return; 200 return;
204 } 201 }
205 aprint_normal_dev(self, "interrupting at %s\n", 202 aprint_normal_dev(self, "interrupting at %s\n",
206 intrstr ? intrstr : "unknown interrupt"); 203 intrstr ? intrstr : "unknown interrupt");

cvs diff -r1.26 -r1.27 src/sys/dev/pci/ubsec.c (expand / switch to unified diff)

--- src/sys/dev/pci/ubsec.c 2011/11/19 22:51:24 1.26
+++ src/sys/dev/pci/ubsec.c 2012/01/30 19:41:23 1.27
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ubsec.c,v 1.26 2011/11/19 22:51:24 tls Exp $ */ 1/* $NetBSD: ubsec.c,v 1.27 2012/01/30 19:41:23 drochner Exp $ */
2/* $FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.6.2.6 2003/01/23 21:06:43 sam Exp $ */ 2/* $FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.6.2.6 2003/01/23 21:06:43 sam Exp $ */
3/* $OpenBSD: ubsec.c,v 1.127 2003/06/04 14:04:58 jason Exp $ */ 3/* $OpenBSD: ubsec.c,v 1.127 2003/06/04 14:04:58 jason Exp $ */
4 4
5/* 5/*
6 * Copyright (c) 2000 Jason L. Wright (jason@thought.net) 6 * Copyright (c) 2000 Jason L. Wright (jason@thought.net)
7 * Copyright (c) 2000 Theo de Raadt (deraadt@openbsd.org) 7 * Copyright (c) 2000 Theo de Raadt (deraadt@openbsd.org)
8 * Copyright (c) 2001 Patrik Lindergren (patrik@ipunplugged.com) 8 * Copyright (c) 2001 Patrik Lindergren (patrik@ipunplugged.com)
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 * 30 *
31 * Effort sponsored in part by the Defense Advanced Research Projects 31 * Effort sponsored in part by the Defense Advanced Research Projects
32 * Agency (DARPA) and Air Force Research Laboratory, Air Force 32 * Agency (DARPA) and Air Force Research Laboratory, Air Force
33 * Materiel Command, USAF, under agreement number F30602-01-2-0537. 33 * Materiel Command, USAF, under agreement number F30602-01-2-0537.
34 * 34 *
35 */ 35 */
36 36
37#include <sys/cdefs.h> 37#include <sys/cdefs.h>
38__KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.26 2011/11/19 22:51:24 tls Exp $"); 38__KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.27 2012/01/30 19:41:23 drochner Exp $");
39 39
40#undef UBSEC_DEBUG 40#undef UBSEC_DEBUG
41 41
42/* 42/*
43 * uBsec 5[56]01, bcm580xx, bcm582x hardware crypto accelerator 43 * uBsec 5[56]01, bcm580xx, bcm582x hardware crypto accelerator
44 */ 44 */
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/proc.h> 48#include <sys/proc.h>
49#include <sys/endian.h> 49#include <sys/endian.h>
50#ifdef __NetBSD__ 50#ifdef __NetBSD__
51 #define letoh16 htole16 51 #define letoh16 htole16
@@ -303,29 +303,27 @@ ubsec_attach(device_t parent, device_t s @@ -303,29 +303,27 @@ ubsec_attach(device_t parent, device_t s
303 const struct ubsec_product *up; 303 const struct ubsec_product *up;
304 pci_chipset_tag_t pc = pa->pa_pc; 304 pci_chipset_tag_t pc = pa->pa_pc;
305 pci_intr_handle_t ih; 305 pci_intr_handle_t ih;
306 const char *intrstr = NULL; 306 const char *intrstr = NULL;
307 struct ubsec_dma *dmap; 307 struct ubsec_dma *dmap;
308 u_int32_t cmd, i; 308 u_int32_t cmd, i;
309 309
310 up = ubsec_lookup(pa); 310 up = ubsec_lookup(pa);
311 if (up == NULL) { 311 if (up == NULL) {
312 printf("\n"); 312 printf("\n");
313 panic("ubsec_attach: impossible"); 313 panic("ubsec_attach: impossible");
314 } 314 }
315 315
316 aprint_naive(": Crypto processor\n"); 316 pci_aprint_devinfo_fancy(pa, "Crypto processor", up->ubsec_name, 1);
317 aprint_normal(": %s, rev. %d\n", up->ubsec_name, 
318 PCI_REVISION(pa->pa_class)); 
319 317
320 SIMPLEQ_INIT(&sc->sc_queue); 318 SIMPLEQ_INIT(&sc->sc_queue);
321 SIMPLEQ_INIT(&sc->sc_qchip); 319 SIMPLEQ_INIT(&sc->sc_qchip);
322 SIMPLEQ_INIT(&sc->sc_queue2); 320 SIMPLEQ_INIT(&sc->sc_queue2);
323 SIMPLEQ_INIT(&sc->sc_qchip2); 321 SIMPLEQ_INIT(&sc->sc_qchip2);
324 SIMPLEQ_INIT(&sc->sc_q2free); 322 SIMPLEQ_INIT(&sc->sc_q2free);
325 323
326 sc->sc_flags = up->ubsec_flags; 324 sc->sc_flags = up->ubsec_flags;
327 sc->sc_statmask = up->ubsec_statmask; 325 sc->sc_statmask = up->ubsec_statmask;
328 326
329 cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); 327 cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
330 cmd |= PCI_COMMAND_MASTER_ENABLE; 328 cmd |= PCI_COMMAND_MASTER_ENABLE;
331 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, cmd); 329 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, cmd);

cvs diff -r1.34 -r1.35 src/sys/dev/pci/amdpm.c (expand / switch to unified diff)

--- src/sys/dev/pci/amdpm.c 2010/02/07 20:55:46 1.34
+++ src/sys/dev/pci/amdpm.c 2012/01/30 19:41:18 1.35
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: amdpm.c,v 1.34 2010/02/07 20:55:46 pgoyette Exp $ */ 1/* $NetBSD: amdpm.c,v 1.35 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Enami Tsugutomo. 8 * by Enami Tsugutomo.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: amdpm.c,v 1.34 2010/02/07 20:55:46 pgoyette Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: amdpm.c,v 1.35 2012/01/30 19:41:18 drochner Exp $");
34 34
35#include "opt_amdpm.h" 35#include "opt_amdpm.h"
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/callout.h> 41#include <sys/callout.h>
42#include <sys/rnd.h> 42#include <sys/rnd.h>
43 43
44#include <sys/bus.h> 44#include <sys/bus.h>
45#include <dev/ic/acpipmtimer.h> 45#include <dev/ic/acpipmtimer.h>
46 46
@@ -77,35 +77,31 @@ amdpm_match(device_t parent, cfdata_t ma @@ -77,35 +77,31 @@ amdpm_match(device_t parent, cfdata_t ma
77 case PCI_PRODUCT_NVIDIA_XBOX_SMBUS: 77 case PCI_PRODUCT_NVIDIA_XBOX_SMBUS:
78 return (1); 78 return (1);
79 } 79 }
80 } 80 }
81 81
82 return (0); 82 return (0);
83} 83}
84 84
85static void 85static void
86amdpm_attach(device_t parent, device_t self, void *aux) 86amdpm_attach(device_t parent, device_t self, void *aux)
87{ 87{
88 struct amdpm_softc *sc = device_private(self); 88 struct amdpm_softc *sc = device_private(self);
89 struct pci_attach_args *pa = aux; 89 struct pci_attach_args *pa = aux;
90 char devinfo[256]; 
91 pcireg_t confreg, pmptrreg; 90 pcireg_t confreg, pmptrreg;
92 u_int32_t pmreg; 91 u_int32_t pmreg;
93 int i; 92 int i;
94 93
95 aprint_naive("\n"); 94 pci_aprint_devinfo(pa, NULL);
96 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
97 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
98 PCI_REVISION(pa->pa_class)); 
99 95
100 if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NVIDIA_XBOX_SMBUS) 96 if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NVIDIA_XBOX_SMBUS)
101 sc->sc_nforce = 1; 97 sc->sc_nforce = 1;
102 else 98 else
103 sc->sc_nforce = 0; 99 sc->sc_nforce = 0;
104 100
105 sc->sc_pc = pa->pa_pc; 101 sc->sc_pc = pa->pa_pc;
106 sc->sc_tag = pa->pa_tag; 102 sc->sc_tag = pa->pa_tag;
107 sc->sc_iot = pa->pa_iot; 103 sc->sc_iot = pa->pa_iot;
108 sc->sc_pa = pa; 104 sc->sc_pa = pa;
109 105
110#if 0 106#if 0
111 aprint_normal_dev(&sc->sc_dev, ""); 107 aprint_normal_dev(&sc->sc_dev, "");

cvs diff -r1.37 -r1.38 src/sys/dev/pci/auixp.c (expand / switch to unified diff)

--- src/sys/dev/pci/auixp.c 2011/12/02 11:58:44 1.37
+++ src/sys/dev/pci/auixp.c 2012/01/30 19:41:18 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: auixp.c,v 1.37 2011/12/02 11:58:44 jmcneill Exp $ */ 1/* $NetBSD: auixp.c,v 1.38 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2004, 2005 Reinoud Zandijk <reinoud@netbsd.org> 4 * Copyright (c) 2004, 2005 Reinoud Zandijk <reinoud@netbsd.org>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. The name of the author may not be used to endorse or promote products 12 * 2. The name of the author may not be used to endorse or promote products
13 * derived from this software without specific prior written permission. 13 * derived from this software without specific prior written permission.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -40,27 +40,27 @@ @@ -40,27 +40,27 @@
40 * encodings. 40 * encodings.
41 * 41 *
42 * Known problems and issues : 42 * Known problems and issues :
43 * - SPDIF is untested and needs some work still (LED stays off) 43 * - SPDIF is untested and needs some work still (LED stays off)
44 * - 32 bit audio playback failed last time i tried but that might an AC'97 44 * - 32 bit audio playback failed last time i tried but that might an AC'97
45 * codec support problem. 45 * codec support problem.
46 * - 32 bit recording works but can't try out playing: see above. 46 * - 32 bit recording works but can't try out playing: see above.
47 * - no suspend/resume support yet. 47 * - no suspend/resume support yet.
48 * - multiple codecs are `supported' but not tested; the implemetation needs 48 * - multiple codecs are `supported' but not tested; the implemetation needs
49 * some cleaning up. 49 * some cleaning up.
50 */ 50 */
51 51
52#include <sys/cdefs.h> 52#include <sys/cdefs.h>
53__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.37 2011/12/02 11:58:44 jmcneill Exp $"); 53__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.38 2012/01/30 19:41:18 drochner Exp $");
54 54
55#include <sys/types.h> 55#include <sys/types.h>
56#include <sys/errno.h> 56#include <sys/errno.h>
57#include <sys/null.h> 57#include <sys/null.h>
58#include <sys/param.h> 58#include <sys/param.h>
59#include <sys/systm.h> 59#include <sys/systm.h>
60#include <sys/kmem.h> 60#include <sys/kmem.h>
61#include <sys/device.h> 61#include <sys/device.h>
62#include <sys/conf.h> 62#include <sys/conf.h>
63#include <sys/exec.h> 63#include <sys/exec.h>
64#include <sys/select.h> 64#include <sys/select.h>
65#include <sys/audioio.h> 65#include <sys/audioio.h>
66#include <sys/queue.h> 66#include <sys/queue.h>
@@ -1090,43 +1090,38 @@ auixp_match(device_t dev, cfdata_t match @@ -1090,43 +1090,38 @@ auixp_match(device_t dev, cfdata_t match
1090 1090
1091/* it is... now hook up and set up the resources we need */ 1091/* it is... now hook up and set up the resources we need */
1092static void 1092static void
1093auixp_attach(device_t parent, device_t self, void *aux) 1093auixp_attach(device_t parent, device_t self, void *aux)
1094{ 1094{
1095 struct auixp_softc *sc; 1095 struct auixp_softc *sc;
1096 struct pci_attach_args *pa; 1096 struct pci_attach_args *pa;
1097 pcitag_t tag; 1097 pcitag_t tag;
1098 pci_chipset_tag_t pc; 1098 pci_chipset_tag_t pc;
1099 pci_intr_handle_t ih; 1099 pci_intr_handle_t ih;
1100 const struct auixp_card_type *card; 1100 const struct auixp_card_type *card;
1101 const char *intrstr; 1101 const char *intrstr;
1102 uint32_t data; 1102 uint32_t data;
1103 char devinfo[256]; 1103 int error;
1104 int revision, error; 
1105 1104
1106 sc = device_private(self); 1105 sc = device_private(self);
1107 pa = (struct pci_attach_args *)aux; 1106 pa = (struct pci_attach_args *)aux;
1108 tag = pa->pa_tag; 1107 tag = pa->pa_tag;
1109 pc = pa->pa_pc; 1108 pc = pa->pa_pc;
1110#ifdef DEBUG_AUIXP 1109#ifdef DEBUG_AUIXP
1111 static_sc = sc; 1110 static_sc = sc;
1112#endif 1111#endif
1113 1112
1114 /* print information confirming attachment */ 1113 /* print information confirming attachment */
1115 aprint_naive(": Audio controller\n"); 1114 pci_aprint_devinfo(pa, "Audio controller");
1116 
1117 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
1118 revision = PCI_REVISION(pa->pa_class); 
1119 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision); 
1120 1115
1121 /* set up details from our set of known `cards'/chips */ 1116 /* set up details from our set of known `cards'/chips */
1122 for (card = auixp_card_types; card->pci_vendor_id; card++) 1117 for (card = auixp_card_types; card->pci_vendor_id; card++)
1123 if (PCI_VENDOR(pa->pa_id) == card->pci_vendor_id && 1118 if (PCI_VENDOR(pa->pa_id) == card->pci_vendor_id &&
1124 PCI_PRODUCT(pa->pa_id) == card->pci_product_id) { 1119 PCI_PRODUCT(pa->pa_id) == card->pci_product_id) {
1125 sc->type = card->type; 1120 sc->type = card->type;
1126 break; 1121 break;
1127 } 1122 }
1128 1123
1129 /* device only has 32 bit non prefetchable memory */ 1124 /* device only has 32 bit non prefetchable memory */
1130 /* set MEM space access and enable the card's busmastering */ 1125 /* set MEM space access and enable the card's busmastering */
1131 data = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); 1126 data = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
1132 data |= (PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE); 1127 data |= (PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE);

cvs diff -r1.37 -r1.38 src/sys/dev/pci/voodoofb.c (expand / switch to unified diff)

--- src/sys/dev/pci/voodoofb.c 2012/01/25 03:49:12 1.37
+++ src/sys/dev/pci/voodoofb.c 2012/01/30 19:41:23 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: voodoofb.c,v 1.37 2012/01/25 03:49:12 macallan Exp $ */ 1/* $NetBSD: voodoofb.c,v 1.38 2012/01/30 19:41:23 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2005, 2006 Michael Lorenz 4 * Copyright (c) 2005, 2006 Michael Lorenz
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28/*  28/*
29 * A console driver for 3Dfx Voodoo3 graphics boards  29 * A console driver for 3Dfx Voodoo3 graphics boards
30 * Thanks to Andreas Drewke (andreas_dr@gmx.de) for his Voodoo3 driver for BeOS  30 * Thanks to Andreas Drewke (andreas_dr@gmx.de) for his Voodoo3 driver for BeOS
31 * which I used as reference / documentation 31 * which I used as reference / documentation
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.37 2012/01/25 03:49:12 macallan Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.38 2012/01/30 19:41:23 drochner Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/malloc.h> 41#include <sys/malloc.h>
42#include <sys/callout.h> 42#include <sys/callout.h>
43#include <sys/kauth.h> 43#include <sys/kauth.h>
44 44
45#include <dev/pci/pcivar.h> 45#include <dev/pci/pcivar.h>
46#include <dev/pci/pcireg.h> 46#include <dev/pci/pcireg.h>
47#include <dev/pci/pcidevs.h> 47#include <dev/pci/pcidevs.h>
48#include <dev/pci/pciio.h> 48#include <dev/pci/pciio.h>
@@ -337,47 +337,45 @@ voodoofb_match(device_t parent, cfdata_t @@ -337,47 +337,45 @@ voodoofb_match(device_t parent, cfdata_t
337 PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_DISPLAY_VGA) 337 PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_DISPLAY_VGA)
338 return 0; 338 return 0;
339 if ((PCI_VENDOR(pa->pa_id)==PCI_VENDOR_3DFX) &&  339 if ((PCI_VENDOR(pa->pa_id)==PCI_VENDOR_3DFX) &&
340 (PCI_PRODUCT(pa->pa_id)>=PCI_PRODUCT_3DFX_VOODOO3)) 340 (PCI_PRODUCT(pa->pa_id)>=PCI_PRODUCT_3DFX_VOODOO3))
341 return 100; 341 return 100;
342 return 0; 342 return 0;
343} 343}
344 344
345static void 345static void
346voodoofb_attach(device_t parent, device_t self, void *aux) 346voodoofb_attach(device_t parent, device_t self, void *aux)
347{ 347{
348 struct voodoofb_softc *sc = device_private(self);  348 struct voodoofb_softc *sc = device_private(self);
349 struct pci_attach_args *pa = aux; 349 struct pci_attach_args *pa = aux;
350 char devinfo[256]; 
351 struct wsemuldisplaydev_attach_args aa; 350 struct wsemuldisplaydev_attach_args aa;
352 struct rasops_info *ri; 351 struct rasops_info *ri;
353#ifdef VOODOOFB_ENABLE_INTR 352#ifdef VOODOOFB_ENABLE_INTR
354 pci_intr_handle_t ih; 353 pci_intr_handle_t ih;
355 const char *intrstr; 354 const char *intrstr;
356#endif 355#endif
357 ulong defattr; 356 ulong defattr;
358 int console, width, height, i, j; 357 int console, width, height, i, j;
359 prop_dictionary_t dict; 358 prop_dictionary_t dict;
360 int linebytes, depth, flags; 359 int linebytes, depth, flags;
361 uint32_t bg, fg, ul; 360 uint32_t bg, fg, ul;
362 361
363 sc->sc_dev = self; 362 sc->sc_dev = self;
364 363
365 sc->sc_mode = WSDISPLAYIO_MODE_EMUL; 364 sc->sc_mode = WSDISPLAYIO_MODE_EMUL;
366 sc->sc_pc = pa->pa_pc; 365 sc->sc_pc = pa->pa_pc;
367 sc->sc_pcitag = pa->pa_tag; 366 sc->sc_pcitag = pa->pa_tag;
368 sc->sc_dacw = -1; 367 sc->sc_dacw = -1;
369 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 368 pci_aprint_devinfo(pa, NULL);
370 printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class)); 
371 369
372 sc->sc_memt = pa->pa_memt; 370 sc->sc_memt = pa->pa_memt;
373 sc->sc_iot = pa->pa_iot; 371 sc->sc_iot = pa->pa_iot;
374 sc->sc_pa = *pa; 372 sc->sc_pa = *pa;
375 373
376 /* the framebuffer */ 374 /* the framebuffer */
377 if (pci_mapreg_info(sc->sc_pc, sc->sc_pcitag, 0x14, PCI_MAPREG_TYPE_MEM, 375 if (pci_mapreg_info(sc->sc_pc, sc->sc_pcitag, 0x14, PCI_MAPREG_TYPE_MEM,
378 &sc->sc_fb, &sc->sc_fbsize, &flags)) { 376 &sc->sc_fb, &sc->sc_fbsize, &flags)) {
379 aprint_error_dev(self, "failed to map the frame buffer.\n"); 377 aprint_error_dev(self, "failed to map the frame buffer.\n");
380 } 378 }
381 sc->sc_memsize = sc->sc_fbsize >> 1; /* VRAM aperture is 2x VRAM */ 379 sc->sc_memsize = sc->sc_fbsize >> 1; /* VRAM aperture is 2x VRAM */
382 380
383 /* memory-mapped registers */ 381 /* memory-mapped registers */

cvs diff -r1.48 -r1.49 src/sys/dev/pci/autri.c (expand / switch to unified diff)

--- src/sys/dev/pci/autri.c 2011/11/24 03:35:58 1.48
+++ src/sys/dev/pci/autri.c 2012/01/30 19:41:18 1.49
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: autri.c,v 1.48 2011/11/24 03:35:58 mrg Exp $ */ 1/* $NetBSD: autri.c,v 1.49 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro. 4 * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28/* 28/*
29 * Trident 4DWAVE-DX/NX, SiS 7018, ALi M5451 Sound Driver 29 * Trident 4DWAVE-DX/NX, SiS 7018, ALi M5451 Sound Driver
30 * 30 *
31 * The register information is taken from the ALSA driver. 31 * The register information is taken from the ALSA driver.
32 * 32 *
33 * Documentation links: 33 * Documentation links:
34 * - ftp://ftp.alsa-project.org/pub/manuals/trident/ 34 * - ftp://ftp.alsa-project.org/pub/manuals/trident/
35 */ 35 */
36 36
37#include <sys/cdefs.h> 37#include <sys/cdefs.h>
38__KERNEL_RCSID(0, "$NetBSD: autri.c,v 1.48 2011/11/24 03:35:58 mrg Exp $"); 38__KERNEL_RCSID(0, "$NetBSD: autri.c,v 1.49 2012/01/30 19:41:18 drochner Exp $");
39 39
40#include "midi.h" 40#include "midi.h"
41 41
42#include <sys/param.h> 42#include <sys/param.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44#include <sys/kernel.h> 44#include <sys/kernel.h>
45#include <sys/fcntl.h> 45#include <sys/fcntl.h>
46#include <sys/kmem.h> 46#include <sys/kmem.h>
47#include <sys/device.h> 47#include <sys/device.h>
48#include <sys/proc.h> 48#include <sys/proc.h>
49#include <sys/audioio.h> 49#include <sys/audioio.h>
50#include <sys/bus.h> 50#include <sys/bus.h>
51#include <sys/intr.h> 51#include <sys/intr.h>
@@ -510,41 +510,38 @@ autri_match(device_t parent, cfdata_t ma @@ -510,41 +510,38 @@ autri_match(device_t parent, cfdata_t ma
510 510
511 return 0; 511 return 0;
512} 512}
513 513
514static void 514static void
515autri_attach(device_t parent, device_t self, void *aux) 515autri_attach(device_t parent, device_t self, void *aux)
516{ 516{
517 struct autri_softc *sc; 517 struct autri_softc *sc;
518 struct pci_attach_args *pa; 518 struct pci_attach_args *pa;
519 pci_chipset_tag_t pc; 519 pci_chipset_tag_t pc;
520 struct autri_codec_softc *codec; 520 struct autri_codec_softc *codec;
521 pci_intr_handle_t ih; 521 pci_intr_handle_t ih;
522 char const *intrstr; 522 char const *intrstr;
523 char devinfo[256]; 
524 int r; 523 int r;
525 uint32_t reg; 524 uint32_t reg;
526 525
527 sc = device_private(self); 526 sc = device_private(self);
528 pa = (struct pci_attach_args *)aux; 527 pa = (struct pci_attach_args *)aux;
529 pc = pa->pa_pc; 528 pc = pa->pa_pc;
530 aprint_naive(": Audio controller\n"); 
531 529
532 sc->sc_devid = pa->pa_id; 530 sc->sc_devid = pa->pa_id;
533 sc->sc_class = pa->pa_class; 531 sc->sc_class = pa->pa_class;
534 532
535 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 533 pci_aprint_devinfo(pa, "Audio controller");
536 sc->sc_revision = PCI_REVISION(pa->pa_class); 534 sc->sc_revision = PCI_REVISION(pa->pa_class);
537 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, sc->sc_revision); 
538 535
539 /* map register to memory */ 536 /* map register to memory */
540 if (pci_mapreg_map(pa, AUTRI_PCI_MEMORY_BASE, 537 if (pci_mapreg_map(pa, AUTRI_PCI_MEMORY_BASE,
541 PCI_MAPREG_TYPE_MEM, 0, &sc->memt, &sc->memh, NULL, NULL)) { 538 PCI_MAPREG_TYPE_MEM, 0, &sc->memt, &sc->memh, NULL, NULL)) {
542 aprint_error_dev(&sc->sc_dev, "can't map memory space\n"); 539 aprint_error_dev(&sc->sc_dev, "can't map memory space\n");
543 return; 540 return;
544 } 541 }
545 542
546 mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); 543 mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
547 mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_AUDIO); 544 mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_AUDIO);
548 545
549 /* map and establish the interrupt */ 546 /* map and establish the interrupt */
550 if (pci_intr_map(pa, &ih)) { 547 if (pci_intr_map(pa, &ih)) {

cvs diff -r1.48 -r1.49 src/sys/dev/pci/hifn7751.c (expand / switch to unified diff)

--- src/sys/dev/pci/hifn7751.c 2011/11/29 03:50:31 1.48
+++ src/sys/dev/pci/hifn7751.c 2012/01/30 19:41:19 1.49
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: hifn7751.c,v 1.48 2011/11/29 03:50:31 tls Exp $ */ 1/* $NetBSD: hifn7751.c,v 1.49 2012/01/30 19:41:19 drochner Exp $ */
2/* $FreeBSD: hifn7751.c,v 1.5.2.7 2003/10/08 23:52:00 sam Exp $ */ 2/* $FreeBSD: hifn7751.c,v 1.5.2.7 2003/10/08 23:52:00 sam Exp $ */
3/* $OpenBSD: hifn7751.c,v 1.140 2003/08/01 17:55:54 deraadt Exp $ */ 3/* $OpenBSD: hifn7751.c,v 1.140 2003/08/01 17:55:54 deraadt Exp $ */
4 4
5/* 5/*
6 * Invertex AEON / Hifn 7751 driver 6 * Invertex AEON / Hifn 7751 driver
7 * Copyright (c) 1999 Invertex Inc. All rights reserved. 7 * Copyright (c) 1999 Invertex Inc. All rights reserved.
8 * Copyright (c) 1999 Theo de Raadt 8 * Copyright (c) 1999 Theo de Raadt
9 * Copyright (c) 2000-2001 Network Security Technologies, Inc. 9 * Copyright (c) 2000-2001 Network Security Technologies, Inc.
10 * http://www.netsec.net 10 * http://www.netsec.net
11 * Copyright (c) 2003 Hifn Inc. 11 * Copyright (c) 2003 Hifn Inc.
12 * 12 *
13 * This driver is based on a previous driver by Invertex, for which they 13 * This driver is based on a previous driver by Invertex, for which they
14 * requested: Please send any comments, feedback, bug-fixes, or feature 14 * requested: Please send any comments, feedback, bug-fixes, or feature
@@ -38,27 +38,27 @@ @@ -38,27 +38,27 @@
38 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 * 39 *
40 * Effort sponsored in part by the Defense Advanced Research Projects 40 * Effort sponsored in part by the Defense Advanced Research Projects
41 * Agency (DARPA) and Air Force Research Laboratory, Air Force 41 * Agency (DARPA) and Air Force Research Laboratory, Air Force
42 * Materiel Command, USAF, under agreement number F30602-01-2-0537. 42 * Materiel Command, USAF, under agreement number F30602-01-2-0537.
43 * 43 *
44 */ 44 */
45 45
46/* 46/*
47 * Driver for various Hifn pre-HIPP encryption processors. 47 * Driver for various Hifn pre-HIPP encryption processors.
48 */ 48 */
49 49
50#include <sys/cdefs.h> 50#include <sys/cdefs.h>
51__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.48 2011/11/29 03:50:31 tls Exp $"); 51__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.49 2012/01/30 19:41:19 drochner Exp $");
52 52
53#include <sys/param.h> 53#include <sys/param.h>
54#include <sys/systm.h> 54#include <sys/systm.h>
55#include <sys/proc.h> 55#include <sys/proc.h>
56#include <sys/errno.h> 56#include <sys/errno.h>
57#include <sys/malloc.h> 57#include <sys/malloc.h>
58#include <sys/kernel.h> 58#include <sys/kernel.h>
59#include <sys/mbuf.h> 59#include <sys/mbuf.h>
60#include <sys/device.h> 60#include <sys/device.h>
61 61
62#ifdef __OpenBSD__ 62#ifdef __OpenBSD__
63#include <crypto/crypto.h> 63#include <crypto/crypto.h>
64#include <dev/rndvar.h> 64#include <dev/rndvar.h>
@@ -244,29 +244,27 @@ hifn_attach(device_t parent, device_t se @@ -244,29 +244,27 @@ hifn_attach(device_t parent, device_t se
244 u_int32_t cmd; 244 u_int32_t cmd;
245 u_int16_t ena; 245 u_int16_t ena;
246 bus_dma_segment_t seg; 246 bus_dma_segment_t seg;
247 bus_dmamap_t dmamap; 247 bus_dmamap_t dmamap;
248 int rseg; 248 int rseg;
249 void *kva; 249 void *kva;
250 250
251 hp = hifn_lookup(pa); 251 hp = hifn_lookup(pa);
252 if (hp == NULL) { 252 if (hp == NULL) {
253 printf("\n"); 253 printf("\n");
254 panic("hifn_attach: impossible"); 254 panic("hifn_attach: impossible");
255 } 255 }
256 256
257 aprint_naive(": Crypto processor\n"); 257 pci_aprint_devinfo_fancy(pa, "Crypto processor", hp->hifn_name, 1);
258 aprint_normal(": %s, rev. %d\n", hp->hifn_name, 
259 PCI_REVISION(pa->pa_class)); 
260 258
261 sc->sc_pci_pc = pa->pa_pc; 259 sc->sc_pci_pc = pa->pa_pc;
262 sc->sc_pci_tag = pa->pa_tag; 260 sc->sc_pci_tag = pa->pa_tag;
263 261
264 sc->sc_flags = hp->hifn_flags; 262 sc->sc_flags = hp->hifn_flags;
265 263
266 cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); 264 cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
267 cmd |= PCI_COMMAND_MASTER_ENABLE; 265 cmd |= PCI_COMMAND_MASTER_ENABLE;
268 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, cmd); 266 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, cmd);
269 267
270 if (pci_mapreg_map(pa, HIFN_BAR0, PCI_MAPREG_TYPE_MEM, 0, 268 if (pci_mapreg_map(pa, HIFN_BAR0, PCI_MAPREG_TYPE_MEM, 0,
271 &sc->sc_st0, &sc->sc_sh0, NULL, &iosize0)) { 269 &sc->sc_st0, &sc->sc_sh0, NULL, &iosize0)) {
272 aprint_error_dev(&sc->sc_dv, "can't map mem space %d\n", 0); 270 aprint_error_dev(&sc->sc_dv, "can't map mem space %d\n", 0);

cvs diff -r1.27 -r1.28 src/sys/dev/pci/btvmei.c (expand / switch to unified diff)

--- src/sys/dev/pci/btvmei.c 2012/01/27 18:53:08 1.27
+++ src/sys/dev/pci/btvmei.c 2012/01/30 19:41:18 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: btvmei.c,v 1.27 2012/01/27 18:53:08 para Exp $ */ 1/* $NetBSD: btvmei.c,v 1.28 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 4 * Copyright (c) 1999
5 * Matthias Drochner. All rights reserved. 5 * Matthias Drochner. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 * 28 *
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.27 2012/01/27 18:53:08 para Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.28 2012/01/30 19:41:18 drochner Exp $");
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/systm.h> 35#include <sys/systm.h>
36#include <sys/kernel.h> 36#include <sys/kernel.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/proc.h> 38#include <sys/proc.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
40 40
41#include <sys/bus.h> 41#include <sys/bus.h>
42#include <sys/extent.h> 42#include <sys/extent.h>
43 43
44#include <dev/pci/pcireg.h> 44#include <dev/pci/pcireg.h>
45#include <dev/pci/pcivar.h> 45#include <dev/pci/pcivar.h>
@@ -80,39 +80,34 @@ b3_617_match(device_t parent, cfdata_t m @@ -80,39 +80,34 @@ b3_617_match(device_t parent, cfdata_t m
80 if ((PCI_VENDOR(pa->pa_id) != PCI_VENDOR_BIT3) 80 if ((PCI_VENDOR(pa->pa_id) != PCI_VENDOR_BIT3)
81 || (PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_BIT3_PCIVME617)) 81 || (PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_BIT3_PCIVME617))
82 return (0); 82 return (0);
83 return (1); 83 return (1);
84} 84}
85 85
86static void 86static void
87b3_617_attach(device_t parent, device_t self, void *aux) 87b3_617_attach(device_t parent, device_t self, void *aux)
88{ 88{
89 struct b3_617_softc *sc = device_private(self); 89 struct b3_617_softc *sc = device_private(self);
90 struct pci_attach_args *pa = aux; 90 struct pci_attach_args *pa = aux;
91 pci_chipset_tag_t pc = pa->pa_pc; 91 pci_chipset_tag_t pc = pa->pa_pc;
92 92
93 int rev; 
94 
95 pci_intr_handle_t ih; 93 pci_intr_handle_t ih;
96 const char *intrstr; 94 const char *intrstr;
97 struct vmebus_attach_args vaa; 95 struct vmebus_attach_args vaa;
98 96
99 aprint_naive(": VME bus adapter\n"); 
100 
101 sc->sc_pc = pc; 97 sc->sc_pc = pc;
102 sc->sc_dmat = pa->pa_dmat; 98 sc->sc_dmat = pa->pa_dmat;
103 99
104 rev = PCI_REVISION(pci_conf_read(pc, pa->pa_tag, PCI_CLASS_REG)); 100 pci_aprint_devinfo_fancy(pa, "VME bus adapter", "BIT3 PCI-VME 617", 1);
105 aprint_normal(": BIT3 PCI-VME 617 rev %d\n", rev); 
106 101
107 /* 102 /*
108 * Map CSR and mapping table spaces. 103 * Map CSR and mapping table spaces.
109 * Don't map VME window; parts are mapped as needed to 104 * Don't map VME window; parts are mapped as needed to
110 * save kernel virtual memory space 105 * save kernel virtual memory space
111 */ 106 */
112 if (pci_mapreg_map(pa, 0x14, 107 if (pci_mapreg_map(pa, 0x14,
113 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 108 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
114 0, &sc->csrt, &sc->csrh, NULL, NULL) && 109 0, &sc->csrt, &sc->csrh, NULL, NULL) &&
115 pci_mapreg_map(pa, 0x10, 110 pci_mapreg_map(pa, 0x10,
116 PCI_MAPREG_TYPE_IO, 111 PCI_MAPREG_TYPE_IO,
117 0, &sc->csrt, &sc->csrh, NULL, NULL)) { 112 0, &sc->csrt, &sc->csrh, NULL, NULL)) {
118 aprint_error_dev(self, "can't map CSR space\n"); 113 aprint_error_dev(self, "can't map CSR space\n");

cvs diff -r1.27 -r1.28 src/sys/dev/pci/r128fb.c (expand / switch to unified diff)

--- src/sys/dev/pci/r128fb.c 2012/01/11 16:02:29 1.27
+++ src/sys/dev/pci/r128fb.c 2012/01/30 19:41:22 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: r128fb.c,v 1.27 2012/01/11 16:02:29 macallan Exp $ */ 1/* $NetBSD: r128fb.c,v 1.28 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007 Michael Lorenz 4 * Copyright (c) 2007 Michael Lorenz
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28/* 28/*
29 * A console driver for ATI Rage 128 graphics controllers 29 * A console driver for ATI Rage 128 graphics controllers
30 * tested on macppc only so far 30 * tested on macppc only so far
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.27 2012/01/11 16:02:29 macallan Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.28 2012/01/30 19:41:22 drochner Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41#include <sys/lwp.h> 41#include <sys/lwp.h>
42#include <sys/kauth.h> 42#include <sys/kauth.h>
43 43
44#include <dev/videomode/videomode.h> 44#include <dev/videomode/videomode.h>
45 45
46#include <dev/pci/pcivar.h> 46#include <dev/pci/pcivar.h>
47#include <dev/pci/pcireg.h> 47#include <dev/pci/pcireg.h>
@@ -188,43 +188,41 @@ r128fb_match(device_t parent, cfdata_t m @@ -188,43 +188,41 @@ r128fb_match(device_t parent, cfdata_t m
188 (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ATI_RAGEGLPCI) || 188 (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ATI_RAGEGLPCI) ||
189 (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ATI_RAGE_MOB_M3_AGP)) 189 (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ATI_RAGE_MOB_M3_AGP))
190 return 100; 190 return 100;
191 return (0); 191 return (0);
192} 192}
193 193
194static void 194static void
195r128fb_attach(device_t parent, device_t self, void *aux) 195r128fb_attach(device_t parent, device_t self, void *aux)
196{ 196{
197 struct r128fb_softc *sc = device_private(self); 197 struct r128fb_softc *sc = device_private(self);
198 struct pci_attach_args *pa = aux; 198 struct pci_attach_args *pa = aux;
199 struct rasops_info *ri; 199 struct rasops_info *ri;
200 bus_space_tag_t tag; 200 bus_space_tag_t tag;
201 char devinfo[256]; 
202 struct wsemuldisplaydev_attach_args aa; 201 struct wsemuldisplaydev_attach_args aa;
203 prop_dictionary_t dict; 202 prop_dictionary_t dict;
204 unsigned long defattr; 203 unsigned long defattr;
205 bool is_console; 204 bool is_console;
206 int i, j; 205 int i, j;
207 uint32_t reg, flags; 206 uint32_t reg, flags;
208 uint8_t tmp; 207 uint8_t tmp;
209 208
210 sc->sc_pc = pa->pa_pc; 209 sc->sc_pc = pa->pa_pc;
211 sc->sc_pcitag = pa->pa_tag; 210 sc->sc_pcitag = pa->pa_tag;
212 sc->sc_memt = pa->pa_memt; 211 sc->sc_memt = pa->pa_memt;
213 sc->sc_iot = pa->pa_iot; 212 sc->sc_iot = pa->pa_iot;
214 sc->sc_dev = self; 213 sc->sc_dev = self;
215 214
216 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 215 pci_aprint_devinfo(pa, NULL);
217 aprint_normal(": %s\n", devinfo); 
218 216
219 /* fill in parameters from properties */ 217 /* fill in parameters from properties */
220 dict = device_properties(self); 218 dict = device_properties(self);
221 if (!prop_dictionary_get_uint32(dict, "width", &sc->sc_width)) { 219 if (!prop_dictionary_get_uint32(dict, "width", &sc->sc_width)) {
222 aprint_error("%s: no width property\n", device_xname(self)); 220 aprint_error("%s: no width property\n", device_xname(self));
223 return; 221 return;
224 } 222 }
225 if (!prop_dictionary_get_uint32(dict, "height", &sc->sc_height)) { 223 if (!prop_dictionary_get_uint32(dict, "height", &sc->sc_height)) {
226 aprint_error("%s: no height property\n", device_xname(self)); 224 aprint_error("%s: no height property\n", device_xname(self));
227 return; 225 return;
228 } 226 }
229 if (!prop_dictionary_get_uint32(dict, "depth", &sc->sc_depth)) { 227 if (!prop_dictionary_get_uint32(dict, "depth", &sc->sc_depth)) {
230 aprint_error("%s: no depth property\n", device_xname(self)); 228 aprint_error("%s: no depth property\n", device_xname(self));

cvs diff -r1.30 -r1.31 src/sys/dev/pci/chipsfb.c (expand / switch to unified diff)

--- src/sys/dev/pci/chipsfb.c 2011/07/22 14:34:38 1.30
+++ src/sys/dev/pci/chipsfb.c 2012/01/30 19:41:18 1.31
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: chipsfb.c,v 1.30 2011/07/22 14:34:38 njoly Exp $ */ 1/* $NetBSD: chipsfb.c,v 1.31 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Michael Lorenz 4 * Copyright (c) 2006 Michael Lorenz
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28/* 28/*
29 * A console driver for Chips & Technologies 65550 graphics controllers 29 * A console driver for Chips & Technologies 65550 graphics controllers
30 * tested on macppc only so far 30 * tested on macppc only so far
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: chipsfb.c,v 1.30 2011/07/22 14:34:38 njoly Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: chipsfb.c,v 1.31 2012/01/30 19:41:18 drochner Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/kauth.h> 40#include <sys/kauth.h>
41 41
42#include <dev/pci/pcivar.h> 42#include <dev/pci/pcivar.h>
43#include <dev/pci/pcireg.h> 43#include <dev/pci/pcireg.h>
44#include <dev/pci/pcidevs.h> 44#include <dev/pci/pcidevs.h>
45#include <dev/pci/pciio.h> 45#include <dev/pci/pciio.h>
46#include <dev/pci/wsdisplay_pci.h> 46#include <dev/pci/wsdisplay_pci.h>
47 47
@@ -79,42 +79,39 @@ chipsfb_pci_match(device_t parent, cfdat @@ -79,42 +79,39 @@ chipsfb_pci_match(device_t parent, cfdat
79 return 100; 79 return 100;
80 if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_CHIPS) && 80 if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_CHIPS) &&
81 (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CHIPS_65554)) 81 (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CHIPS_65554))
82 return 100; 82 return 100;
83 return 0; 83 return 0;
84} 84}
85 85
86static void 86static void
87chipsfb_pci_attach(device_t parent, device_t self, void *aux) 87chipsfb_pci_attach(device_t parent, device_t self, void *aux)
88{ 88{
89 struct chipsfb_pci_softc *scp = device_private(self); 89 struct chipsfb_pci_softc *scp = device_private(self);
90 struct chipsfb_softc *sc = &scp->sc_chips; 90 struct chipsfb_softc *sc = &scp->sc_chips;
91 const struct pci_attach_args *pa = aux; 91 const struct pci_attach_args *pa = aux;
92 char devinfo[256]; 
93 pcireg_t screg; 92 pcireg_t screg;
94 93
95 scp->sc_pc = pa->pa_pc; 94 scp->sc_pc = pa->pa_pc;
96 scp->sc_pcitag = pa->pa_tag; 95 scp->sc_pcitag = pa->pa_tag;
97 sc->sc_dev = self; 96 sc->sc_dev = self;
98 97
99 screg = pci_conf_read(scp->sc_pc, scp->sc_pcitag, 98 screg = pci_conf_read(scp->sc_pc, scp->sc_pcitag,
100 PCI_COMMAND_STATUS_REG); 99 PCI_COMMAND_STATUS_REG);
101 screg |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE; 100 screg |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE;
102 pci_conf_write(scp->sc_pc, scp->sc_pcitag, PCI_COMMAND_STATUS_REG,  101 pci_conf_write(scp->sc_pc, scp->sc_pcitag, PCI_COMMAND_STATUS_REG,
103 screg); 102 screg);
104 103
105 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 104 pci_aprint_devinfo(pa, NULL);
106 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
107 PCI_REVISION(pa->pa_class)); 
108 105
109 sc->sc_memt = pa->pa_memt; 106 sc->sc_memt = pa->pa_memt;
110 sc->sc_iot = pa->pa_iot; 107 sc->sc_iot = pa->pa_iot;
111 sc->sc_ioctl = chipsfb_pci_ioctl; 108 sc->sc_ioctl = chipsfb_pci_ioctl;
112 sc->sc_mmap = NULL; 109 sc->sc_mmap = NULL;
113  110
114 /* the framebuffer */ 111 /* the framebuffer */
115 sc->sc_fb = (pci_conf_read(scp->sc_pc, scp->sc_pcitag, PCI_BAR0) &  112 sc->sc_fb = (pci_conf_read(scp->sc_pc, scp->sc_pcitag, PCI_BAR0) &
116 ~PCI_MAPREG_MEM_TYPE_MASK); 113 ~PCI_MAPREG_MEM_TYPE_MASK);
117 sc->sc_fbsize = 0x01000000; /* 16MB aperture */ 114 sc->sc_fbsize = 0x01000000; /* 16MB aperture */
118 115
119 if (bus_space_map(sc->sc_memt, sc->sc_fb, 0x400000, 116 if (bus_space_map(sc->sc_memt, sc->sc_fb, 0x400000,
120 BUS_SPACE_MAP_LINEAR, &sc->sc_fbh)) { 117 BUS_SPACE_MAP_LINEAR, &sc->sc_fbh)) {

cvs diff -r1.44 -r1.45 src/sys/dev/pci/cmpci.c (expand / switch to unified diff)

--- src/sys/dev/pci/cmpci.c 2011/11/24 03:35:58 1.44
+++ src/sys/dev/pci/cmpci.c 2012/01/30 19:41:18 1.45
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cmpci.c,v 1.44 2011/11/24 03:35:58 mrg Exp $ */ 1/* $NetBSD: cmpci.c,v 1.45 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000, 2001, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000, 2001, 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Takuya SHIOZAKI <tshiozak@NetBSD.org> . 8 * by Takuya SHIOZAKI <tshiozak@NetBSD.org> .
9 * 9 *
10 * This code is derived from software contributed to The NetBSD Foundation 10 * This code is derived from software contributed to The NetBSD Foundation
11 * by ITOH Yasufumi. 11 * by ITOH Yasufumi.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -33,27 +33,27 @@ @@ -33,27 +33,27 @@
33 * 33 *
34 */ 34 */
35 35
36/* 36/*
37 * C-Media CMI8x38 Audio Chip Support. 37 * C-Media CMI8x38 Audio Chip Support.
38 * 38 *
39 * TODO: 39 * TODO:
40 * - 4ch / 6ch support. 40 * - 4ch / 6ch support.
41 * - Joystick support. 41 * - Joystick support.
42 * 42 *
43 */ 43 */
44 44
45#include <sys/cdefs.h> 45#include <sys/cdefs.h>
46__KERNEL_RCSID(0, "$NetBSD: cmpci.c,v 1.44 2011/11/24 03:35:58 mrg Exp $"); 46__KERNEL_RCSID(0, "$NetBSD: cmpci.c,v 1.45 2012/01/30 19:41:18 drochner Exp $");
47 47
48#if defined(AUDIO_DEBUG) || defined(DEBUG) 48#if defined(AUDIO_DEBUG) || defined(DEBUG)
49#define DPRINTF(x) if (cmpcidebug) printf x 49#define DPRINTF(x) if (cmpcidebug) printf x
50int cmpcidebug = 0; 50int cmpcidebug = 0;
51#else 51#else
52#define DPRINTF(x) 52#define DPRINTF(x)
53#endif 53#endif
54 54
55#include "mpu.h" 55#include "mpu.h"
56 56
57#include <sys/param.h> 57#include <sys/param.h>
58#include <sys/systm.h> 58#include <sys/systm.h>
59#include <sys/kernel.h> 59#include <sys/kernel.h>
@@ -371,38 +371,34 @@ cmpci_match(device_t parent, cfdata_t ma @@ -371,38 +371,34 @@ cmpci_match(device_t parent, cfdata_t ma
371 return 1; 371 return 1;
372 372
373 return 0; 373 return 0;
374} 374}
375 375
376static void 376static void
377cmpci_attach(device_t parent, device_t self, void *aux) 377cmpci_attach(device_t parent, device_t self, void *aux)
378{ 378{
379 struct cmpci_softc *sc; 379 struct cmpci_softc *sc;
380 struct pci_attach_args *pa; 380 struct pci_attach_args *pa;
381 struct audio_attach_args aa; 381 struct audio_attach_args aa;
382 pci_intr_handle_t ih; 382 pci_intr_handle_t ih;
383 char const *strintr; 383 char const *strintr;
384 char devinfo[256]; 
385 int i, v; 384 int i, v;
386 385
387 sc = device_private(self); 386 sc = device_private(self);
388 pa = (struct pci_attach_args *)aux; 387 pa = (struct pci_attach_args *)aux;
389 aprint_naive(": Audio controller\n"); 
390 388
391 sc->sc_id = pa->pa_id; 389 sc->sc_id = pa->pa_id;
392 sc->sc_class = pa->pa_class; 390 sc->sc_class = pa->pa_class;
393 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 391 pci_aprint_devinfo(pa, "Audio controller");
394 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
395 PCI_REVISION(sc->sc_class)); 
396 switch (PCI_PRODUCT(sc->sc_id)) { 392 switch (PCI_PRODUCT(sc->sc_id)) {
397 case PCI_PRODUCT_CMEDIA_CMI8338A: 393 case PCI_PRODUCT_CMEDIA_CMI8338A:
398 /*FALLTHROUGH*/ 394 /*FALLTHROUGH*/
399 case PCI_PRODUCT_CMEDIA_CMI8338B: 395 case PCI_PRODUCT_CMEDIA_CMI8338B:
400 sc->sc_capable = CMPCI_CAP_CMI8338; 396 sc->sc_capable = CMPCI_CAP_CMI8338;
401 break; 397 break;
402 case PCI_PRODUCT_CMEDIA_CMI8738: 398 case PCI_PRODUCT_CMEDIA_CMI8738:
403 /*FALLTHROUGH*/ 399 /*FALLTHROUGH*/
404 case PCI_PRODUCT_CMEDIA_CMI8738B: 400 case PCI_PRODUCT_CMEDIA_CMI8738B:
405 sc->sc_capable = CMPCI_CAP_CMI8738; 401 sc->sc_capable = CMPCI_CAP_CMI8738;
406 break; 402 break;
407 } 403 }
408 404

cvs diff -r1.9 -r1.10 src/sys/dev/pci/coram.c (expand / switch to unified diff)

--- src/sys/dev/pci/coram.c 2011/08/29 14:47:08 1.9
+++ src/sys/dev/pci/coram.c 2012/01/30 19:41:18 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: coram.c,v 1.9 2011/08/29 14:47:08 jmcneill Exp $ */ 1/* $NetBSD: coram.c,v 1.10 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008, 2011 Jonathan A. Kollasch 4 * Copyright (c) 2008, 2011 Jonathan A. Kollasch
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: coram.c,v 1.9 2011/08/29 14:47:08 jmcneill Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: coram.c,v 1.10 2012/01/30 19:41:18 drochner Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/systm.h> 33#include <sys/systm.h>
34#include <sys/device.h> 34#include <sys/device.h>
35#include <sys/kmem.h> 35#include <sys/kmem.h>
36#include <sys/mutex.h> 36#include <sys/mutex.h>
37#include <sys/module.h> 37#include <sys/module.h>
38#include <sys/bus.h> 38#include <sys/bus.h>
39 39
40#include <dev/dtv/dtvif.h> 40#include <dev/dtv/dtvif.h>
41 41
42#include <dev/pci/cx23885reg.h> 42#include <dev/pci/cx23885reg.h>
43#include <dev/pci/coramvar.h> 43#include <dev/pci/coramvar.h>
@@ -153,40 +153,37 @@ coram_match(device_t parent, cfdata_t ma @@ -153,40 +153,37 @@ coram_match(device_t parent, cfdata_t ma
153 if (coram_board_lookup(PCI_VENDOR(subid), PCI_PRODUCT(subid)) == NULL) 153 if (coram_board_lookup(PCI_VENDOR(subid), PCI_PRODUCT(subid)) == NULL)
154 return 0; 154 return 0;
155 155
156 return 1; 156 return 1;
157} 157}
158 158
159static void 159static void
160coram_attach(device_t parent, device_t self, void *v) 160coram_attach(device_t parent, device_t self, void *v)
161{ 161{
162 struct coram_softc *sc = device_private(self); 162 struct coram_softc *sc = device_private(self);
163 const struct pci_attach_args *pa = v; 163 const struct pci_attach_args *pa = v;
164 pci_intr_handle_t ih; 164 pci_intr_handle_t ih;
165 pcireg_t reg; 165 pcireg_t reg;
166 char devinfo[256]; 
167 const char *intrstr; 166 const char *intrstr;
168 struct coram_iic_softc *cic; 167 struct coram_iic_softc *cic;
169 uint32_t value; 168 uint32_t value;
170 int i; 169 int i;
171#ifdef CORAM_ATTACH_I2C 170#ifdef CORAM_ATTACH_I2C
172 struct i2cbus_attach_args iba; 171 struct i2cbus_attach_args iba;
173#endif 172#endif
174 173
175 sc->sc_dev = self; 174 sc->sc_dev = self;
176 175
177 aprint_naive("\n"); 176 pci_aprint_devinfo(pa, NULL);
178 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
179 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class)); 
180 177
181 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG); 178 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
182 sc->sc_board = coram_board_lookup(PCI_VENDOR(reg), PCI_PRODUCT(reg)); 179 sc->sc_board = coram_board_lookup(PCI_VENDOR(reg), PCI_PRODUCT(reg));
183 KASSERT(sc->sc_board != NULL); 180 KASSERT(sc->sc_board != NULL);
184 181
185 if (pci_mapreg_map(pa, CX23885_MMBASE, PCI_MAPREG_TYPE_MEM, 0, 182 if (pci_mapreg_map(pa, CX23885_MMBASE, PCI_MAPREG_TYPE_MEM, 0,
186 &sc->sc_memt, &sc->sc_memh, NULL, &sc->sc_mems)) { 183 &sc->sc_memt, &sc->sc_memh, NULL, &sc->sc_mems)) {
187 aprint_error_dev(self, "couldn't map memory space\n"); 184 aprint_error_dev(self, "couldn't map memory space\n");
188 return; 185 return;
189 } 186 }
190 187
191 sc->sc_dmat = pa->pa_dmat; 188 sc->sc_dmat = pa->pa_dmat;
192 sc->sc_pc = pa->pa_pc; 189 sc->sc_pc = pa->pa_pc;

cvs diff -r1.9 -r1.10 src/sys/dev/pci/siisata_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/siisata_pci.c 2010/11/13 13:52:08 1.9
+++ src/sys/dev/pci/siisata_pci.c 2012/01/30 19:41:23 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: siisata_pci.c,v 1.9 2010/11/13 13:52:08 uebayasi Exp $ */ 1/* $NetBSD: siisata_pci.c,v 1.10 2012/01/30 19:41:23 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Manuel Bouyer. 4 * Copyright (c) 2006 Manuel Bouyer.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -41,27 +41,27 @@ @@ -41,27 +41,27 @@
41 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 41 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
42 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 42 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
43 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 43 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
44 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 44 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
45 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 45 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
50 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 50 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51 */ 51 */
52 52
53#include <sys/cdefs.h> 53#include <sys/cdefs.h>
54__KERNEL_RCSID(0, "$NetBSD: siisata_pci.c,v 1.9 2010/11/13 13:52:08 uebayasi Exp $"); 54__KERNEL_RCSID(0, "$NetBSD: siisata_pci.c,v 1.10 2012/01/30 19:41:23 drochner Exp $");
55 55
56#include <sys/types.h> 56#include <sys/types.h>
57#include <sys/malloc.h> 57#include <sys/malloc.h>
58#include <sys/param.h> 58#include <sys/param.h>
59#include <sys/kernel.h> 59#include <sys/kernel.h>
60#include <sys/systm.h> 60#include <sys/systm.h>
61 61
62#include <dev/pci/pcivar.h> 62#include <dev/pci/pcivar.h>
63#include <dev/pci/pcidevs.h> 63#include <dev/pci/pcidevs.h>
64#include <dev/ic/siisatavar.h> 64#include <dev/ic/siisatavar.h>
65 65
66struct siisata_pci_softc { 66struct siisata_pci_softc {
67 struct siisata_softc si_sc; 67 struct siisata_softc si_sc;
@@ -128,45 +128,42 @@ siisata_pci_match(device_t parent, cfdat @@ -128,45 +128,42 @@ siisata_pci_match(device_t parent, cfdat
128 128
129 if (siisata_pci_lookup(pa) != NULL) 129 if (siisata_pci_lookup(pa) != NULL)
130 return 3; 130 return 3;
131 131
132 return 0; 132 return 0;
133} 133}
134 134
135static void 135static void
136siisata_pci_attach(device_t parent, device_t self, void *aux) 136siisata_pci_attach(device_t parent, device_t self, void *aux)
137{ 137{
138 struct pci_attach_args *pa = aux; 138 struct pci_attach_args *pa = aux;
139 struct siisata_pci_softc *psc = device_private(self); 139 struct siisata_pci_softc *psc = device_private(self);
140 struct siisata_softc *sc = &psc->si_sc; 140 struct siisata_softc *sc = &psc->si_sc;
141 char devinfo[256]; 
142 const char *intrstr; 141 const char *intrstr;
143 pcireg_t csr, memtype; 142 pcireg_t csr, memtype;
144 const struct siisata_pci_board *spbp; 143 const struct siisata_pci_board *spbp;
145 pci_intr_handle_t intrhandle; 144 pci_intr_handle_t intrhandle;
146 bus_space_tag_t memt; 145 bus_space_tag_t memt;
147 bus_space_handle_t memh; 146 bus_space_handle_t memh;
148 uint32_t gcreg; 147 uint32_t gcreg;
149 int memh_valid; 148 int memh_valid;
150 bus_size_t grsize, prsize; 149 bus_size_t grsize, prsize;
151 150
152 sc->sc_atac.atac_dev = self; 151 sc->sc_atac.atac_dev = self;
153  152
154 psc->sc_pc = pa->pa_pc; 153 psc->sc_pc = pa->pa_pc;
155 psc->sc_pcitag = pa->pa_tag; 154 psc->sc_pcitag = pa->pa_tag;
156 155
157 pci_devinfo(pa->pa_id, pa->pa_class, 1, devinfo, sizeof(devinfo)); 156 pci_aprint_devinfo(pa, "SATA-II HBA");
158 aprint_naive(": SATA-II HBA\n"); 
159 aprint_normal(": %s\n", devinfo); 
160 157
161 /* map BAR 0, global registers */ 158 /* map BAR 0, global registers */
162 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, SIISATA_PCI_BAR0); 159 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, SIISATA_PCI_BAR0);
163 switch (memtype) { 160 switch (memtype) {
164 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT: 161 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
165 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT: 162 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
166 memh_valid = (pci_mapreg_map(pa, SIISATA_PCI_BAR0, 163 memh_valid = (pci_mapreg_map(pa, SIISATA_PCI_BAR0,
167 memtype, 0, &memt, &memh, NULL, &grsize) == 0); 164 memtype, 0, &memt, &memh, NULL, &grsize) == 0);
168 break; 165 break;
169 default: 166 default:
170 memh_valid = 0; 167 memh_valid = 0;
171 } 168 }
172 if (memh_valid) { 169 if (memh_valid) {

cvs diff -r1.9 -r1.10 src/sys/dev/pci/wcfb.c (expand / switch to unified diff)

--- src/sys/dev/pci/wcfb.c 2012/01/11 16:02:30 1.9
+++ src/sys/dev/pci/wcfb.c 2012/01/30 19:41:23 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: wcfb.c,v 1.9 2012/01/11 16:02:30 macallan Exp $ */ 1/* $NetBSD: wcfb.c,v 1.10 2012/01/30 19:41:23 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2010 Michael Lorenz 4 * Copyright (c) 2010 Michael Lorenz
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: wcfb.c,v 1.9 2012/01/11 16:02:30 macallan Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: wcfb.c,v 1.10 2012/01/30 19:41:23 drochner Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/systm.h> 33#include <sys/systm.h>
34#include <sys/kernel.h> 34#include <sys/kernel.h>
35#include <sys/device.h> 35#include <sys/device.h>
36#include <sys/proc.h> 36#include <sys/proc.h>
37#include <sys/mutex.h> 37#include <sys/mutex.h>
38#include <sys/ioctl.h> 38#include <sys/ioctl.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/kauth.h> 41#include <sys/kauth.h>
42#include <sys/kmem.h> 42#include <sys/kmem.h>
43 43
@@ -146,34 +146,31 @@ wcfb_match(device_t parent, cfdata_t mat @@ -146,34 +146,31 @@ wcfb_match(device_t parent, cfdata_t mat
146 146
147static void 147static void
148wcfb_attach(device_t parent, device_t self, void *aux) 148wcfb_attach(device_t parent, device_t self, void *aux)
149{ 149{
150 struct wcfb_softc *sc = device_private(self); 150 struct wcfb_softc *sc = device_private(self);
151 struct pci_attach_args *pa = aux; 151 struct pci_attach_args *pa = aux;
152 struct rasops_info *ri; 152 struct rasops_info *ri;
153 prop_dictionary_t dict; 153 prop_dictionary_t dict;
154 struct wsemuldisplaydev_attach_args aa; 154 struct wsemuldisplaydev_attach_args aa;
155 int i, j; 155 int i, j;
156 uint32_t reg; 156 uint32_t reg;
157 unsigned long defattr; 157 unsigned long defattr;
158 bool is_console = 0; 158 bool is_console = 0;
159 char devinfo[256]; 
160 void *wtf; 159 void *wtf;
161 160
162 sc->sc_dev = self; 161 sc->sc_dev = self;
163 sc->putchar = NULL; 162 sc->putchar = NULL;
164 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 163 pci_aprint_devinfo(pa, NULL);
165 aprint_naive("\n"); 
166 aprint_normal(": %s\n", devinfo); 
167 164
168 dict = device_properties(self); 165 dict = device_properties(self);
169 prop_dictionary_get_bool(dict, "is_console", &is_console); 166 prop_dictionary_get_bool(dict, "is_console", &is_console);
170#ifndef WCFB_DEBUG 167#ifndef WCFB_DEBUG
171 if (!is_console) return; 168 if (!is_console) return;
172#endif 169#endif
173 sc->sc_memt = pa->pa_memt; 170 sc->sc_memt = pa->pa_memt;
174 sc->sc_iot = pa->pa_iot;  171 sc->sc_iot = pa->pa_iot;
175 sc->sc_pc = pa->pa_pc; 172 sc->sc_pc = pa->pa_pc;
176 sc->sc_pcitag = pa->pa_tag; 173 sc->sc_pcitag = pa->pa_tag;
177 174
178 if (pci_mapreg_map(pa, 0x14, PCI_MAPREG_TYPE_MEM, 0, 175 if (pci_mapreg_map(pa, 0x14, PCI_MAPREG_TYPE_MEM, 0,
179 &sc->sc_regt, &sc->sc_regh, &sc->sc_reg, &sc->sc_regsize)) { 176 &sc->sc_regt, &sc->sc_regh, &sc->sc_reg, &sc->sc_regsize)) {

cvs diff -r1.63 -r1.64 src/sys/dev/pci/cs4280.c (expand / switch to unified diff)

--- src/sys/dev/pci/cs4280.c 2011/11/24 03:35:58 1.63
+++ src/sys/dev/pci/cs4280.c 2012/01/30 19:41:18 1.64
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cs4280.c,v 1.63 2011/11/24 03:35:58 mrg Exp $ */ 1/* $NetBSD: cs4280.c,v 1.64 2012/01/30 19:41:18 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999, 2000 Tatoku Ogaito. All rights reserved. 4 * Copyright (c) 1999, 2000 Tatoku Ogaito. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -42,27 +42,27 @@ @@ -42,27 +42,27 @@
42 * wss* at pnpbios? 42 * wss* at pnpbios?
43 * or 43 * or
44 * sb* at pnpbios? 44 * sb* at pnpbios?
45 * Since I could not find any documents on handling ISA codec, 45 * Since I could not find any documents on handling ISA codec,
46 * clcs does not support those chips. 46 * clcs does not support those chips.
47 */ 47 */
48 48
49/* 49/*
50 * TODO 50 * TODO
51 * Joystick support 51 * Joystick support
52 */ 52 */
53 53
54#include <sys/cdefs.h> 54#include <sys/cdefs.h>
55__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.63 2011/11/24 03:35:58 mrg Exp $"); 55__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.64 2012/01/30 19:41:18 drochner Exp $");
56 56
57#include "midi.h" 57#include "midi.h"
58 58
59#include <sys/param.h> 59#include <sys/param.h>
60#include <sys/systm.h> 60#include <sys/systm.h>
61#include <sys/kernel.h> 61#include <sys/kernel.h>
62#include <sys/fcntl.h> 62#include <sys/fcntl.h>
63#include <sys/malloc.h> 63#include <sys/malloc.h>
64#include <sys/device.h> 64#include <sys/device.h>
65#include <sys/proc.h> 65#include <sys/proc.h>
66#include <sys/systm.h> 66#include <sys/systm.h>
67#include <sys/audioio.h> 67#include <sys/audioio.h>
68#include <sys/bus.h> 68#include <sys/bus.h>
@@ -233,38 +233,34 @@ cs4280_match(device_t parent, cfdata_t m @@ -233,38 +233,34 @@ cs4280_match(device_t parent, cfdata_t m
233 return 0; 233 return 0;
234} 234}
235 235
236static void 236static void
237cs4280_attach(device_t parent, device_t self, void *aux) 237cs4280_attach(device_t parent, device_t self, void *aux)
238{ 238{
239 struct cs428x_softc *sc; 239 struct cs428x_softc *sc;
240 struct pci_attach_args *pa; 240 struct pci_attach_args *pa;
241 pci_chipset_tag_t pc; 241 pci_chipset_tag_t pc;
242 const struct cs4280_card_t *cs_card; 242 const struct cs4280_card_t *cs_card;
243 char const *intrstr; 243 char const *intrstr;
244 const char *vendor, *product; 244 const char *vendor, *product;
245 pcireg_t reg; 245 pcireg_t reg;
246 char devinfo[256]; 
247 uint32_t mem; 246 uint32_t mem;
248 int error; 247 int error;
249 248
250 sc = device_private(self); 249 sc = device_private(self);
251 pa = (struct pci_attach_args *)aux; 250 pa = (struct pci_attach_args *)aux;
252 pc = pa->pa_pc; 251 pc = pa->pa_pc;
253 aprint_naive(": Audio controller\n"); 
254 252
255 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 253 pci_aprint_devinfo(pa, "Audio controller");
256 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
257 PCI_REVISION(pa->pa_class)); 
258 254
259 cs_card = cs4280_identify_card(pa); 255 cs_card = cs4280_identify_card(pa);
260 if (cs_card != NULL) { 256 if (cs_card != NULL) {
261 vendor = pci_findvendor(cs_card->id); 257 vendor = pci_findvendor(cs_card->id);
262 product = pci_findproduct(cs_card->id);  258 product = pci_findproduct(cs_card->id);
263 if (vendor == NULL) 259 if (vendor == NULL)
264 aprint_normal_dev(&sc->sc_dev, 260 aprint_normal_dev(&sc->sc_dev,
265 "vendor 0x%04x product 0x%04x\n", 261 "vendor 0x%04x product 0x%04x\n",
266 PCI_VENDOR(cs_card->id), 262 PCI_VENDOR(cs_card->id),
267 PCI_PRODUCT(cs_card->id)); 263 PCI_PRODUCT(cs_card->id));
268 else if (product == NULL) 264 else if (product == NULL)
269 aprint_normal_dev(&sc->sc_dev, "%s product 0x%04x\n", 265 aprint_normal_dev(&sc->sc_dev, "%s product 0x%04x\n",
270 vendor, PCI_PRODUCT(cs_card->id)); 266 vendor, PCI_PRODUCT(cs_card->id));

cvs diff -r1.46 -r1.47 src/sys/dev/pci/cs4281.c (expand / switch to unified diff)

--- src/sys/dev/pci/cs4281.c 2011/11/24 03:35:58 1.46
+++ src/sys/dev/pci/cs4281.c 2012/01/30 19:41:19 1.47
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cs4281.c,v 1.46 2011/11/24 03:35:58 mrg Exp $ */ 1/* $NetBSD: cs4281.c,v 1.47 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Tatoku Ogaito. All rights reserved. 4 * Copyright (c) 2000 Tatoku Ogaito. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -33,27 +33,27 @@ @@ -33,27 +33,27 @@
33/* 33/*
34 * Cirrus Logic CS4281 driver. 34 * Cirrus Logic CS4281 driver.
35 * Data sheets can be found 35 * Data sheets can be found
36 * http://www.cirrus.com/ftp/pub/4281.pdf 36 * http://www.cirrus.com/ftp/pub/4281.pdf
37 * ftp://ftp.alsa-project.org/pub/manuals/cirrus/cs4281tm.pdf 37 * ftp://ftp.alsa-project.org/pub/manuals/cirrus/cs4281tm.pdf
38 * 38 *
39 * TODO: 39 * TODO:
40 * 1: midi and FM support 40 * 1: midi and FM support
41 * 2: ... 41 * 2: ...
42 * 42 *
43 */ 43 */
44 44
45#include <sys/cdefs.h> 45#include <sys/cdefs.h>
46__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.46 2011/11/24 03:35:58 mrg Exp $"); 46__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.47 2012/01/30 19:41:19 drochner Exp $");
47 47
48#include <sys/param.h> 48#include <sys/param.h>
49#include <sys/systm.h> 49#include <sys/systm.h>
50#include <sys/kernel.h> 50#include <sys/kernel.h>
51#include <sys/malloc.h> 51#include <sys/malloc.h>
52#include <sys/fcntl.h> 52#include <sys/fcntl.h>
53#include <sys/device.h> 53#include <sys/device.h>
54#include <sys/systm.h> 54#include <sys/systm.h>
55 55
56#include <dev/pci/pcidevs.h> 56#include <dev/pci/pcidevs.h>
57#include <dev/pci/pcivar.h> 57#include <dev/pci/pcivar.h>
58#include <dev/pci/cs4281reg.h> 58#include <dev/pci/cs4281reg.h>
59#include <dev/pci/cs428xreg.h> 59#include <dev/pci/cs428xreg.h>
@@ -179,37 +179,33 @@ cs4281_match(device_t parent, cfdata_t m @@ -179,37 +179,33 @@ cs4281_match(device_t parent, cfdata_t m
179 if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CIRRUS_CS4281) 179 if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CIRRUS_CS4281)
180 return 1; 180 return 1;
181 return 0; 181 return 0;
182} 182}
183 183
184static void 184static void
185cs4281_attach(device_t parent, device_t self, void *aux) 185cs4281_attach(device_t parent, device_t self, void *aux)
186{ 186{
187 struct cs428x_softc *sc; 187 struct cs428x_softc *sc;
188 struct pci_attach_args *pa; 188 struct pci_attach_args *pa;
189 pci_chipset_tag_t pc; 189 pci_chipset_tag_t pc;
190 char const *intrstr; 190 char const *intrstr;
191 pcireg_t reg; 191 pcireg_t reg;
192 char devinfo[256]; 
193 int error; 192 int error;
194 193
195 sc = device_private(self); 194 sc = device_private(self);
196 pa = (struct pci_attach_args *)aux; 195 pa = (struct pci_attach_args *)aux;
197 pc = pa->pa_pc; 196 pc = pa->pa_pc;
198 aprint_naive(": Audio controller\n"); 
199 197
200 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 198 pci_aprint_devinfo(pa, "Audio controller");
201 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
202 PCI_REVISION(pa->pa_class)); 
203 199
204 sc->sc_pc = pa->pa_pc; 200 sc->sc_pc = pa->pa_pc;
205 sc->sc_pt = pa->pa_tag; 201 sc->sc_pt = pa->pa_tag;
206 202
207 /* Map I/O register */ 203 /* Map I/O register */
208 if (pci_mapreg_map(pa, PCI_BA0, 204 if (pci_mapreg_map(pa, PCI_BA0,
209 PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0, 205 PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
210 &sc->ba0t, &sc->ba0h, NULL, NULL)) { 206 &sc->ba0t, &sc->ba0h, NULL, NULL)) {
211 aprint_error_dev(&sc->sc_dev, "can't map BA0 space\n"); 207 aprint_error_dev(&sc->sc_dev, "can't map BA0 space\n");
212 return; 208 return;
213 } 209 }
214 if (pci_mapreg_map(pa, PCI_BA1, 210 if (pci_mapreg_map(pa, PCI_BA1,
215 PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0, 211 PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,

cvs diff -r1.10 -r1.11 src/sys/dev/pci/cxdtv.c (expand / switch to unified diff)

--- src/sys/dev/pci/cxdtv.c 2012/01/16 15:33:50 1.10
+++ src/sys/dev/pci/cxdtv.c 2012/01/30 19:41:19 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cxdtv.c,v 1.10 2012/01/16 15:33:50 jmcneill Exp $ */ 1/* $NetBSD: cxdtv.c,v 1.11 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008, 2011 Jonathan A. Kollasch 4 * Copyright (c) 2008, 2011 Jonathan A. Kollasch
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: cxdtv.c,v 1.10 2012/01/16 15:33:50 jmcneill Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: cxdtv.c,v 1.11 2012/01/30 19:41:19 drochner Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/kernel.h> 33#include <sys/kernel.h>
34#include <sys/device.h> 34#include <sys/device.h>
35#include <sys/kmem.h> 35#include <sys/kmem.h>
36#include <sys/mutex.h> 36#include <sys/mutex.h>
37#include <sys/proc.h> 37#include <sys/proc.h>
38#include <sys/module.h> 38#include <sys/module.h>
39#include <sys/bus.h> 39#include <sys/bus.h>
40 40
41#include <dev/pci/pcivar.h> 41#include <dev/pci/pcivar.h>
42#include <dev/pci/pcireg.h> 42#include <dev/pci/pcireg.h>
43#include <dev/pci/pcidevs.h> 43#include <dev/pci/pcidevs.h>
@@ -176,47 +176,42 @@ cxdtv_match(device_t parent, cfdata_t ma @@ -176,47 +176,42 @@ cxdtv_match(device_t parent, cfdata_t ma
176 return 0; 176 return 0;
177 177
178 return 1; 178 return 1;
179} 179}
180 180
181static void 181static void
182cxdtv_attach(device_t parent, device_t self, void *aux) 182cxdtv_attach(device_t parent, device_t self, void *aux)
183{ 183{
184 struct cxdtv_softc *sc; 184 struct cxdtv_softc *sc;
185 const struct pci_attach_args *pa = aux; 185 const struct pci_attach_args *pa = aux;
186 pci_intr_handle_t ih; 186 pci_intr_handle_t ih;
187 pcireg_t reg; 187 pcireg_t reg;
188 const char *intrstr; 188 const char *intrstr;
189 char devinfo[76]; 
190 struct i2cbus_attach_args iba; 189 struct i2cbus_attach_args iba;
191 190
192 sc = device_private(self); 191 sc = device_private(self);
193 192
194 sc->sc_dev = self; 193 sc->sc_dev = self;
195 sc->sc_pc = pa->pa_pc; 194 sc->sc_pc = pa->pa_pc;
196 195
197 aprint_naive("\n"); 
198 
199 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG); 196 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
200 197
201 sc->sc_vendor = PCI_VENDOR(reg); 198 sc->sc_vendor = PCI_VENDOR(reg);
202 sc->sc_product = PCI_PRODUCT(reg); 199 sc->sc_product = PCI_PRODUCT(reg);
203 200
204 sc->sc_board = cxdtv_board_lookup(sc->sc_vendor, sc->sc_product); 201 sc->sc_board = cxdtv_board_lookup(sc->sc_vendor, sc->sc_product);
205 KASSERT(sc->sc_board != NULL); 202 KASSERT(sc->sc_board != NULL);
206 203
207 204 pci_aprint_devinfo(pa, NULL);
208 pci_devinfo(reg, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
209 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class)); 
210 205
211 if (pci_mapreg_map(pa, CXDTV_MMBASE, PCI_MAPREG_TYPE_MEM, 0, 206 if (pci_mapreg_map(pa, CXDTV_MMBASE, PCI_MAPREG_TYPE_MEM, 0,
212 &sc->sc_memt, &sc->sc_memh, NULL, &sc->sc_mems)) { 207 &sc->sc_memt, &sc->sc_memh, NULL, &sc->sc_mems)) {
213 aprint_error_dev(self, "couldn't map memory space\n"); 208 aprint_error_dev(self, "couldn't map memory space\n");
214 return; 209 return;
215 } 210 }
216 211
217 sc->sc_dmat = pa->pa_dmat; 212 sc->sc_dmat = pa->pa_dmat;
218 213
219 if (pci_intr_map(pa, &ih)) { 214 if (pci_intr_map(pa, &ih)) {
220 aprint_error_dev(self, "couldn't map interrupt\n"); 215 aprint_error_dev(self, "couldn't map interrupt\n");
221 return; 216 return;
222 } 217 }

cvs diff -r1.53 -r1.54 src/sys/dev/pci/ehci_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/ehci_pci.c 2011/07/30 13:19:21 1.53
+++ src/sys/dev/pci/ehci_pci.c 2012/01/30 19:41:19 1.54
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ehci_pci.c,v 1.53 2011/07/30 13:19:21 jmcneill Exp $ */ 1/* $NetBSD: ehci_pci.c,v 1.54 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net). 8 * by Lennart Augustsson (lennart@augustsson.net).
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.53 2011/07/30 13:19:21 jmcneill Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.54 2012/01/30 19:41:19 drochner Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/kernel.h> 37#include <sys/kernel.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <sys/proc.h> 39#include <sys/proc.h>
40#include <sys/queue.h> 40#include <sys/queue.h>
41 41
42#include <sys/bus.h> 42#include <sys/bus.h>
43 43
44#include <dev/pci/pcidevs.h> 44#include <dev/pci/pcidevs.h>
45#include <dev/pci/pcivar.h> 45#include <dev/pci/pcivar.h>
46#include <dev/pci/usb_pci.h> 46#include <dev/pci/usb_pci.h>
@@ -110,40 +110,35 @@ ehci_pci_match(device_t parent, cfdata_t @@ -110,40 +110,35 @@ ehci_pci_match(device_t parent, cfdata_t
110} 110}
111 111
112static void 112static void
113ehci_pci_attach(device_t parent, device_t self, void *aux) 113ehci_pci_attach(device_t parent, device_t self, void *aux)
114{ 114{
115 struct ehci_pci_softc *sc = device_private(self); 115 struct ehci_pci_softc *sc = device_private(self);
116 struct pci_attach_args *pa = (struct pci_attach_args *)aux; 116 struct pci_attach_args *pa = (struct pci_attach_args *)aux;
117 pci_chipset_tag_t pc = pa->pa_pc; 117 pci_chipset_tag_t pc = pa->pa_pc;
118 pcitag_t tag = pa->pa_tag; 118 pcitag_t tag = pa->pa_tag;
119 char const *intrstr; 119 char const *intrstr;
120 pci_intr_handle_t ih; 120 pci_intr_handle_t ih;
121 pcireg_t csr; 121 pcireg_t csr;
122 const char *vendor; 122 const char *vendor;
123 char devinfo[256]; 
124 usbd_status r; 123 usbd_status r;
125 int ncomp; 124 int ncomp;
126 struct usb_pci *up; 125 struct usb_pci *up;
127 int quirk; 126 int quirk;
128 127
129 sc->sc.sc_dev = self; 128 sc->sc.sc_dev = self;
130 sc->sc.sc_bus.hci_private = sc; 129 sc->sc.sc_bus.hci_private = sc;
131 130
132 aprint_naive(": USB controller\n"); 131 pci_aprint_devinfo(pa, "USB controller");
133 
134 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
135 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
136 PCI_REVISION(pa->pa_class)); 
137 132
138 /* Check for quirks */ 133 /* Check for quirks */
139 quirk = ehci_pci_lookup_quirkdata(PCI_VENDOR(pa->pa_id), 134 quirk = ehci_pci_lookup_quirkdata(PCI_VENDOR(pa->pa_id),
140 PCI_PRODUCT(pa->pa_id)); 135 PCI_PRODUCT(pa->pa_id));
141 136
142 /* Map I/O registers */ 137 /* Map I/O registers */
143 if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0, 138 if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
144 &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) { 139 &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
145 sc->sc.sc_size = 0; 140 sc->sc.sc_size = 0;
146 aprint_error_dev(self, "can't map memory space\n"); 141 aprint_error_dev(self, "can't map memory space\n");
147 return; 142 return;
148 } 143 }
149 144

cvs diff -r1.53 -r1.54 src/sys/dev/pci/if_stge.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_stge.c 2011/03/12 16:52:05 1.53
+++ src/sys/dev/pci/if_stge.c 2012/01/30 19:41:21 1.54
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_stge.c,v 1.53 2011/03/12 16:52:05 phx Exp $ */ 1/* $NetBSD: if_stge.c,v 1.54 2012/01/30 19:41:21 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * Device driver for the Sundance Tech. TC9021 10/100/1000 33 * Device driver for the Sundance Tech. TC9021 10/100/1000
34 * Ethernet controller. 34 * Ethernet controller.
35 */ 35 */
36 36
37#include <sys/cdefs.h> 37#include <sys/cdefs.h>
38__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.53 2011/03/12 16:52:05 phx Exp $"); 38__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.54 2012/01/30 19:41:21 drochner Exp $");
39 39
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/callout.h> 43#include <sys/callout.h>
44#include <sys/mbuf.h> 44#include <sys/mbuf.h>
45#include <sys/malloc.h> 45#include <sys/malloc.h>
46#include <sys/kernel.h> 46#include <sys/kernel.h>
47#include <sys/socket.h> 47#include <sys/socket.h>
48#include <sys/ioctl.h> 48#include <sys/ioctl.h>
49#include <sys/errno.h> 49#include <sys/errno.h>
50#include <sys/device.h> 50#include <sys/device.h>
51#include <sys/queue.h> 51#include <sys/queue.h>
@@ -387,27 +387,27 @@ stge_attach(device_t parent, device_t se @@ -387,27 +387,27 @@ stge_attach(device_t parent, device_t se
387 const struct stge_product *sp; 387 const struct stge_product *sp;
388 uint8_t enaddr[ETHER_ADDR_LEN]; 388 uint8_t enaddr[ETHER_ADDR_LEN];
389 389
390 callout_init(&sc->sc_tick_ch, 0); 390 callout_init(&sc->sc_tick_ch, 0);
391 391
392 sp = stge_lookup(pa); 392 sp = stge_lookup(pa);
393 if (sp == NULL) { 393 if (sp == NULL) {
394 printf("\n"); 394 printf("\n");
395 panic("ste_attach: impossible"); 395 panic("ste_attach: impossible");
396 } 396 }
397 397
398 sc->sc_rev = PCI_REVISION(pa->pa_class); 398 sc->sc_rev = PCI_REVISION(pa->pa_class);
399 399
400 aprint_normal(": %s, rev. %d\n", sp->stge_name, sc->sc_rev); 400 pci_aprint_devinfo_fancy(pa, NULL, sp->stge_name, 1);
401 401
402 /* 402 /*
403 * Map the device. 403 * Map the device.
404 */ 404 */
405 ioh_valid = (pci_mapreg_map(pa, STGE_PCI_IOBA, 405 ioh_valid = (pci_mapreg_map(pa, STGE_PCI_IOBA,
406 PCI_MAPREG_TYPE_IO, 0, 406 PCI_MAPREG_TYPE_IO, 0,
407 &iot, &ioh, NULL, NULL) == 0); 407 &iot, &ioh, NULL, NULL) == 0);
408 memh_valid = (pci_mapreg_map(pa, STGE_PCI_MMBA, 408 memh_valid = (pci_mapreg_map(pa, STGE_PCI_MMBA,
409 PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0, 409 PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,
410 &memt, &memh, NULL, NULL) == 0); 410 &memt, &memh, NULL, NULL) == 0);
411 411
412 if (memh_valid) { 412 if (memh_valid) {
413 sc->sc_st = memt; 413 sc->sc_st = memt;

cvs diff -r1.53 -r1.54 src/sys/dev/pci/if_wi_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_wi_pci.c 2011/07/26 20:51:24 1.53
+++ src/sys/dev/pci/if_wi_pci.c 2012/01/30 19:41:21 1.54
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_wi_pci.c,v 1.53 2011/07/26 20:51:24 dyoung Exp $ */ 1/* $NetBSD: if_wi_pci.c,v 1.54 2012/01/30 19:41:21 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Hideaki Imaizumi <hiddy@sfc.wide.ad.jp> 8 * by Hideaki Imaizumi <hiddy@sfc.wide.ad.jp>
9 * and Ichiro FUKUHARA (ichiro@ichiro.org). 9 * and Ichiro FUKUHARA (ichiro@ichiro.org).
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33/* 33/*
34 * PCI bus front-end for the Intersil PCI WaveLan. 34 * PCI bus front-end for the Intersil PCI WaveLan.
35 * Works with Prism2.5 Mini-PCI wavelan. 35 * Works with Prism2.5 Mini-PCI wavelan.
36 */ 36 */
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.53 2011/07/26 20:51:24 dyoung Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.54 2012/01/30 19:41:21 drochner Exp $");
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/mbuf.h> 43#include <sys/mbuf.h>
44#include <sys/syslog.h> 44#include <sys/syslog.h>
45#include <sys/socket.h> 45#include <sys/socket.h>
46#include <sys/device.h> 46#include <sys/device.h>
47#include <sys/callout.h> 47#include <sys/callout.h>
48 48
49#include <net/if.h> 49#include <net/if.h>
50#include <net/if_ether.h> 50#include <net/if_ether.h>
51#include <net/if_media.h> 51#include <net/if_media.h>
52 52
@@ -280,33 +280,27 @@ wi_pci_attach(device_t parent, device_t  @@ -280,33 +280,27 @@ wi_pci_attach(device_t parent, device_t
280 if (pci_mapreg_map(pa, WI_PCI_CBMA, 280 if (pci_mapreg_map(pa, WI_PCI_CBMA,
281 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 281 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
282 0, &iot, &ioh, NULL, NULL) != 0) { 282 0, &iot, &ioh, NULL, NULL) != 0) {
283 printf(": can't map mem space\n"); 283 printf(": can't map mem space\n");
284 return; 284 return;
285 } 285 }
286 286
287 memt = iot; 287 memt = iot;
288 memh = ioh; 288 memh = ioh;
289 sc->sc_pci = 1; 289 sc->sc_pci = 1;
290 break; 290 break;
291 } 291 }
292 292
293 { 293 pci_aprint_devinfo(pa, NULL);
294 char devinfo[256]; 
295 
296 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
297 printf(": %s (rev. 0x%02x)\n", devinfo, 
298 PCI_REVISION(pa->pa_class)); 
299 } 
300 294
301 sc->sc_enabled = 1; 295 sc->sc_enabled = 1;
302 sc->sc_enable = wi_pci_enable; 296 sc->sc_enable = wi_pci_enable;
303 297
304 sc->sc_iot = iot; 298 sc->sc_iot = iot;
305 sc->sc_ioh = ioh; 299 sc->sc_ioh = ioh;
306 /* Make sure interrupts are disabled. */ 300 /* Make sure interrupts are disabled. */
307 CSR_WRITE_2(sc, WI_INT_EN, 0); 301 CSR_WRITE_2(sc, WI_INT_EN, 0);
308 CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); 302 CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF);
309 303
310 if (wpp->wpp_chip == CHIP_PLX_OTHER) { 304 if (wpp->wpp_chip == CHIP_PLX_OTHER) {
311 uint32_t command; 305 uint32_t command;
312#define WI_LOCAL_INTCSR 0x4c 306#define WI_LOCAL_INTCSR 0x4c

cvs diff -r1.53 -r1.54 src/sys/dev/pci/uhci_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/uhci_pci.c 2011/04/04 22:48:15 1.53
+++ src/sys/dev/pci/uhci_pci.c 2012/01/30 19:41:23 1.54
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: uhci_pci.c,v 1.53 2011/04/04 22:48:15 dyoung Exp $ */ 1/* $NetBSD: uhci_pci.c,v 1.54 2012/01/30 19:41:23 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net) at 8 * by Lennart Augustsson (lennart@augustsson.net) at
9 * Carlstedt Research & Technology. 9 * Carlstedt Research & Technology.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.53 2011/04/04 22:48:15 dyoung Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.54 2012/01/30 19:41:23 drochner Exp $");
35 35
36#include "ehci.h" 36#include "ehci.h"
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/kernel.h> 40#include <sys/kernel.h>
41#include <sys/device.h> 41#include <sys/device.h>
42#include <sys/proc.h> 42#include <sys/proc.h>
43#include <sys/queue.h> 43#include <sys/queue.h>
44 44
45#include <sys/bus.h> 45#include <sys/bus.h>
46 46
47#include <dev/pci/pcivar.h> 47#include <dev/pci/pcivar.h>
@@ -81,38 +81,33 @@ uhci_pci_match(device_t parent, cfdata_t @@ -81,38 +81,33 @@ uhci_pci_match(device_t parent, cfdata_t
81} 81}
82 82
83static void 83static void
84uhci_pci_attach(device_t parent, device_t self, void *aux) 84uhci_pci_attach(device_t parent, device_t self, void *aux)
85{ 85{
86 struct uhci_pci_softc *sc = device_private(self); 86 struct uhci_pci_softc *sc = device_private(self);
87 struct pci_attach_args *pa = (struct pci_attach_args *)aux; 87 struct pci_attach_args *pa = (struct pci_attach_args *)aux;
88 pci_chipset_tag_t pc = pa->pa_pc; 88 pci_chipset_tag_t pc = pa->pa_pc;
89 pcitag_t tag = pa->pa_tag; 89 pcitag_t tag = pa->pa_tag;
90 char const *intrstr; 90 char const *intrstr;
91 pci_intr_handle_t ih; 91 pci_intr_handle_t ih;
92 pcireg_t csr; 92 pcireg_t csr;
93 const char *vendor; 93 const char *vendor;
94 char devinfo[256]; 
95 usbd_status r; 94 usbd_status r;
96 int s; 95 int s;
97 96
98 sc->sc.sc_dev = self; 97 sc->sc.sc_dev = self;
99 sc->sc.sc_bus.hci_private = sc; 98 sc->sc.sc_bus.hci_private = sc;
100 99
101 aprint_naive("\n"); 100 pci_aprint_devinfo(pa, NULL);
102 
103 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
104 aprint_normal(": %s (rev. 0x%02x)\n", 
105 devinfo, PCI_REVISION(pa->pa_class)); 
106 101
107 /* Map I/O registers */ 102 /* Map I/O registers */
108 if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, 103 if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
109 &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) { 104 &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
110 aprint_error_dev(self, "can't map i/o space\n"); 105 aprint_error_dev(self, "can't map i/o space\n");
111 return; 106 return;
112 } 107 }
113 108
114 /* 109 /*
115 * Disable interrupts, so we don't get any spurious ones. 110 * Disable interrupts, so we don't get any spurious ones.
116 * Acknowledge all pending interrupts. 111 * Acknowledge all pending interrupts.
117 */ 112 */
118 bus_space_write_2(sc->sc.iot, sc->sc.ioh, UHCI_INTR, 0); 113 bus_space_write_2(sc->sc.iot, sc->sc.ioh, UHCI_INTR, 0);

cvs diff -r1.53 -r1.54 src/sys/dev/pci/vga_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/vga_pci.c 2011/01/22 15:14:28 1.53
+++ src/sys/dev/pci/vga_pci.c 2012/01/30 19:41:23 1.54
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vga_pci.c,v 1.53 2011/01/22 15:14:28 cegger Exp $ */ 1/* $NetBSD: vga_pci.c,v 1.54 2012/01/30 19:41:23 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995, 1996 Carnegie-Mellon University. 4 * Copyright (c) 1995, 1996 Carnegie-Mellon University.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Author: Chris G. Demetriou 7 * Author: Chris G. Demetriou
8 * 8 *
9 * Permission to use, copy, modify and distribute this software and 9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright 10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the 11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions 12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation. 13 * thereof, and that both notices appear in supporting documentation.
14 * 14 *
@@ -18,27 +18,27 @@ @@ -18,27 +18,27 @@
18 * 18 *
19 * Carnegie Mellon requests users of this software to return to 19 * Carnegie Mellon requests users of this software to return to
20 * 20 *
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science 22 * School of Computer Science
23 * Carnegie Mellon University 23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890 24 * Pittsburgh PA 15213-3890
25 * 25 *
26 * any improvements or extensions that they make and grant Carnegie the 26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes. 27 * rights to redistribute these changes.
28 */ 28 */
29 29
30#include <sys/cdefs.h> 30#include <sys/cdefs.h>
31__KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.53 2011/01/22 15:14:28 cegger Exp $"); 31__KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.54 2012/01/30 19:41:23 drochner Exp $");
32 32
33#include <sys/param.h> 33#include <sys/param.h>
34#include <sys/systm.h> 34#include <sys/systm.h>
35#include <sys/kernel.h> 35#include <sys/kernel.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/malloc.h> 37#include <sys/malloc.h>
38 38
39#include <dev/pci/pcireg.h> 39#include <dev/pci/pcireg.h>
40#include <dev/pci/pcivar.h> 40#include <dev/pci/pcivar.h>
41#include <dev/pci/pcidevs.h> 41#include <dev/pci/pcidevs.h>
42#include <dev/pci/pciio.h> 42#include <dev/pci/pciio.h>
43 43
44#include <dev/ic/mc6845reg.h> 44#include <dev/ic/mc6845reg.h>
@@ -176,38 +176,34 @@ vga_pci_match(device_t parent, cfdata_t  @@ -176,38 +176,34 @@ vga_pci_match(device_t parent, cfdata_t
176 */ 176 */
177 if (!vga_common_probe(pa->pa_iot, pa->pa_memt)) 177 if (!vga_common_probe(pa->pa_iot, pa->pa_memt))
178 return (0); 178 return (0);
179 179
180 return (1); 180 return (1);
181} 181}
182 182
183static void 183static void
184vga_pci_attach(device_t parent, device_t self, void *aux) 184vga_pci_attach(device_t parent, device_t self, void *aux)
185{ 185{
186 struct vga_pci_softc *psc = device_private(self); 186 struct vga_pci_softc *psc = device_private(self);
187 struct vga_softc *sc = &psc->sc_vga; 187 struct vga_softc *sc = &psc->sc_vga;
188 struct pci_attach_args *pa = aux; 188 struct pci_attach_args *pa = aux;
189 char devinfo[256]; 
190 int bar, reg; 189 int bar, reg;
191 190
192 sc->sc_dev = self; 191 sc->sc_dev = self;
193 psc->sc_pc = pa->pa_pc; 192 psc->sc_pc = pa->pa_pc;
194 psc->sc_pcitag = pa->pa_tag; 193 psc->sc_pcitag = pa->pa_tag;
195 psc->sc_paa = *pa; 194 psc->sc_paa = *pa;
196 195
197 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 196 pci_aprint_devinfo(pa, NULL);
198 aprint_naive("\n"); 
199 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
200 PCI_REVISION(pa->pa_class)); 
201 197
202 /* 198 /*
203 * Gather info about all the BARs. These are used to allow 199 * Gather info about all the BARs. These are used to allow
204 * the X server to map the VGA device. 200 * the X server to map the VGA device.
205 */ 201 */
206 for (bar = 0; bar < NBARS; bar++) { 202 for (bar = 0; bar < NBARS; bar++) {
207 reg = PCI_MAPREG_START + (bar * 4); 203 reg = PCI_MAPREG_START + (bar * 4);
208 if (!pci_mapreg_probe(psc->sc_pc, psc->sc_pcitag, reg, 204 if (!pci_mapreg_probe(psc->sc_pc, psc->sc_pcitag, reg,
209 &psc->sc_bars[bar].vb_type)) { 205 &psc->sc_bars[bar].vb_type)) {
210 /* there is no valid mapping register */ 206 /* there is no valid mapping register */
211 continue; 207 continue;
212 } 208 }
213 if (PCI_MAPREG_TYPE(psc->sc_bars[bar].vb_type) == 209 if (PCI_MAPREG_TYPE(psc->sc_bars[bar].vb_type) ==

cvs diff -r1.61 -r1.62 src/sys/dev/pci/emuxki.c (expand / switch to unified diff)

--- src/sys/dev/pci/emuxki.c 2011/11/24 03:35:58 1.61
+++ src/sys/dev/pci/emuxki.c 2012/01/30 19:41:19 1.62
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: emuxki.c,v 1.61 2011/11/24 03:35:58 mrg Exp $ */ 1/* $NetBSD: emuxki.c,v 1.62 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Yannick Montulet, and by Andrew Doran. 8 * by Yannick Montulet, and by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -39,27 +39,27 @@ @@ -39,27 +39,27 @@
39 * - bass disappear when you plug rear jack-in on Cambridge FPS2000 speakers 39 * - bass disappear when you plug rear jack-in on Cambridge FPS2000 speakers
40 * (and presumably all speakers that support front and rear jack-in) 40 * (and presumably all speakers that support front and rear jack-in)
41 * 41 *
42 * TODO: 42 * TODO:
43 * - Digital Outputs 43 * - Digital Outputs
44 * - (midi/mpu),joystick support 44 * - (midi/mpu),joystick support
45 * - Multiple voices play (problem with /dev/audio architecture) 45 * - Multiple voices play (problem with /dev/audio architecture)
46 * - Multiple sources recording (Pb with audio(4)) 46 * - Multiple sources recording (Pb with audio(4))
47 * - Independent modification of each channel's parameters (via mixer ?) 47 * - Independent modification of each channel's parameters (via mixer ?)
48 * - DSP FX patches (to make fx like chipmunk) 48 * - DSP FX patches (to make fx like chipmunk)
49 */ 49 */
50 50
51#include <sys/cdefs.h> 51#include <sys/cdefs.h>
52__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.61 2011/11/24 03:35:58 mrg Exp $"); 52__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.62 2012/01/30 19:41:19 drochner Exp $");
53 53
54#include <sys/param.h> 54#include <sys/param.h>
55#include <sys/device.h> 55#include <sys/device.h>
56#include <sys/errno.h> 56#include <sys/errno.h>
57#include <sys/systm.h> 57#include <sys/systm.h>
58#include <sys/audioio.h> 58#include <sys/audioio.h>
59#include <sys/select.h> 59#include <sys/select.h>
60#include <sys/mutex.h> 60#include <sys/mutex.h>
61#include <sys/kmem.h> 61#include <sys/kmem.h>
62#include <sys/malloc.h> 62#include <sys/malloc.h>
63 63
64#include <dev/audio_if.h> 64#include <dev/audio_if.h>
65#include <dev/audiovar.h> 65#include <dev/audiovar.h>
@@ -394,48 +394,46 @@ emuxki_match(device_t parent, cfdata_t m @@ -394,48 +394,46 @@ emuxki_match(device_t parent, cfdata_t m
394 case PCI_PRODUCT_CREATIVELABS_SBLIVE2: 394 case PCI_PRODUCT_CREATIVELABS_SBLIVE2:
395 case PCI_PRODUCT_CREATIVELABS_AUDIGY: 395 case PCI_PRODUCT_CREATIVELABS_AUDIGY:
396 return 1; 396 return 1;
397 default: 397 default:
398 return 0; 398 return 0;
399 } 399 }
400} 400}
401 401
402static void 402static void
403emuxki_attach(device_t parent, device_t self, void *aux) 403emuxki_attach(device_t parent, device_t self, void *aux)
404{ 404{
405 struct emuxki_softc *sc; 405 struct emuxki_softc *sc;
406 struct pci_attach_args *pa; 406 struct pci_attach_args *pa;
407 char devinfo[256]; 
408 pci_intr_handle_t ih; 407 pci_intr_handle_t ih;
409 const char *intrstr; 408 const char *intrstr;
410 409
411 sc = device_private(self); 410 sc = device_private(self);
412 sc->sc_dev = self; 411 sc->sc_dev = self;
413 pa = aux; 412 pa = aux;
414 aprint_naive(": Audio controller\n"); 
415 413
416 mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); 414 mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
417 mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_AUDIO); 415 mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_AUDIO);
418 mutex_init(&sc->sc_index_lock, MUTEX_DEFAULT, IPL_AUDIO); 416 mutex_init(&sc->sc_index_lock, MUTEX_DEFAULT, IPL_AUDIO);
419 mutex_init(&sc->sc_ac97_index_lock, MUTEX_DEFAULT, IPL_AUDIO); 417 mutex_init(&sc->sc_ac97_index_lock, MUTEX_DEFAULT, IPL_AUDIO);
420 418
421 if (pci_mapreg_map(pa, EMU_PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, 419 if (pci_mapreg_map(pa, EMU_PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
422 &(sc->sc_iot), &(sc->sc_ioh), &(sc->sc_iob), 420 &(sc->sc_iot), &(sc->sc_ioh), &(sc->sc_iob),
423 &(sc->sc_ios))) { 421 &(sc->sc_ios))) {
424 aprint_error(": can't map iospace\n"); 422 aprint_error(": can't map iospace\n");
425 return; 423 return;
426 } 424 }
427 pci_devinfo(pa->pa_id, pa->pa_class, 1, devinfo, sizeof(devinfo)); 425
428 aprint_normal(": %s\n", devinfo); 426 pci_aprint_devinfo(pa, "Audio controller");
429 427
430 sc->sc_pc = pa->pa_pc; 428 sc->sc_pc = pa->pa_pc;
431 sc->sc_dmat = pa->pa_dmat; 429 sc->sc_dmat = pa->pa_dmat;
432 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, 430 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
433 pci_conf_read(pa->pa_pc, pa->pa_tag, 431 pci_conf_read(pa->pa_pc, pa->pa_tag,
434 (PCI_COMMAND_STATUS_REG) | PCI_COMMAND_MASTER_ENABLE)); 432 (PCI_COMMAND_STATUS_REG) | PCI_COMMAND_MASTER_ENABLE));
435 433
436 if (pci_intr_map(pa, &ih)) { 434 if (pci_intr_map(pa, &ih)) {
437 aprint_error_dev(self, "couldn't map interrupt\n"); 435 aprint_error_dev(self, "couldn't map interrupt\n");
438 bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios); 436 bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios);
439 return; 437 return;
440 } 438 }
441 439

cvs diff -r1.61 -r1.62 src/sys/dev/pci/if_iwn.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_iwn.c 2011/10/08 11:07:09 1.61
+++ src/sys/dev/pci/if_iwn.c 2012/01/30 19:41:20 1.62
@@ -1,38 +1,38 @@ @@ -1,38 +1,38 @@
1/* $NetBSD: if_iwn.c,v 1.61 2011/10/08 11:07:09 elric Exp $ */ 1/* $NetBSD: if_iwn.c,v 1.62 2012/01/30 19:41:20 drochner Exp $ */
2/* $OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $ */ 2/* $OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> 5 * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
6 * 6 *
7 * Permission to use, copy, modify, and distribute this software for any 7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above 8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies. 9 * copyright notice and this permission notice appear in all copies.
10 * 10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */ 18 */
19 19
20/* 20/*
21 * Driver for Intel WiFi Link 4965 and 1000/5000/6000 Series 802.11 network 21 * Driver for Intel WiFi Link 4965 and 1000/5000/6000 Series 802.11 network
22 * adapters. 22 * adapters.
23 */ 23 */
24#include <sys/cdefs.h> 24#include <sys/cdefs.h>
25__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.61 2011/10/08 11:07:09 elric Exp $"); 25__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.62 2012/01/30 19:41:20 drochner Exp $");
26 26
27#define IWN_USE_RBUF /* Use local storage for RX */ 27#define IWN_USE_RBUF /* Use local storage for RX */
28#undef IWN_HWCRYPTO /* XXX does not even compile yet */ 28#undef IWN_HWCRYPTO /* XXX does not even compile yet */
29 29
30#include <sys/param.h> 30#include <sys/param.h>
31#include <sys/sockio.h> 31#include <sys/sockio.h>
32#include <sys/proc.h> 32#include <sys/proc.h>
33#include <sys/mbuf.h> 33#include <sys/mbuf.h>
34#include <sys/kernel.h> 34#include <sys/kernel.h>
35#include <sys/socket.h> 35#include <sys/socket.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/malloc.h> 37#include <sys/malloc.h>
38#include <sys/mutex.h> 38#include <sys/mutex.h>
@@ -329,44 +329,40 @@ iwn_match(device_t parent, cfdata_t matc @@ -329,44 +329,40 @@ iwn_match(device_t parent, cfdata_t matc
329 return 1; 329 return 1;
330 330
331 return 0; 331 return 0;
332} 332}
333 333
334static void 334static void
335iwn_attach(device_t parent __unused, device_t self, void *aux) 335iwn_attach(device_t parent __unused, device_t self, void *aux)
336{ 336{
337 struct iwn_softc *sc = device_private(self); 337 struct iwn_softc *sc = device_private(self);
338 struct ieee80211com *ic = &sc->sc_ic; 338 struct ieee80211com *ic = &sc->sc_ic;
339 struct ifnet *ifp = &sc->sc_ec.ec_if; 339 struct ifnet *ifp = &sc->sc_ec.ec_if;
340 struct pci_attach_args *pa = aux; 340 struct pci_attach_args *pa = aux;
341 const char *intrstr; 341 const char *intrstr;
342 char devinfo[256]; 
343 pci_intr_handle_t ih; 342 pci_intr_handle_t ih;
344 pcireg_t memtype, reg; 343 pcireg_t memtype, reg;
345 int i, error; 344 int i, error;
346 int revision; 
347 345
348 sc->sc_dev = self; 346 sc->sc_dev = self;
349 sc->sc_pct = pa->pa_pc; 347 sc->sc_pct = pa->pa_pc;
350 sc->sc_pcitag = pa->pa_tag; 348 sc->sc_pcitag = pa->pa_tag;
351 sc->sc_dmat = pa->pa_dmat; 349 sc->sc_dmat = pa->pa_dmat;
352 mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NONE); 350 mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NONE);
353 351
354 callout_init(&sc->calib_to, 0); 352 callout_init(&sc->calib_to, 0);
355 callout_setfunc(&sc->calib_to, iwn_calib_timeout, sc); 353 callout_setfunc(&sc->calib_to, iwn_calib_timeout, sc);
356 354
357 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof devinfo); 355 pci_aprint_devinfo(pa, NULL);
358 revision = PCI_REVISION(pa->pa_class); 
359 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision); 
360 356
361 /* 357 /*
362 * Get the offset of the PCI Express Capability Structure in PCI 358 * Get the offset of the PCI Express Capability Structure in PCI
363 * Configuration Space. 359 * Configuration Space.
364 */ 360 */
365 error = pci_get_capability(sc->sc_pct, sc->sc_pcitag, 361 error = pci_get_capability(sc->sc_pct, sc->sc_pcitag,
366 PCI_CAP_PCIEXPRESS, &sc->sc_cap_off, NULL); 362 PCI_CAP_PCIEXPRESS, &sc->sc_cap_off, NULL);
367 if (error == 0) { 363 if (error == 0) {
368 aprint_error(": PCIe capability structure not found!\n"); 364 aprint_error(": PCIe capability structure not found!\n");
369 return; 365 return;
370 } 366 }
371 367
372 /* Clear device-specific "PCI retry timeout" register (41h). */ 368 /* Clear device-specific "PCI retry timeout" register (41h). */

cvs diff -r1.57 -r1.58 src/sys/dev/pci/esa.c (expand / switch to unified diff)

--- src/sys/dev/pci/esa.c 2011/12/03 08:20:12 1.57
+++ src/sys/dev/pci/esa.c 2012/01/30 19:41:19 1.58
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: esa.c,v 1.57 2011/12/03 08:20:12 ryo Exp $ */ 1/* $NetBSD: esa.c,v 1.58 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001-2008 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2001-2008 Jared D. McNeill <jmcneill@invisible.ca>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. The name of the author may not be used to endorse or promote products 12 * 2. The name of the author may not be used to endorse or promote products
13 * derived from this software without specific prior written permission. 13 * derived from this software without specific prior written permission.
14 * 14 *
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29 * ESS Allegro-1 / Maestro3 Audio Driver 29 * ESS Allegro-1 / Maestro3 Audio Driver
30 * 30 *
31 * Based on the FreeBSD maestro3 driver and the NetBSD eap driver. 31 * Based on the FreeBSD maestro3 driver and the NetBSD eap driver.
32 * Original driver by Don Kim. 32 * Original driver by Don Kim.
33 * 33 *
34 * The list management code could possibly be written better, but what 34 * The list management code could possibly be written better, but what
35 * we have right now does the job nicely. Thanks to Zach Brown <zab@zabbo.net> 35 * we have right now does the job nicely. Thanks to Zach Brown <zab@zabbo.net>
36 * and Andrew MacDonald <amac@epsilon.yi.org> for helping me debug the 36 * and Andrew MacDonald <amac@epsilon.yi.org> for helping me debug the
37 * problems with the original list management code present in the Linux 37 * problems with the original list management code present in the Linux
38 * driver. 38 * driver.
39 */ 39 */
40 40
41#include <sys/cdefs.h> 41#include <sys/cdefs.h>
42__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.57 2011/12/03 08:20:12 ryo Exp $"); 42__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.58 2012/01/30 19:41:19 drochner Exp $");
43 43
44#include <sys/types.h> 44#include <sys/types.h>
45#include <sys/errno.h> 45#include <sys/errno.h>
46#include <sys/null.h> 46#include <sys/null.h>
47#include <sys/param.h> 47#include <sys/param.h>
48#include <sys/systm.h> 48#include <sys/systm.h>
49#include <sys/kmem.h> 49#include <sys/kmem.h>
50#include <sys/device.h> 50#include <sys/device.h>
51#include <sys/conf.h> 51#include <sys/conf.h>
52#include <sys/exec.h> 52#include <sys/exec.h>
53#include <sys/select.h> 53#include <sys/select.h>
54#include <sys/audioio.h> 54#include <sys/audioio.h>
55#include <sys/bus.h> 55#include <sys/bus.h>
@@ -998,38 +998,36 @@ esa_match(device_t dev, cfdata_t match,  @@ -998,38 +998,36 @@ esa_match(device_t dev, cfdata_t match,
998} 998}
999 999
1000static void 1000static void
1001esa_attach(device_t parent, device_t self, void *aux) 1001esa_attach(device_t parent, device_t self, void *aux)
1002{ 1002{
1003 struct esa_softc *sc; 1003 struct esa_softc *sc;
1004 struct pci_attach_args *pa; 1004 struct pci_attach_args *pa;
1005 pcitag_t tag; 1005 pcitag_t tag;
1006 pci_chipset_tag_t pc; 1006 pci_chipset_tag_t pc;
1007 pci_intr_handle_t ih; 1007 pci_intr_handle_t ih;
1008 const struct esa_card_type *card; 1008 const struct esa_card_type *card;
1009 const char *intrstr; 1009 const char *intrstr;
1010 uint32_t data; 1010 uint32_t data;
1011 char devinfo[256]; 
1012 int revision, i, error; 1011 int revision, i, error;
1013 1012
1014 sc = device_private(self); 1013 sc = device_private(self);
1015 pa = (struct pci_attach_args *)aux; 1014 pa = (struct pci_attach_args *)aux;
1016 tag = pa->pa_tag; 1015 tag = pa->pa_tag;
1017 pc = pa->pa_pc; 1016 pc = pa->pa_pc;
1018 aprint_naive(": Audio controller\n"); 
1019 1017
1020 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 1018 pci_aprint_devinfo(pa, "Audio controller");
 1019
1021 revision = PCI_REVISION(pa->pa_class); 1020 revision = PCI_REVISION(pa->pa_class);
1022 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision); 
1023 1021
1024 for (card = esa_card_types; card->pci_vendor_id; card++) 1022 for (card = esa_card_types; card->pci_vendor_id; card++)
1025 if (PCI_VENDOR(pa->pa_id) == card->pci_vendor_id && 1023 if (PCI_VENDOR(pa->pa_id) == card->pci_vendor_id &&
1026 PCI_PRODUCT(pa->pa_id) == card->pci_product_id) { 1024 PCI_PRODUCT(pa->pa_id) == card->pci_product_id) {
1027 sc->type = card->type; 1025 sc->type = card->type;
1028 sc->delay1 = card->delay1; 1026 sc->delay1 = card->delay1;
1029 sc->delay2 = card->delay2; 1027 sc->delay2 = card->delay2;
1030 break; 1028 break;
1031 } 1029 }
1032 1030
1033 data = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); 1031 data = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
1034 data |= (PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE 1032 data |= (PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE
1035 | PCI_COMMAND_MASTER_ENABLE); 1033 | PCI_COMMAND_MASTER_ENABLE);

cvs diff -r1.55 -r1.56 src/sys/dev/pci/esm.c (expand / switch to unified diff)

--- src/sys/dev/pci/esm.c 2011/11/24 03:35:59 1.55
+++ src/sys/dev/pci/esm.c 2012/01/30 19:41:19 1.56
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: esm.c,v 1.55 2011/11/24 03:35:59 mrg Exp $ */ 1/* $NetBSD: esm.c,v 1.56 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002, 2003 Matt Fredette 4 * Copyright (c) 2002, 2003 Matt Fredette
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Copyright (c) 2000, 2001 Rene Hexel <rh@NetBSD.org> 7 * Copyright (c) 2000, 2001 Rene Hexel <rh@NetBSD.org>
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Copyright (c) 2000 Taku YAMAMOTO <taku@cent.saitama-u.ac.jp> 10 * Copyright (c) 2000 Taku YAMAMOTO <taku@cent.saitama-u.ac.jp>
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -56,27 +56,27 @@ @@ -56,27 +56,27 @@
56 * Zach Brown <zab@zabbo.net>. 56 * Zach Brown <zab@zabbo.net>.
57 * 57 *
58 * busdma()-ize and buffer size reduction were suggested by 58 * busdma()-ize and buffer size reduction were suggested by
59 * Cameron Grant <gandalf@vilnya.demon.co.uk>. 59 * Cameron Grant <gandalf@vilnya.demon.co.uk>.
60 * Also he showed me the way to use busdma() suite. 60 * Also he showed me the way to use busdma() suite.
61 * 61 *
62 * Internal speaker problems on NEC VersaPro's and Dell Inspiron 7500 62 * Internal speaker problems on NEC VersaPro's and Dell Inspiron 7500
63 * were looked at by 63 * were looked at by
64 * Munehiro Matsuda <haro@tk.kubota.co.jp>, 64 * Munehiro Matsuda <haro@tk.kubota.co.jp>,
65 * who brought patches based on the Linux driver with some simplification. 65 * who brought patches based on the Linux driver with some simplification.
66 */ 66 */
67 67
68#include <sys/cdefs.h> 68#include <sys/cdefs.h>
69__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.55 2011/11/24 03:35:59 mrg Exp $"); 69__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.56 2012/01/30 19:41:19 drochner Exp $");
70 70
71#include <sys/param.h> 71#include <sys/param.h>
72#include <sys/systm.h> 72#include <sys/systm.h>
73#include <sys/kernel.h> 73#include <sys/kernel.h>
74#include <sys/kmem.h> 74#include <sys/kmem.h>
75#include <sys/device.h> 75#include <sys/device.h>
76#include <sys/bus.h> 76#include <sys/bus.h>
77#include <sys/audioio.h> 77#include <sys/audioio.h>
78 78
79#include <dev/audio_if.h> 79#include <dev/audio_if.h>
80#include <dev/mulaw.h> 80#include <dev/mulaw.h>
81#include <dev/auconv.h> 81#include <dev/auconv.h>
82 82
@@ -1578,49 +1578,44 @@ esm_match(device_t dev, cfdata_t match,  @@ -1578,49 +1578,44 @@ esm_match(device_t dev, cfdata_t match,
1578 1578
1579 case PCI_VENDOR_ESSTECH2: 1579 case PCI_VENDOR_ESSTECH2:
1580 switch (PCI_PRODUCT(pa->pa_id)) { 1580 switch (PCI_PRODUCT(pa->pa_id)) {
1581 case PCI_PRODUCT_ESSTECH2_MAESTRO1: 1581 case PCI_PRODUCT_ESSTECH2_MAESTRO1:
1582 return 1; 1582 return 1;
1583 } 1583 }
1584 } 1584 }
1585 return 0; 1585 return 0;
1586} 1586}
1587 1587
1588static void 1588static void
1589esm_attach(device_t parent, device_t self, void *aux) 1589esm_attach(device_t parent, device_t self, void *aux)
1590{ 1590{
1591 char devinfo[256]; 
1592 struct esm_softc *ess; 1591 struct esm_softc *ess;
1593 struct pci_attach_args *pa; 1592 struct pci_attach_args *pa;
1594 const char *intrstr; 1593 const char *intrstr;
1595 pci_chipset_tag_t pc; 1594 pci_chipset_tag_t pc;
1596 pcitag_t tag; 1595 pcitag_t tag;
1597 pci_intr_handle_t ih; 1596 pci_intr_handle_t ih;
1598 pcireg_t csr, data; 1597 pcireg_t csr, data;
1599 int revision; 
1600 uint16_t codec_data; 1598 uint16_t codec_data;
1601 uint16_t pcmbar; 1599 uint16_t pcmbar;
1602 int error; 1600 int error;
1603 1601
1604 ess = device_private(self); 1602 ess = device_private(self);
1605 ess->sc_dev = self; 1603 ess->sc_dev = self;
1606 pa = (struct pci_attach_args *)aux; 1604 pa = (struct pci_attach_args *)aux;
1607 pc = pa->pa_pc; 1605 pc = pa->pa_pc;
1608 tag = pa->pa_tag; 1606 tag = pa->pa_tag;
1609 aprint_naive(": Audio controller\n"); 
1610 1607
1611 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 1608 pci_aprint_devinfo(pa, "Audio controller");
1612 revision = PCI_REVISION(pa->pa_class); 
1613 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision); 
1614 1609
1615 mutex_init(&ess->sc_lock, MUTEX_DEFAULT, IPL_NONE); 1610 mutex_init(&ess->sc_lock, MUTEX_DEFAULT, IPL_NONE);
1616 mutex_init(&ess->sc_intr_lock, MUTEX_DEFAULT, IPL_AUDIO); 1611 mutex_init(&ess->sc_intr_lock, MUTEX_DEFAULT, IPL_AUDIO);
1617 1612
1618 /* Enable the device. */ 1613 /* Enable the device. */
1619 csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); 1614 csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
1620 pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, 1615 pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
1621 csr | PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_IO_ENABLE); 1616 csr | PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_IO_ENABLE);
1622 1617
1623 /* Map I/O register */ 1618 /* Map I/O register */
1624 if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, 1619 if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
1625 &ess->st, &ess->sh, NULL, &ess->sz)) { 1620 &ess->st, &ess->sh, NULL, &ess->sz)) {
1626 aprint_error_dev(ess->sc_dev, "can't map i/o space\n"); 1621 aprint_error_dev(ess->sc_dev, "can't map i/o space\n");

cvs diff -r1.39 -r1.40 src/sys/dev/pci/fwohci_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/fwohci_pci.c 2010/04/29 06:41:27 1.39
+++ src/sys/dev/pci/fwohci_pci.c 2012/01/30 19:41:19 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fwohci_pci.c,v 1.39 2010/04/29 06:41:27 kiyohara Exp $ */ 1/* $NetBSD: fwohci_pci.c,v 1.40 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matt Thomas of 3am Software Foundry. 8 * by Matt Thomas of 3am Software Foundry.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: fwohci_pci.c,v 1.39 2010/04/29 06:41:27 kiyohara Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: fwohci_pci.c,v 1.40 2012/01/30 19:41:19 drochner Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/bus.h> 36#include <sys/bus.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/intr.h> 38#include <sys/intr.h>
39#include <sys/select.h> 39#include <sys/select.h>
40#include <sys/socket.h> 40#include <sys/socket.h>
41#include <sys/systm.h> 41#include <sys/systm.h>
42 42
43#include <dev/pci/pcidevs.h> 43#include <dev/pci/pcidevs.h>
44#include <dev/pci/pcireg.h> 44#include <dev/pci/pcireg.h>
45#include <dev/pci/pcivar.h> 45#include <dev/pci/pcivar.h>
46#include <dev/ieee1394/firewire.h> 46#include <dev/ieee1394/firewire.h>
@@ -86,36 +86,31 @@ fwohci_pci_match(device_t parent, cfdata @@ -86,36 +86,31 @@ fwohci_pci_match(device_t parent, cfdata
86 if (PCI_CLASS(pa->pa_class) == PCI_CLASS_SERIALBUS && 86 if (PCI_CLASS(pa->pa_class) == PCI_CLASS_SERIALBUS &&
87 PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_SERIALBUS_FIREWIRE && 87 PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_SERIALBUS_FIREWIRE &&
88 PCI_INTERFACE(pa->pa_class) == PCI_INTERFACE_OHCI) 88 PCI_INTERFACE(pa->pa_class) == PCI_INTERFACE_OHCI)
89 return 1; 89 return 1;
90 90
91 return 0; 91 return 0;
92} 92}
93 93
94static void 94static void
95fwohci_pci_attach(device_t parent, device_t self, void *aux) 95fwohci_pci_attach(device_t parent, device_t self, void *aux)
96{ 96{
97 struct pci_attach_args *pa = (struct pci_attach_args *) aux; 97 struct pci_attach_args *pa = (struct pci_attach_args *) aux;
98 struct fwohci_pci_softc *psc = device_private(self); 98 struct fwohci_pci_softc *psc = device_private(self);
99 char devinfo[256]; 
100 char const *intrstr; 99 char const *intrstr;
101 pci_intr_handle_t ih; 100 pci_intr_handle_t ih;
102 uint32_t csr; 101 uint32_t csr;
103 102
104 aprint_naive(": IEEE 1394 Controller\n"); 103 pci_aprint_devinfo(pa, "IEEE 1394 Controller");
105 
106 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
107 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
108 PCI_REVISION(pa->pa_class)); 
109 104
110 psc->psc_sc.fc.dev = self; 105 psc->psc_sc.fc.dev = self;
111 psc->psc_sc.fc.dmat = pa->pa_dmat; 106 psc->psc_sc.fc.dmat = pa->pa_dmat;
112 psc->psc_pc = pa->pa_pc; 107 psc->psc_pc = pa->pa_pc;
113 psc->psc_tag = pa->pa_tag; 108 psc->psc_tag = pa->pa_tag;
114 109
115 /* Map I/O registers */ 110 /* Map I/O registers */
116 if (pci_mapreg_map(pa, PCI_OHCI_MAP_REGISTER, PCI_MAPREG_TYPE_MEM, 0, 111 if (pci_mapreg_map(pa, PCI_OHCI_MAP_REGISTER, PCI_MAPREG_TYPE_MEM, 0,
117 &psc->psc_sc.bst, &psc->psc_sc.bsh, 112 &psc->psc_sc.bst, &psc->psc_sc.bsh,
118 NULL, &psc->psc_sc.bssize)) { 113 NULL, &psc->psc_sc.bssize)) {
119 aprint_error_dev(self, "can't map OHCI register space\n"); 114 aprint_error_dev(self, "can't map OHCI register space\n");
120 goto fail; 115 goto fail;
121 } 116 }

cvs diff -r1.39 -r1.40 src/sys/dev/pci/if_epic_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_epic_pci.c 2011/07/26 20:51:24 1.39
+++ src/sys/dev/pci/if_epic_pci.c 2012/01/30 19:41:19 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_epic_pci.c,v 1.39 2011/07/26 20:51:24 dyoung Exp $ */ 1/* $NetBSD: if_epic_pci.c,v 1.40 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33/* 33/*
34 * PCI bus front-end for the Standard Microsystems Corp. 83C170 34 * PCI bus front-end for the Standard Microsystems Corp. 83C170
35 * Ethernet PCI Integrated Controller (EPIC/100) driver. 35 * Ethernet PCI Integrated Controller (EPIC/100) driver.
36 */ 36 */
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: if_epic_pci.c,v 1.39 2011/07/26 20:51:24 dyoung Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: if_epic_pci.c,v 1.40 2012/01/30 19:41:19 drochner Exp $");
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/mbuf.h> 43#include <sys/mbuf.h>
44#include <sys/malloc.h> 44#include <sys/malloc.h>
45#include <sys/kernel.h> 45#include <sys/kernel.h>
46#include <sys/socket.h> 46#include <sys/socket.h>
47#include <sys/ioctl.h> 47#include <sys/ioctl.h>
48#include <sys/errno.h> 48#include <sys/errno.h>
49#include <sys/device.h> 49#include <sys/device.h>
50 50
51#include <net/if.h> 51#include <net/if.h>
52#include <net/if_dl.h> 52#include <net/if_dl.h>
@@ -157,36 +157,33 @@ epic_pci_attach(device_t parent, device_ @@ -157,36 +157,33 @@ epic_pci_attach(device_t parent, device_
157 struct pci_attach_args *pa = aux; 157 struct pci_attach_args *pa = aux;
158 pci_chipset_tag_t pc = pa->pa_pc; 158 pci_chipset_tag_t pc = pa->pa_pc;
159 pci_intr_handle_t ih; 159 pci_intr_handle_t ih;
160 const char *intrstr = NULL; 160 const char *intrstr = NULL;
161 const struct epic_pci_product *epp; 161 const struct epic_pci_product *epp;
162 const struct epic_pci_subsys_info *esp; 162 const struct epic_pci_subsys_info *esp;
163 bus_space_tag_t iot, memt; 163 bus_space_tag_t iot, memt;
164 bus_space_handle_t ioh, memh; 164 bus_space_handle_t ioh, memh;
165 int ioh_valid, memh_valid; 165 int ioh_valid, memh_valid;
166 int error; 166 int error;
167 167
168 sc->sc_dev = self; 168 sc->sc_dev = self;
169 169
170 aprint_naive(": Ethernet controller\n"); 
171 
172 epp = epic_pci_lookup(pa); 170 epp = epic_pci_lookup(pa);
173 if (epp == NULL) { 171 if (epp == NULL) {
174 aprint_normal("\n"); 172 aprint_normal("\n");
175 panic("%s: impossible", __func__); 173 panic("%s: impossible", __func__);
176 } 174 }
177 175
178 aprint_normal(": %s, rev. %d\n", epp->epp_name, 176 pci_aprint_devinfo_fancy(pa, "Ethernet controller", epp->epp_name, 1);
179 PCI_REVISION(pa->pa_class)); 
180 177
181 /* power up chip */ 178 /* power up chip */
182 if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self, 179 if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
183 NULL)) && error != EOPNOTSUPP) { 180 NULL)) && error != EOPNOTSUPP) {
184 aprint_error_dev(self, "cannot activate %d\n", error); 181 aprint_error_dev(self, "cannot activate %d\n", error);
185 return; 182 return;
186 } 183 }
187 184
188 /* 185 /*
189 * Map the device. 186 * Map the device.
190 */ 187 */
191 ioh_valid = (pci_mapreg_map(pa, EPIC_PCI_IOBA, 188 ioh_valid = (pci_mapreg_map(pa, EPIC_PCI_IOBA,
192 PCI_MAPREG_TYPE_IO, 0, 189 PCI_MAPREG_TYPE_IO, 0,

cvs diff -r1.39 -r1.40 src/sys/dev/pci/twa.c (expand / switch to unified diff)

--- src/sys/dev/pci/twa.c 2012/01/27 19:48:39 1.39
+++ src/sys/dev/pci/twa.c 2012/01/30 19:41:23 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: twa.c,v 1.39 2012/01/27 19:48:39 para Exp $ */ 1/* $NetBSD: twa.c,v 1.40 2012/01/30 19:41:23 drochner Exp $ */
2/* $wasabi: twa.c,v 1.27 2006/07/28 18:17:21 wrstuden Exp $ */ 2/* $wasabi: twa.c,v 1.27 2006/07/28 18:17:21 wrstuden Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2004 The NetBSD Foundation, Inc. 5 * Copyright (c) 2004 The NetBSD Foundation, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to The NetBSD Foundation 8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Jordan Rhody of Wasabi Systems, Inc. 9 * by Jordan Rhody of Wasabi Systems, Inc.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -57,27 +57,27 @@ @@ -57,27 +57,27 @@
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE. 58 * SUCH DAMAGE.
59 * 59 *
60 * $FreeBSD: src/sys/dev/twa/twa.c,v 1.2 2004/04/02 15:09:57 des Exp $ 60 * $FreeBSD: src/sys/dev/twa/twa.c,v 1.2 2004/04/02 15:09:57 des Exp $
61 */ 61 */
62 62
63/* 63/*
64 * 3ware driver for 9000 series storage controllers. 64 * 3ware driver for 9000 series storage controllers.
65 * 65 *
66 * Author: Vinod Kashyap 66 * Author: Vinod Kashyap
67 */ 67 */
68 68
69#include <sys/cdefs.h> 69#include <sys/cdefs.h>
70__KERNEL_RCSID(0, "$NetBSD: twa.c,v 1.39 2012/01/27 19:48:39 para Exp $"); 70__KERNEL_RCSID(0, "$NetBSD: twa.c,v 1.40 2012/01/30 19:41:23 drochner Exp $");
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/systm.h> 73#include <sys/systm.h>
74#include <sys/kernel.h> 74#include <sys/kernel.h>
75#include <sys/device.h> 75#include <sys/device.h>
76#include <sys/queue.h> 76#include <sys/queue.h>
77#include <sys/proc.h> 77#include <sys/proc.h>
78#include <sys/bswap.h> 78#include <sys/bswap.h>
79#include <sys/buf.h> 79#include <sys/buf.h>
80#include <sys/bufq.h> 80#include <sys/bufq.h>
81#include <sys/endian.h> 81#include <sys/endian.h>
82#include <sys/malloc.h> 82#include <sys/malloc.h>
83#include <sys/conf.h> 83#include <sys/conf.h>
@@ -1495,28 +1495,27 @@ twa_attach(device_t parent, device_t sel @@ -1495,28 +1495,27 @@ twa_attach(device_t parent, device_t sel
1495 pci_intr_handle_t ih; 1495 pci_intr_handle_t ih;
1496 const char *intrstr; 1496 const char *intrstr;
1497 const struct sysctlnode *node;  1497 const struct sysctlnode *node;
1498 int i; 1498 int i;
1499 bool use_64bit; 1499 bool use_64bit;
1500 1500
1501 sc = device_private(self); 1501 sc = device_private(self);
1502 1502
1503 pa = aux; 1503 pa = aux;
1504 pc = pa->pa_pc; 1504 pc = pa->pa_pc;
1505 sc->pc = pa->pa_pc; 1505 sc->pc = pa->pa_pc;
1506 sc->tag = pa->pa_tag; 1506 sc->tag = pa->pa_tag;
1507 1507
1508 aprint_naive(": RAID controller\n"); 1508 pci_aprint_devinfo_fancy(pa, "RAID controller", "3ware Apache", 0);
1509 aprint_normal(": 3ware Apache\n"); 
1510 1509
1511 sc->sc_quirks = 0; 1510 sc->sc_quirks = 0;
1512  1511
1513 if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3WARE_9000) { 1512 if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3WARE_9000) {
1514 sc->sc_nunits = TWA_MAX_UNITS; 1513 sc->sc_nunits = TWA_MAX_UNITS;
1515 use_64bit = false; 1514 use_64bit = false;
1516 if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_IO, 0, 1515 if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_IO, 0,
1517 &sc->twa_bus_iot, &sc->twa_bus_ioh, NULL, NULL)) { 1516 &sc->twa_bus_iot, &sc->twa_bus_ioh, NULL, NULL)) {
1518 aprint_error_dev(&sc->twa_dv, "can't map i/o space\n"); 1517 aprint_error_dev(&sc->twa_dv, "can't map i/o space\n");
1519 return; 1518 return;
1520 } 1519 }
1521 } else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3WARE_9550) { 1520 } else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3WARE_9550) {
1522 sc->sc_nunits = TWA_MAX_UNITS; 1521 sc->sc_nunits = TWA_MAX_UNITS;

cvs diff -r1.32 -r1.33 src/sys/dev/pci/genfb_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/genfb_pci.c 2011/03/08 03:22:29 1.32
+++ src/sys/dev/pci/genfb_pci.c 2012/01/30 19:41:19 1.33
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: genfb_pci.c,v 1.32 2011/03/08 03:22:29 macallan Exp $ */ 1/* $NetBSD: genfb_pci.c,v 1.33 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007 Michael Lorenz 4 * Copyright (c) 2007 Michael Lorenz
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.32 2011/03/08 03:22:29 macallan Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.33 2012/01/30 19:41:19 drochner Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/systm.h> 33#include <sys/systm.h>
34#include <sys/kernel.h> 34#include <sys/kernel.h>
35#include <sys/device.h> 35#include <sys/device.h>
36#include <sys/proc.h> 36#include <sys/proc.h>
37#include <sys/mutex.h> 37#include <sys/mutex.h>
38#include <sys/ioctl.h> 38#include <sys/ioctl.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/kauth.h> 41#include <sys/kauth.h>
42 42
43#include <dev/pci/pcidevs.h> 43#include <dev/pci/pcidevs.h>
@@ -91,31 +91,28 @@ pci_genfb_match(device_t parent, cfdata_ @@ -91,31 +91,28 @@ pci_genfb_match(device_t parent, cfdata_
91 return matchlvl; 91 return matchlvl;
92 92
93 return 0; 93 return 0;
94} 94}
95 95
96static void 96static void
97pci_genfb_attach(device_t parent, device_t self, void *aux) 97pci_genfb_attach(device_t parent, device_t self, void *aux)
98{ 98{
99 struct pci_genfb_softc *sc = device_private(self); 99 struct pci_genfb_softc *sc = device_private(self);
100 struct pci_attach_args *pa = aux; 100 struct pci_attach_args *pa = aux;
101 struct genfb_ops ops; 101 struct genfb_ops ops;
102 pcireg_t rom; 102 pcireg_t rom;
103 int idx, bar, type; 103 int idx, bar, type;
104 char devinfo[256]; 
105 104
106 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 105 pci_aprint_devinfo(pa, NULL);
107 aprint_naive("\n"); 
108 aprint_normal(": %s\n", devinfo); 
109 106
110 sc->sc_gen.sc_dev = self; 107 sc->sc_gen.sc_dev = self;
111 sc->sc_memt = pa->pa_memt; 108 sc->sc_memt = pa->pa_memt;
112 sc->sc_iot = pa->pa_iot;  109 sc->sc_iot = pa->pa_iot;
113 sc->sc_pc = pa->pa_pc; 110 sc->sc_pc = pa->pa_pc;
114 sc->sc_pcitag = pa->pa_tag; 111 sc->sc_pcitag = pa->pa_tag;
115 sc->sc_want_wsfb = 0; 112 sc->sc_want_wsfb = 0;
116 113
117 genfb_init(&sc->sc_gen); 114 genfb_init(&sc->sc_gen);
118 115
119 /* firmware / MD code responsible for restoring the display */ 116 /* firmware / MD code responsible for restoring the display */
120 if (sc->sc_gen.sc_pmfcb == NULL) 117 if (sc->sc_gen.sc_pmfcb == NULL)
121 pmf_device_register1(self, NULL, NULL, 118 pmf_device_register1(self, NULL, NULL,

cvs diff -r1.32 -r1.33 src/sys/dev/pci/if_an_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_an_pci.c 2011/07/26 20:51:23 1.32
+++ src/sys/dev/pci/if_an_pci.c 2012/01/30 19:41:19 1.33
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_an_pci.c,v 1.32 2011/07/26 20:51:23 dyoung Exp $ */ 1/* $NetBSD: if_an_pci.c,v 1.33 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Atsushi Onoe. 8 * by Atsushi Onoe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * PCI bus front-end for the Aironet PC4500/PC4800 Wireless LAN Adapter. 33 * PCI bus front-end for the Aironet PC4500/PC4800 Wireless LAN Adapter.
34 * Unlike WaveLAN, this adapter attached as PCI device using a PLX 9050 34 * Unlike WaveLAN, this adapter attached as PCI device using a PLX 9050
35 * PCI to "dumb bus" bridge chip. 35 * PCI to "dumb bus" bridge chip.
36 */ 36 */
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: if_an_pci.c,v 1.32 2011/07/26 20:51:23 dyoung Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: if_an_pci.c,v 1.33 2012/01/30 19:41:19 drochner Exp $");
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/mbuf.h> 43#include <sys/mbuf.h>
44#include <sys/malloc.h> 44#include <sys/malloc.h>
45#include <sys/kernel.h> 45#include <sys/kernel.h>
46#include <sys/socket.h> 46#include <sys/socket.h>
47#include <sys/ioctl.h> 47#include <sys/ioctl.h>
48#include <sys/errno.h> 48#include <sys/errno.h>
49#include <sys/device.h> 49#include <sys/device.h>
50#include <sys/callout.h> 50#include <sys/callout.h>
51 51
52#include <machine/endian.h> 52#include <machine/endian.h>
@@ -108,40 +108,36 @@ an_pci_match(device_t parent, cfdata_t m @@ -108,40 +108,36 @@ an_pci_match(device_t parent, cfdata_t m
108 if (PCI_VENDOR(pa->pa_id) == app->app_vendor && 108 if (PCI_VENDOR(pa->pa_id) == app->app_vendor &&
109 PCI_PRODUCT(pa->pa_id) == app->app_product) 109 PCI_PRODUCT(pa->pa_id) == app->app_product)
110 return 1; 110 return 1;
111 } 111 }
112 return 0; 112 return 0;
113} 113}
114 114
115static void 115static void
116an_pci_attach(device_t parent, device_t self, void *aux) 116an_pci_attach(device_t parent, device_t self, void *aux)
117{ 117{
118 struct pci_attach_args *pa = (struct pci_attach_args *)aux; 118 struct pci_attach_args *pa = (struct pci_attach_args *)aux;
119 struct an_pci_softc *psc = device_private(self); 119 struct an_pci_softc *psc = device_private(self);
120 struct an_softc *sc = &psc->sc_an; 120 struct an_softc *sc = &psc->sc_an;
121 char devinfo[256]; 
122 char const *intrstr; 121 char const *intrstr;
123 pci_intr_handle_t ih; 122 pci_intr_handle_t ih;
124 bus_size_t iosize; 123 bus_size_t iosize;
125 u_int32_t csr; 124 u_int32_t csr;
126 125
127 sc->sc_dev = self; 126 sc->sc_dev = self;
128 psc->sc_pct = pa->pa_pc; 127 psc->sc_pct = pa->pa_pc;
129 psc->sc_pcitag = pa->pa_tag; 128 psc->sc_pcitag = pa->pa_tag;
130 129
131 aprint_naive(": 802.11 controller\n"); 130 pci_aprint_devinfo(pa, "802.11 controller");
132 
133 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
134 aprint_normal(": %s\n", devinfo); 
135 131
136 /* Map I/O registers */ 132 /* Map I/O registers */
137 if (pci_mapreg_map(pa, AN_PCI_IOBA, PCI_MAPREG_TYPE_IO, 0, 133 if (pci_mapreg_map(pa, AN_PCI_IOBA, PCI_MAPREG_TYPE_IO, 0,
138 &sc->sc_iot, &sc->sc_ioh, NULL, &iosize) != 0) { 134 &sc->sc_iot, &sc->sc_ioh, NULL, &iosize) != 0) {
139 aprint_error_dev(self, "unable to map registers\n"); 135 aprint_error_dev(self, "unable to map registers\n");
140 return; 136 return;
141 } 137 }
142 138
143 /* Enable the device. */ 139 /* Enable the device. */
144 csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); 140 csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
145 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, 141 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
146 csr | PCI_COMMAND_MASTER_ENABLE); 142 csr | PCI_COMMAND_MASTER_ENABLE);
147 143

cvs diff -r1.32 -r1.33 src/sys/dev/pci/if_dge.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_dge.c 2011/11/19 22:51:23 1.32
+++ src/sys/dev/pci/if_dge.c 2012/01/30 19:41:19 1.33
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_dge.c,v 1.32 2011/11/19 22:51:23 tls Exp $ */ 1/* $NetBSD: if_dge.c,v 1.33 2012/01/30 19:41:19 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2004, SUNET, Swedish University Computer Network. 4 * Copyright (c) 2004, SUNET, Swedish University Computer Network.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Anders Magnusson for SUNET, Swedish University Computer Network. 7 * Written by Anders Magnusson for SUNET, Swedish University Computer Network.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -70,27 +70,27 @@ @@ -70,27 +70,27 @@
70 */ 70 */
71 71
72/* 72/*
73 * Device driver for the Intel 82597EX Ten Gigabit Ethernet controller. 73 * Device driver for the Intel 82597EX Ten Gigabit Ethernet controller.
74 * 74 *
75 * TODO (in no specific order): 75 * TODO (in no specific order):
76 * HW VLAN support. 76 * HW VLAN support.
77 * TSE offloading (needs kernel changes...) 77 * TSE offloading (needs kernel changes...)
78 * RAIDC (receive interrupt delay adaptation) 78 * RAIDC (receive interrupt delay adaptation)
79 * Use memory > 4GB. 79 * Use memory > 4GB.
80 */ 80 */
81 81
82#include <sys/cdefs.h> 82#include <sys/cdefs.h>
83__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.32 2011/11/19 22:51:23 tls Exp $"); 83__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.33 2012/01/30 19:41:19 drochner Exp $");
84 84
85#include "rnd.h" 85#include "rnd.h"
86 86
87#include <sys/param.h> 87#include <sys/param.h>
88#include <sys/systm.h> 88#include <sys/systm.h>
89#include <sys/callout.h> 89#include <sys/callout.h>
90#include <sys/mbuf.h> 90#include <sys/mbuf.h>
91#include <sys/malloc.h> 91#include <sys/malloc.h>
92#include <sys/kernel.h> 92#include <sys/kernel.h>
93#include <sys/socket.h> 93#include <sys/socket.h>
94#include <sys/ioctl.h> 94#include <sys/ioctl.h>
95#include <sys/errno.h> 95#include <sys/errno.h>
96#include <sys/device.h> 96#include <sys/device.h>
@@ -669,29 +669,28 @@ dge_attach(device_t parent, device_t sel @@ -669,29 +669,28 @@ dge_attach(device_t parent, device_t sel
669 pci_chipset_tag_t pc = pa->pa_pc; 669 pci_chipset_tag_t pc = pa->pa_pc;
670 pci_intr_handle_t ih; 670 pci_intr_handle_t ih;
671 const char *intrstr = NULL; 671 const char *intrstr = NULL;
672 bus_dma_segment_t seg; 672 bus_dma_segment_t seg;
673 int i, rseg, error; 673 int i, rseg, error;
674 uint8_t enaddr[ETHER_ADDR_LEN]; 674 uint8_t enaddr[ETHER_ADDR_LEN];
675 pcireg_t preg, memtype; 675 pcireg_t preg, memtype;
676 uint32_t reg; 676 uint32_t reg;
677 677
678 sc->sc_dmat = pa->pa_dmat; 678 sc->sc_dmat = pa->pa_dmat;
679 sc->sc_pc = pa->pa_pc; 679 sc->sc_pc = pa->pa_pc;
680 sc->sc_pt = pa->pa_tag; 680 sc->sc_pt = pa->pa_tag;
681 681
682 preg = PCI_REVISION(pci_conf_read(pc, pa->pa_tag, PCI_CLASS_REG)); 682 pci_aprint_devinfo_fancy(pa, "Ethernet controller",
683 aprint_naive(": Ethernet controller\n"); 683 "Intel i82597EX 10GbE-LR Ethernet", 1);
684 aprint_normal(": Intel i82597EX 10GbE-LR Ethernet, rev. %d\n", preg); 
685 684
686 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, DGE_PCI_BAR); 685 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, DGE_PCI_BAR);
687 if (pci_mapreg_map(pa, DGE_PCI_BAR, memtype, 0, 686 if (pci_mapreg_map(pa, DGE_PCI_BAR, memtype, 0,
688 &sc->sc_st, &sc->sc_sh, NULL, NULL)) { 687 &sc->sc_st, &sc->sc_sh, NULL, NULL)) {
689 aprint_error_dev(&sc->sc_dev, "unable to map device registers\n"); 688 aprint_error_dev(&sc->sc_dev, "unable to map device registers\n");
690 return; 689 return;
691 } 690 }
692 691
693 /* Enable bus mastering */ 692 /* Enable bus mastering */
694 preg = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); 693 preg = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
695 preg |= PCI_COMMAND_MASTER_ENABLE; 694 preg |= PCI_COMMAND_MASTER_ENABLE;
696 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, preg); 695 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, preg);
697 696

cvs diff -r1.17 -r1.18 src/sys/dev/pci/gtp.c (expand / switch to unified diff)

--- src/sys/dev/pci/gtp.c 2009/05/12 08:23:00 1.17
+++ src/sys/dev/pci/gtp.c 2012/01/30 19:41:19 1.18
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gtp.c,v 1.17 2009/05/12 08:23:00 cegger Exp $ */ 1/* $NetBSD: gtp.c,v 1.18 2012/01/30 19:41:19 drochner Exp $ */
2/* $OpenBSD: gtp.c,v 1.1 2002/06/03 16:13:21 mickey Exp $ */ 2/* $OpenBSD: gtp.c,v 1.1 2002/06/03 16:13:21 mickey Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2002 Vladimir Popov <jumbo@narod.ru> 5 * Copyright (c) 2002 Vladimir Popov <jumbo@narod.ru>
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
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29/* Gemtek PCI Radio Card Device Driver */ 29/* Gemtek PCI Radio Card Device Driver */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: gtp.c,v 1.17 2009/05/12 08:23:00 cegger Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: gtp.c,v 1.18 2012/01/30 19:41:19 drochner Exp $");
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/systm.h> 35#include <sys/systm.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/errno.h> 37#include <sys/errno.h>
38#include <sys/ioctl.h> 38#include <sys/ioctl.h>
39#include <sys/proc.h> 39#include <sys/proc.h>
40#include <sys/radioio.h> 40#include <sys/radioio.h>
41 41
42#include <sys/bus.h> 42#include <sys/bus.h>
43 43
44#include <dev/pci/pcireg.h> 44#include <dev/pci/pcireg.h>
45#include <dev/pci/pcivar.h> 45#include <dev/pci/pcivar.h>
@@ -137,33 +137,28 @@ gtp_match(device_t parent, cfdata_t cf,  @@ -137,33 +137,28 @@ gtp_match(device_t parent, cfdata_t cf,
137#endif 137#endif
138 return (0); 138 return (0);
139} 139}
140 140
141static void 141static void
142gtp_attach(device_t parent, device_t self, void *aux) 142gtp_attach(device_t parent, device_t self, void *aux)
143{ 143{
144 struct gtp_softc *sc = device_private(self); 144 struct gtp_softc *sc = device_private(self);
145 struct pci_attach_args *pa = aux; 145 struct pci_attach_args *pa = aux;
146 cfdata_t cf = device_cfdata(&sc->sc_dev); 146 cfdata_t cf = device_cfdata(&sc->sc_dev);
147 pci_chipset_tag_t pc = pa->pa_pc; 147 pci_chipset_tag_t pc = pa->pa_pc;
148 bus_size_t iosize; 148 bus_size_t iosize;
149 pcireg_t csr; 149 pcireg_t csr;
150 char devinfo[256]; 
151 150
152 aprint_naive(": Radio controller\n"); 151 pci_aprint_devinfo(pa, "Radio controller");
153 
154 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
155 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
156 PCI_REVISION(pa->pa_class)); 
157 152
158 /* Map I/O registers */ 153 /* Map I/O registers */
159 if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, &sc->tea.iot, 154 if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, &sc->tea.iot,
160 &sc->tea.ioh, NULL, &iosize)) { 155 &sc->tea.ioh, NULL, &iosize)) {
161 aprint_error(": can't map i/o space\n"); 156 aprint_error(": can't map i/o space\n");
162 return; 157 return;
163 } 158 }
164 159
165 /* Enable the card */ 160 /* Enable the card */
166 csr = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); 161 csr = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
167 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, 162 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
168 csr | PCI_COMMAND_MASTER_ENABLE); 163 csr | PCI_COMMAND_MASTER_ENABLE);
169 164

cvs diff -r1.17 -r1.18 src/sys/dev/pci/iha_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/iha_pci.c 2010/11/13 13:52:07 1.17
+++ src/sys/dev/pci/iha_pci.c 2012/01/30 19:41:21 1.18
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: iha_pci.c,v 1.17 2010/11/13 13:52:07 uebayasi Exp $ */ 1/* $NetBSD: iha_pci.c,v 1.18 2012/01/30 19:41:21 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 Izumi Tsutsui. All rights reserved. 4 * Copyright (c) 2001 Izumi Tsutsui. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -52,27 +52,27 @@ @@ -52,27 +52,27 @@
52 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 52 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
53 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 53 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
54 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 54 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
55 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 55 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
56 * THE POSSIBILITY OF SUCH DAMAGE. 56 * THE POSSIBILITY OF SUCH DAMAGE.
57 */ 57 */
58 58
59/* 59/*
60 * Ported to NetBSD by Izumi Tsutsui <tsutsui@NetBSD.org> from OpenBSD: 60 * Ported to NetBSD by Izumi Tsutsui <tsutsui@NetBSD.org> from OpenBSD:
61 * $OpenBSD: iha_pci.c,v 1.2 2001/03/29 23:53:38 krw Exp $ 61 * $OpenBSD: iha_pci.c,v 1.2 2001/03/29 23:53:38 krw Exp $
62 */ 62 */
63 63
64#include <sys/cdefs.h> 64#include <sys/cdefs.h>
65__KERNEL_RCSID(0, "$NetBSD: iha_pci.c,v 1.17 2010/11/13 13:52:07 uebayasi Exp $"); 65__KERNEL_RCSID(0, "$NetBSD: iha_pci.c,v 1.18 2012/01/30 19:41:21 drochner Exp $");
66 66
67#include <sys/param.h> 67#include <sys/param.h>
68#include <sys/systm.h> 68#include <sys/systm.h>
69#include <sys/device.h> 69#include <sys/device.h>
70 70
71#include <dev/pci/pcidevs.h> 71#include <dev/pci/pcidevs.h>
72#include <dev/pci/pcivar.h> 72#include <dev/pci/pcivar.h>
73 73
74#include <dev/scsipi/scsipi_all.h> 74#include <dev/scsipi/scsipi_all.h>
75#include <dev/scsipi/scsi_all.h> 75#include <dev/scsipi/scsi_all.h>
76#include <dev/scsipi/scsiconf.h> 76#include <dev/scsipi/scsiconf.h>
77 77
78#include <dev/ic/ihavar.h> 78#include <dev/ic/ihavar.h>
@@ -101,33 +101,30 @@ iha_pci_match(device_t parent, cfdata_t  @@ -101,33 +101,30 @@ iha_pci_match(device_t parent, cfdata_t
101} 101}
102 102
103static void 103static void
104iha_pci_attach(device_t parent, device_t self, void *aux) 104iha_pci_attach(device_t parent, device_t self, void *aux)
105{ 105{
106 struct iha_softc *sc = device_private(self); 106 struct iha_softc *sc = device_private(self);
107 struct pci_attach_args *pa = aux; 107 struct pci_attach_args *pa = aux;
108 bus_space_tag_t iot; 108 bus_space_tag_t iot;
109 bus_space_handle_t ioh; 109 bus_space_handle_t ioh;
110 pci_intr_handle_t ih; 110 pci_intr_handle_t ih;
111 const char *intrstr; 111 const char *intrstr;
112 pcireg_t command; 112 pcireg_t command;
113 int ioh_valid; 113 int ioh_valid;
114 char devinfo[256]; 
115 114
116 sc->sc_dev = self; 115 sc->sc_dev = self;
117 116
118 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 117 pci_aprint_devinfo(pa, NULL);
119 aprint_normal(": %s (rev. 0x%02x)\n", 
120 devinfo, PCI_REVISION(pa->pa_class)); 
121 118
122 command = pci_conf_read(pa->pa_pc,pa->pa_tag,PCI_COMMAND_STATUS_REG); 119 command = pci_conf_read(pa->pa_pc,pa->pa_tag,PCI_COMMAND_STATUS_REG);
123 command |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_PARITY_ENABLE; 120 command |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_PARITY_ENABLE;
124 121
125 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, command); 122 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, command);
126 123
127 /* 124 /*
128 * XXX - Tried memory mapping (using code from adw and ahc) 125 * XXX - Tried memory mapping (using code from adw and ahc)
129 * rather that IO mapping, but it didn't work at all.. 126 * rather that IO mapping, but it didn't work at all..
130 */ 127 */
131 ioh_valid = pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_IO, 0, 128 ioh_valid = pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_IO, 0,
132 &iot, &ioh, NULL, NULL); 129 &iot, &ioh, NULL, NULL);
133 130

cvs diff -r1.25 -r1.26 src/sys/dev/pci/ichsmb.c (expand / switch to unified diff)

--- src/sys/dev/pci/ichsmb.c 2011/05/15 01:00:52 1.25
+++ src/sys/dev/pci/ichsmb.c 2012/01/30 19:41:19 1.26
@@ -1,38 +1,38 @@ @@ -1,38 +1,38 @@
1/* $NetBSD: ichsmb.c,v 1.25 2011/05/15 01:00:52 msaitoh Exp $ */ 1/* $NetBSD: ichsmb.c,v 1.26 2012/01/30 19:41:19 drochner Exp $ */
2/* $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */ 2/* $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org> 5 * Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org>
6 * 6 *
7 * Permission to use, copy, modify, and distribute this software for any 7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above 8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies. 9 * copyright notice and this permission notice appear in all copies.
10 * 10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */ 18 */
19 19
20/* 20/*
21 * Intel ICH SMBus controller driver. 21 * Intel ICH SMBus controller driver.
22 */ 22 */
23 23
24#include <sys/cdefs.h> 24#include <sys/cdefs.h>
25__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.25 2011/05/15 01:00:52 msaitoh Exp $"); 25__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.26 2012/01/30 19:41:19 drochner Exp $");
26 26
27#include <sys/param.h> 27#include <sys/param.h>
28#include <sys/device.h> 28#include <sys/device.h>
29#include <sys/errno.h> 29#include <sys/errno.h>
30#include <sys/kernel.h> 30#include <sys/kernel.h>
31#include <sys/rwlock.h> 31#include <sys/rwlock.h>
32#include <sys/proc.h> 32#include <sys/proc.h>
33 33
34#include <sys/bus.h> 34#include <sys/bus.h>
35 35
36#include <dev/pci/pcidevs.h> 36#include <dev/pci/pcidevs.h>
37#include <dev/pci/pcireg.h> 37#include <dev/pci/pcireg.h>
38#include <dev/pci/pcivar.h> 38#include <dev/pci/pcivar.h>
@@ -114,34 +114,30 @@ ichsmb_match(device_t parent, cfdata_t m @@ -114,34 +114,30 @@ ichsmb_match(device_t parent, cfdata_t m
114 return 0; 114 return 0;
115} 115}
116 116
117static void 117static void
118ichsmb_attach(device_t parent, device_t self, void *aux) 118ichsmb_attach(device_t parent, device_t self, void *aux)
119{ 119{
120 struct ichsmb_softc *sc = device_private(self); 120 struct ichsmb_softc *sc = device_private(self);
121 struct pci_attach_args *pa = aux; 121 struct pci_attach_args *pa = aux;
122 struct i2cbus_attach_args iba; 122 struct i2cbus_attach_args iba;
123 pcireg_t conf; 123 pcireg_t conf;
124 bus_size_t iosize; 124 bus_size_t iosize;
125 pci_intr_handle_t ih; 125 pci_intr_handle_t ih;
126 const char *intrstr = NULL; 126 const char *intrstr = NULL;
127 char devinfo[256]; 
128 127
129 sc->sc_dev = self; 128 sc->sc_dev = self;
130 129
131 aprint_naive("\n"); 130 pci_aprint_devinfo(pa, NULL);
132 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
133 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
134 PCI_REVISION(pa->pa_class)); 
135 131
136 /* Read configuration */ 132 /* Read configuration */
137 conf = pci_conf_read(pa->pa_pc, pa->pa_tag, LPCIB_SMB_HOSTC); 133 conf = pci_conf_read(pa->pa_pc, pa->pa_tag, LPCIB_SMB_HOSTC);
138 DPRINTF(("%s: conf 0x%08x\n", device_xname(sc->sc_dev), conf)); 134 DPRINTF(("%s: conf 0x%08x\n", device_xname(sc->sc_dev), conf));
139 135
140 if ((conf & LPCIB_SMB_HOSTC_HSTEN) == 0) { 136 if ((conf & LPCIB_SMB_HOSTC_HSTEN) == 0) {
141 aprint_error_dev(self, "SMBus disabled\n"); 137 aprint_error_dev(self, "SMBus disabled\n");
142 return; 138 return;
143 } 139 }
144 140
145 /* Map I/O space */ 141 /* Map I/O space */
146 if (pci_mapreg_map(pa, LPCIB_SMB_BASE, PCI_MAPREG_TYPE_IO, 0, 142 if (pci_mapreg_map(pa, LPCIB_SMB_BASE, PCI_MAPREG_TYPE_IO, 0,
147 &sc->sc_iot, &sc->sc_ioh, NULL, &iosize)) { 143 &sc->sc_iot, &sc->sc_ioh, NULL, &iosize)) {

cvs diff -r1.14 -r1.15 src/sys/dev/pci/if_cas.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_cas.c 2011/08/29 14:47:08 1.14
+++ src/sys/dev/pci/if_cas.c 2012/01/30 19:41:19 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_cas.c,v 1.14 2011/08/29 14:47:08 jmcneill Exp $ */ 1/* $NetBSD: if_cas.c,v 1.15 2012/01/30 19:41:19 drochner Exp $ */
2/* $OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $ */ 2/* $OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $ */
3 3
4/* 4/*
5 * 5 *
6 * Copyright (C) 2007 Mark Kettenis. 6 * Copyright (C) 2007 Mark Kettenis.
7 * Copyright (C) 2001 Eduardo Horvath. 7 * Copyright (C) 2001 Eduardo Horvath.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -34,27 +34,27 @@ @@ -34,27 +34,27 @@
34/* 34/*
35 * Driver for Sun Cassini ethernet controllers. 35 * Driver for Sun Cassini ethernet controllers.
36 * 36 *
37 * There are basically two variants of this chip: Cassini and 37 * There are basically two variants of this chip: Cassini and
38 * Cassini+. We can distinguish between the two by revision: 0x10 and 38 * Cassini+. We can distinguish between the two by revision: 0x10 and
39 * up are Cassini+. The most important difference is that Cassini+ 39 * up are Cassini+. The most important difference is that Cassini+
40 * has a second RX descriptor ring. Cassini+ will not work without 40 * has a second RX descriptor ring. Cassini+ will not work without
41 * configuring that second ring. However, since we don't use it we 41 * configuring that second ring. However, since we don't use it we
42 * don't actually fill the descriptors, and only hand off the first 42 * don't actually fill the descriptors, and only hand off the first
43 * four to the chip. 43 * four to the chip.
44 */ 44 */
45 45
46#include <sys/cdefs.h> 46#include <sys/cdefs.h>
47__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.14 2011/08/29 14:47:08 jmcneill Exp $"); 47__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.15 2012/01/30 19:41:19 drochner Exp $");
48 48
49#ifndef _MODULE 49#ifndef _MODULE
50#include "opt_inet.h" 50#include "opt_inet.h"
51#endif 51#endif
52 52
53#include <sys/param.h> 53#include <sys/param.h>
54#include <sys/systm.h> 54#include <sys/systm.h>
55#include <sys/callout.h> 55#include <sys/callout.h>
56#include <sys/mbuf.h> 56#include <sys/mbuf.h>
57#include <sys/syslog.h> 57#include <sys/syslog.h>
58#include <sys/malloc.h> 58#include <sys/malloc.h>
59#include <sys/kernel.h> 59#include <sys/kernel.h>
60#include <sys/socket.h> 60#include <sys/socket.h>
@@ -311,34 +311,32 @@ next: @@ -311,34 +311,32 @@ next:
311 311
312 address = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_MAPREG_ROM); 312 address = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_MAPREG_ROM);
313 address &= ~PCI_MAPREG_ROM_ENABLE; 313 address &= ~PCI_MAPREG_ROM_ENABLE;
314 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_MAPREG_ROM, address); 314 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_MAPREG_ROM, address);
315 315
316 return (rv); 316 return (rv);
317} 317}
318 318
319void 319void
320cas_attach(device_t parent, device_t self, void *aux) 320cas_attach(device_t parent, device_t self, void *aux)
321{ 321{
322 struct pci_attach_args *pa = aux; 322 struct pci_attach_args *pa = aux;
323 struct cas_softc *sc = device_private(self); 323 struct cas_softc *sc = device_private(self);
324 char devinfo[256]; 
325 prop_data_t data; 324 prop_data_t data;
326 uint8_t enaddr[ETHER_ADDR_LEN]; 325 uint8_t enaddr[ETHER_ADDR_LEN];
327 326
328 sc->sc_dev = self; 327 sc->sc_dev = self;
329 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 328 pci_aprint_devinfo(pa, NULL);
330 sc->sc_rev = PCI_REVISION(pa->pa_class); 329 sc->sc_rev = PCI_REVISION(pa->pa_class);
331 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, sc->sc_rev); 
332 sc->sc_dmatag = pa->pa_dmat; 330 sc->sc_dmatag = pa->pa_dmat;
333 331
334#define PCI_CAS_BASEADDR 0x10 332#define PCI_CAS_BASEADDR 0x10
335 if (pci_mapreg_map(pa, PCI_CAS_BASEADDR, PCI_MAPREG_TYPE_MEM, 0, 333 if (pci_mapreg_map(pa, PCI_CAS_BASEADDR, PCI_MAPREG_TYPE_MEM, 0,
336 &sc->sc_memt, &sc->sc_memh, NULL, &sc->sc_size) != 0) { 334 &sc->sc_memt, &sc->sc_memh, NULL, &sc->sc_size) != 0) {
337 aprint_error_dev(sc->sc_dev, 335 aprint_error_dev(sc->sc_dev,
338 "unable to map device registers\n"); 336 "unable to map device registers\n");
339 return; 337 return;
340 } 338 }
341 339
342 if ((data = prop_dictionary_get(device_properties(sc->sc_dev), 340 if ((data = prop_dictionary_get(device_properties(sc->sc_dev),
343 "mac-address")) != NULL) 341 "mac-address")) != NULL)
344 memcpy(enaddr, prop_data_data_nocopy(data), ETHER_ADDR_LEN); 342 memcpy(enaddr, prop_data_data_nocopy(data), ETHER_ADDR_LEN);

cvs diff -r1.2 -r1.3 src/sys/dev/pci/if_et.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_et.c 2011/05/18 01:02:43 1.2
+++ src/sys/dev/pci/if_et.c 2012/01/30 19:41:20 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_et.c,v 1.2 2011/05/18 01:02:43 dyoung Exp $ */ 1/* $NetBSD: if_et.c,v 1.3 2012/01/30 19:41:20 drochner Exp $ */
2/* $OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $ */ 2/* $OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $ */
3/* 3/*
4 * Copyright (c) 2007 The DragonFly Project. All rights reserved. 4 * Copyright (c) 2007 The DragonFly Project. All rights reserved.
5 *  5 *
6 * This code is derived from software contributed to The DragonFly Project 6 * This code is derived from software contributed to The DragonFly Project
7 * by Sepherosa Ziehau <sepherosa@gmail.com> 7 * by Sepherosa Ziehau <sepherosa@gmail.com>
8 *  8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 *  12 *
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 28 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
31 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 31 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 *  35 *
36 * $DragonFly: src/sys/dev/netif/et/if_et.c,v 1.1 2007/10/12 14:12:42 sephe Exp $ 36 * $DragonFly: src/sys/dev/netif/et/if_et.c,v 1.1 2007/10/12 14:12:42 sephe Exp $
37 */ 37 */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.2 2011/05/18 01:02:43 dyoung Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.3 2012/01/30 19:41:20 drochner Exp $");
41 41
42#include "opt_inet.h" 42#include "opt_inet.h"
43#include "vlan.h" 43#include "vlan.h"
44 44
45#include <sys/param.h> 45#include <sys/param.h>
46#include <sys/endian.h> 46#include <sys/endian.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/types.h> 48#include <sys/types.h>
49#include <sys/sockio.h> 49#include <sys/sockio.h>
50#include <sys/mbuf.h> 50#include <sys/mbuf.h>
51#include <sys/queue.h> 51#include <sys/queue.h>
52#include <sys/kernel.h> 52#include <sys/kernel.h>
53#include <sys/device.h> 53#include <sys/device.h>
@@ -195,33 +195,30 @@ et_match(device_t dev, cfdata_t match, v @@ -195,33 +195,30 @@ et_match(device_t dev, cfdata_t match, v
195} 195}
196 196
197void 197void
198et_attach(device_t parent, device_t self, void *aux) 198et_attach(device_t parent, device_t self, void *aux)
199{ 199{
200 struct et_softc *sc = device_private(self); 200 struct et_softc *sc = device_private(self);
201 struct pci_attach_args *pa = aux; 201 struct pci_attach_args *pa = aux;
202 pci_chipset_tag_t pc = pa->pa_pc; 202 pci_chipset_tag_t pc = pa->pa_pc;
203 pci_intr_handle_t ih; 203 pci_intr_handle_t ih;
204 const char *intrstr; 204 const char *intrstr;
205 struct ifnet *ifp = &sc->sc_ethercom.ec_if; 205 struct ifnet *ifp = &sc->sc_ethercom.ec_if;
206 pcireg_t memtype; 206 pcireg_t memtype;
207 int error; 207 int error;
208 char devinfo[256]; 
209 208
210 aprint_naive(": Ethernet controller\n"); 209 pci_aprint_devinfo(pa, "Ethernet controller");
211 210
212 sc->sc_dev = self; 211 sc->sc_dev = self;
213 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
214 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class)); 
215 212
216 /* 213 /*
217 * Initialize tunables 214 * Initialize tunables
218 */ 215 */
219 sc->sc_rx_intr_npkts = et_rx_intr_npkts; 216 sc->sc_rx_intr_npkts = et_rx_intr_npkts;
220 sc->sc_rx_intr_delay = et_rx_intr_delay; 217 sc->sc_rx_intr_delay = et_rx_intr_delay;
221 sc->sc_tx_intr_nsegs = et_tx_intr_nsegs; 218 sc->sc_tx_intr_nsegs = et_tx_intr_nsegs;
222 sc->sc_timer = et_timer; 219 sc->sc_timer = et_timer;
223 220
224 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, ET_PCIR_BAR); 221 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, ET_PCIR_BAR);
225 if (pci_mapreg_map(pa, ET_PCIR_BAR, memtype, 0, &sc->sc_mem_bt, 222 if (pci_mapreg_map(pa, ET_PCIR_BAR, memtype, 0, &sc->sc_mem_bt,
226 &sc->sc_mem_bh, NULL, &sc->sc_mem_size)) { 223 &sc->sc_mem_bh, NULL, &sc->sc_mem_size)) {
227 aprint_error_dev(self, "could not map mem space\n"); 224 aprint_error_dev(self, "could not map mem space\n");

cvs diff -r1.77 -r1.78 src/sys/dev/pci/if_fxp_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_fxp_pci.c 2011/09/05 04:36:50 1.77
+++ src/sys/dev/pci/if_fxp_pci.c 2012/01/30 19:41:20 1.78
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_fxp_pci.c,v 1.77 2011/09/05 04:36:50 msaitoh Exp $ */ 1/* $NetBSD: if_fxp_pci.c,v 1.78 2012/01/30 19:41:20 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997, 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997, 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33/* 33/*
34 * PCI bus front-end for the Intel i82557 fast Ethernet controller 34 * PCI bus front-end for the Intel i82557 fast Ethernet controller
35 * driver. Works with Intel Etherexpress Pro 10+, 100B, 100+ cards. 35 * driver. Works with Intel Etherexpress Pro 10+, 100B, 100+ cards.
36 */ 36 */
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: if_fxp_pci.c,v 1.77 2011/09/05 04:36:50 msaitoh Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: if_fxp_pci.c,v 1.78 2012/01/30 19:41:20 drochner Exp $");
40 40
41#include "rnd.h" 41#include "rnd.h"
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45#include <sys/mbuf.h> 45#include <sys/mbuf.h>
46#include <sys/malloc.h> 46#include <sys/malloc.h>
47#include <sys/kernel.h> 47#include <sys/kernel.h>
48#include <sys/socket.h> 48#include <sys/socket.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/errno.h> 50#include <sys/errno.h>
51#include <sys/device.h> 51#include <sys/device.h>
52 52
@@ -304,28 +304,26 @@ fxp_pci_attach(device_t parent, device_t @@ -304,28 +304,26 @@ fxp_pci_attach(device_t parent, device_t
304 pci_intr_handle_t ih; 304 pci_intr_handle_t ih;
305 const struct fxp_pci_product *fpp; 305 const struct fxp_pci_product *fpp;
306 const char *chipname = NULL; 306 const char *chipname = NULL;
307 const char *intrstr = NULL; 307 const char *intrstr = NULL;
308 bus_space_tag_t iot, memt; 308 bus_space_tag_t iot, memt;
309 bus_space_handle_t ioh, memh; 309 bus_space_handle_t ioh, memh;
310 int ioh_valid, memh_valid; 310 int ioh_valid, memh_valid;
311 bus_addr_t addr; 311 bus_addr_t addr;
312 int flags; 312 int flags;
313 int error; 313 int error;
314 314
315 sc->sc_dev = self; 315 sc->sc_dev = self;
316 316
317 aprint_naive(": Ethernet controller\n"); 
318 
319 /* 317 /*
320 * Map control/status registers. 318 * Map control/status registers.
321 */ 319 */
322 ioh_valid = (pci_mapreg_map(pa, FXP_PCI_IOBA, 320 ioh_valid = (pci_mapreg_map(pa, FXP_PCI_IOBA,
323 PCI_MAPREG_TYPE_IO, 0, 321 PCI_MAPREG_TYPE_IO, 0,
324 &iot, &ioh, NULL, NULL) == 0); 322 &iot, &ioh, NULL, NULL) == 0);
325 323
326 /* 324 /*
327 * Version 2.1 of the PCI spec, page 196, "Address Maps": 325 * Version 2.1 of the PCI spec, page 196, "Address Maps":
328 * 326 *
329 * Prefetchable 327 * Prefetchable
330 * 328 *
331 * Set to one if there are no side effects on reads, the 329 * Set to one if there are no side effects on reads, the
@@ -401,77 +399,75 @@ fxp_pci_attach(device_t parent, device_t @@ -401,77 +399,75 @@ fxp_pci_attach(device_t parent, device_t
401 sc->sc_flags &= ~FXPF_82559_RXCSUM; 399 sc->sc_flags &= ~FXPF_82559_RXCSUM;
402 sc->sc_flags |= FXPF_EXT_RFA; 400 sc->sc_flags |= FXPF_EXT_RFA;
403 } 401 }
404 if (sc->sc_rev >= FXP_REV_82551_E) 402 if (sc->sc_rev >= FXP_REV_82551_E)
405 chipname = "i82551 Ethernet"; 403 chipname = "i82551 Ethernet";
406 404
407 /* 405 /*
408 * Mark all i82559 and i82550 revisions as having 406 * Mark all i82559 and i82550 revisions as having
409 * the "resume bug". See i82557.c for details. 407 * the "resume bug". See i82557.c for details.
410 */ 408 */
411 if (sc->sc_rev >= FXP_REV_82559_A0) 409 if (sc->sc_rev >= FXP_REV_82559_A0)
412 sc->sc_flags |= FXPF_HAS_RESUME_BUG; 410 sc->sc_flags |= FXPF_HAS_RESUME_BUG;
413 411
414 aprint_normal(": %s, rev %d\n", chipname != NULL ? chipname : 
415 fpp->fpp_name, sc->sc_rev); 
416 break; 412 break;
417 413
418 case PCI_PRODUCT_INTEL_82559ER: 414 case PCI_PRODUCT_INTEL_82559ER:
419 sc->sc_flags |= FXPF_FC|FXPF_EXT_TXCB; 415 sc->sc_flags |= FXPF_FC|FXPF_EXT_TXCB;
420 416
421 /* 417 /*
422 * i82559ER/82551ER don't support RX hardware checksumming 418 * i82559ER/82551ER don't support RX hardware checksumming
423 * even though it has a newer revision number than 82559_A0. 419 * even though it has a newer revision number than 82559_A0.
424 */ 420 */
425 421
426 /* All i82559 have the "resume bug". */ 422 /* All i82559 have the "resume bug". */
427 sc->sc_flags |= FXPF_HAS_RESUME_BUG; 423 sc->sc_flags |= FXPF_HAS_RESUME_BUG;
428 424
429 /* Enable the MWI command for memory writes. */ 425 /* Enable the MWI command for memory writes. */
430 if (pa->pa_flags & PCI_FLAGS_MWI_OKAY) 426 if (pa->pa_flags & PCI_FLAGS_MWI_OKAY)
431 sc->sc_flags |= FXPF_MWI; 427 sc->sc_flags |= FXPF_MWI;
432 428
433 if (sc->sc_rev >= FXP_REV_82551_E) 429 if (sc->sc_rev >= FXP_REV_82551_E)
434 chipname = "Intel i82551ER Ethernet"; 430 chipname = "Intel i82551ER Ethernet";
435 431
436 aprint_normal(": %s, rev %d\n", chipname != NULL ? chipname : 
437 fpp->fpp_name, sc->sc_rev); 
438 break; 432 break;
439 433
440 case PCI_PRODUCT_INTEL_82801BA_LAN: 434 case PCI_PRODUCT_INTEL_82801BA_LAN:
441 case PCI_PRODUCT_INTEL_PRO_100_VE_0: 435 case PCI_PRODUCT_INTEL_PRO_100_VE_0:
442 case PCI_PRODUCT_INTEL_PRO_100_VE_1: 436 case PCI_PRODUCT_INTEL_PRO_100_VE_1:
443 case PCI_PRODUCT_INTEL_PRO_100_VM_0: 437 case PCI_PRODUCT_INTEL_PRO_100_VM_0:
444 case PCI_PRODUCT_INTEL_PRO_100_VM_1: 438 case PCI_PRODUCT_INTEL_PRO_100_VM_1:
445 case PCI_PRODUCT_INTEL_82562EH_HPNA_0: 439 case PCI_PRODUCT_INTEL_82562EH_HPNA_0:
446 case PCI_PRODUCT_INTEL_82562EH_HPNA_1: 440 case PCI_PRODUCT_INTEL_82562EH_HPNA_1:
447 case PCI_PRODUCT_INTEL_82562EH_HPNA_2: 441 case PCI_PRODUCT_INTEL_82562EH_HPNA_2:
448 case PCI_PRODUCT_INTEL_PRO_100_VM_2: 442 case PCI_PRODUCT_INTEL_PRO_100_VM_2:
449 /* 443 /*
450 * The ICH-2 and ICH-3 have the "resume bug". 444 * The ICH-2 and ICH-3 have the "resume bug".
451 */ 445 */
452 sc->sc_flags |= FXPF_HAS_RESUME_BUG; 446 sc->sc_flags |= FXPF_HAS_RESUME_BUG;
453 /* FALLTHROUGH */ 447 /* FALLTHROUGH */
454 448
455 default: 449 default:
456 aprint_normal(": %s, rev %d\n", fpp->fpp_name, sc->sc_rev); 
457 if (sc->sc_rev >= FXP_REV_82558_A4) 450 if (sc->sc_rev >= FXP_REV_82558_A4)
458 sc->sc_flags |= FXPF_FC|FXPF_EXT_TXCB; 451 sc->sc_flags |= FXPF_FC|FXPF_EXT_TXCB;
459 if (sc->sc_rev >= FXP_REV_82559_A0) 452 if (sc->sc_rev >= FXP_REV_82559_A0)
460 sc->sc_flags |= FXPF_82559_RXCSUM; 453 sc->sc_flags |= FXPF_82559_RXCSUM;
461 454
462 break; 455 break;
463 } 456 }
464 457
 458 pci_aprint_devinfo_fancy(pa, "Ethernet controller",
 459 (chipname ? chipname : fpp->fpp_name), 1);
 460
465 /* Make sure bus-mastering is enabled. */ 461 /* Make sure bus-mastering is enabled. */
466 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, 462 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
467 pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG) | 463 pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG) |
468 PCI_COMMAND_MASTER_ENABLE); 464 PCI_COMMAND_MASTER_ENABLE);
469 465
470 /* 466 /*
471 * Under some circumstances (such as APM suspend/resume 467 * Under some circumstances (such as APM suspend/resume
472 * cycles, and across ACPI power state changes), the 468 * cycles, and across ACPI power state changes), the
473 * i82257-family can lose the contents of critical PCI 469 * i82257-family can lose the contents of critical PCI
474 * configuration registers, causing the card to be 470 * configuration registers, causing the card to be
475 * non-responsive and useless. This occurs on the Sony VAIO 471 * non-responsive and useless. This occurs on the Sony VAIO
476 * Z505-series, among others. Preserve them here so they can 472 * Z505-series, among others. Preserve them here so they can
477 * be later restored (by fxp_pci_confreg_restore()). 473 * be later restored (by fxp_pci_confreg_restore()).

cvs diff -r1.43 -r1.44 src/sys/dev/pci/if_gem_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_gem_pci.c 2010/11/13 13:52:06 1.43
+++ src/sys/dev/pci/if_gem_pci.c 2012/01/30 19:41:20 1.44
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_gem_pci.c,v 1.43 2010/11/13 13:52:06 uebayasi Exp $ */ 1/* $NetBSD: if_gem_pci.c,v 1.44 2012/01/30 19:41:20 drochner Exp $ */
2 2
3/* 3/*
4 * 4 *
5 * Copyright (C) 2001 Eduardo Horvath. 5 * Copyright (C) 2001 Eduardo Horvath.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE. 28 * SUCH DAMAGE.
29 * 29 *
30 */ 30 */
31 31
32/* 32/*
33 * PCI bindings for Apple GMAC, Sun ERI and Sun GEM Ethernet controllers 33 * PCI bindings for Apple GMAC, Sun ERI and Sun GEM Ethernet controllers
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.43 2010/11/13 13:52:06 uebayasi Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.44 2012/01/30 19:41:20 drochner Exp $");
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/malloc.h> 41#include <sys/malloc.h>
42#include <sys/kernel.h> 42#include <sys/kernel.h>
43#include <sys/socket.h> 43#include <sys/socket.h>
44#include <sys/errno.h> 44#include <sys/errno.h>
45#include <sys/device.h> 45#include <sys/device.h>
46 46
47#include <machine/endian.h> 47#include <machine/endian.h>
48 48
49#include <net/if.h> 49#include <net/if.h>
50#include <net/if_dl.h> 50#include <net/if_dl.h>
@@ -138,55 +138,52 @@ isshared_pins(u_int8_t* buf) @@ -138,55 +138,52 @@ isshared_pins(u_int8_t* buf)
138static inline int 138static inline int
139isserdes(u_int8_t* buf) 139isserdes(u_int8_t* buf)
140{ 140{
141 return buf[0] == 's' && buf[1] == 'e' && buf[2] == 'r' && 141 return buf[0] == 's' && buf[1] == 'e' && buf[2] == 'r' &&
142 buf[3] == 'd' && buf[4] == 'e' && buf[5] == 's'; 142 buf[3] == 'd' && buf[4] == 'e' && buf[5] == 's';
143} 143}
144 144
145void 145void
146gem_pci_attach(device_t parent, device_t self, void *aux) 146gem_pci_attach(device_t parent, device_t self, void *aux)
147{ 147{
148 struct pci_attach_args *pa = aux; 148 struct pci_attach_args *pa = aux;
149 struct gem_pci_softc *gsc = device_private(self); 149 struct gem_pci_softc *gsc = device_private(self);
150 struct gem_softc *sc = &gsc->gsc_gem; 150 struct gem_softc *sc = &gsc->gsc_gem;
151 char devinfo[256]; 
152 prop_data_t data; 151 prop_data_t data;
153 uint8_t enaddr[ETHER_ADDR_LEN]; 152 uint8_t enaddr[ETHER_ADDR_LEN];
154 u_int8_t *enp; 153 u_int8_t *enp;
155 bus_space_handle_t romh; 154 bus_space_handle_t romh;
156 u_int8_t buf[0x0800]; 155 u_int8_t buf[0x0800];
157 int dataoff, vpdoff, serdes; 156 int dataoff, vpdoff, serdes;
158 int i, got_addr = 0; 157 int i, got_addr = 0;
159#ifdef GEM_DEBUG 158#ifdef GEM_DEBUG
160 int j; 159 int j;
161#endif 160#endif
162 struct pci_vpd *vpd; 161 struct pci_vpd *vpd;
163 static const u_int8_t promhdr[] = { 0x55, 0xaa }; 162 static const u_int8_t promhdr[] = { 0x55, 0xaa };
164#define PROMHDR_PTR_DATA 0x18 163#define PROMHDR_PTR_DATA 0x18
165 static const u_int8_t promdat[] = { 164 static const u_int8_t promdat[] = {
166 0x50, 0x43, 0x49, 0x52, /* "PCIR" */ 165 0x50, 0x43, 0x49, 0x52, /* "PCIR" */
167 PCI_VENDOR_SUN & 0xff, PCI_VENDOR_SUN >> 8, 166 PCI_VENDOR_SUN & 0xff, PCI_VENDOR_SUN >> 8,
168 PCI_PRODUCT_SUN_GEMNETWORK & 0xff, 167 PCI_PRODUCT_SUN_GEMNETWORK & 0xff,
169 PCI_PRODUCT_SUN_GEMNETWORK >> 8 168 PCI_PRODUCT_SUN_GEMNETWORK >> 8
170 }; 169 };
171#define PROMDATA_PTR_VPD 0x08 170#define PROMDATA_PTR_VPD 0x08
172#define PROMDATA_DATA2 0x0a 171#define PROMDATA_DATA2 0x0a
173 172
174 aprint_naive(": Ethernet controller\n"); 173 pci_aprint_devinfo(pa, "Ethernet controller");
175 174
176 sc->sc_dev = self; 175 sc->sc_dev = self;
177 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
178 sc->sc_chiprev = PCI_REVISION(pa->pa_class); 176 sc->sc_chiprev = PCI_REVISION(pa->pa_class);
179 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, sc->sc_chiprev); 
180 177
181 /* 178 /*
182 * Some Sun GEMs/ERIs do have their intpin register bogusly set to 0, 179 * Some Sun GEMs/ERIs do have their intpin register bogusly set to 0,
183 * although it should be 1. correct that. 180 * although it should be 1. correct that.
184 */ 181 */
185 if (pa->pa_intrpin == 0) 182 if (pa->pa_intrpin == 0)
186 pa->pa_intrpin = 1; 183 pa->pa_intrpin = 1;
187 184
188 sc->sc_variant = GEM_UNKNOWN; 185 sc->sc_variant = GEM_UNKNOWN;
189 186
190 sc->sc_dmatag = pa->pa_dmat; 187 sc->sc_dmatag = pa->pa_dmat;
191 188
192 sc->sc_flags |= GEM_PCI; 189 sc->sc_flags |= GEM_PCI;

cvs diff -r1.52 -r1.53 src/sys/dev/pci/if_ipw.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_ipw.c 2010/11/15 05:57:07 1.52
+++ src/sys/dev/pci/if_ipw.c 2012/01/30 19:41:20 1.53
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ipw.c,v 1.52 2010/11/15 05:57:07 uebayasi Exp $ */ 1/* $NetBSD: if_ipw.c,v 1.53 2012/01/30 19:41:20 drochner Exp $ */
2/* FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp */ 2/* FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp */
3 3
4/*- 4/*-
5 * Copyright (c) 2004, 2005 5 * Copyright (c) 2004, 2005
6 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved. 6 * Damien Bergamini <damien.bergamini@free.fr>. 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 unmodified, this list of conditions, and the following 12 * notice unmodified, this list of conditions, and the following
13 * disclaimer. 13 * disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE. 28 * SUCH DAMAGE.
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.52 2010/11/15 05:57:07 uebayasi Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.53 2012/01/30 19:41:20 drochner Exp $");
33 33
34/*- 34/*-
35 * Intel(R) PRO/Wireless 2100 MiniPCI driver 35 * Intel(R) PRO/Wireless 2100 MiniPCI driver
36 * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm 36 * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm
37 */ 37 */
38 38
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/sockio.h> 41#include <sys/sockio.h>
42#include <sys/sysctl.h> 42#include <sys/sysctl.h>
43#include <sys/mbuf.h> 43#include <sys/mbuf.h>
44#include <sys/kernel.h> 44#include <sys/kernel.h>
45#include <sys/socket.h> 45#include <sys/socket.h>
@@ -168,41 +168,38 @@ ipw_match(device_t parent, cfdata_t matc @@ -168,41 +168,38 @@ ipw_match(device_t parent, cfdata_t matc
168} 168}
169 169
170/* Base Address Register */ 170/* Base Address Register */
171#define IPW_PCI_BAR0 0x10 171#define IPW_PCI_BAR0 0x10
172 172
173static void 173static void
174ipw_attach(device_t parent, device_t self, void *aux) 174ipw_attach(device_t parent, device_t self, void *aux)
175{ 175{
176 struct ipw_softc *sc = device_private(self); 176 struct ipw_softc *sc = device_private(self);
177 struct ieee80211com *ic = &sc->sc_ic; 177 struct ieee80211com *ic = &sc->sc_ic;
178 struct ifnet *ifp = &sc->sc_if; 178 struct ifnet *ifp = &sc->sc_if;
179 struct pci_attach_args *pa = aux; 179 struct pci_attach_args *pa = aux;
180 const char *intrstr; 180 const char *intrstr;
181 char devinfo[256]; 
182 bus_space_tag_t memt; 181 bus_space_tag_t memt;
183 bus_space_handle_t memh; 182 bus_space_handle_t memh;
184 bus_addr_t base; 183 bus_addr_t base;
185 pci_intr_handle_t ih; 184 pci_intr_handle_t ih;
186 uint32_t data; 185 uint32_t data;
187 uint16_t val; 186 uint16_t val;
188 int i, revision, error; 187 int i, error;
189 188
190 sc->sc_pct = pa->pa_pc; 189 sc->sc_pct = pa->pa_pc;
191 sc->sc_pcitag = pa->pa_tag; 190 sc->sc_pcitag = pa->pa_tag;
192 191
193 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof devinfo); 192 pci_aprint_devinfo(pa, NULL);
194 revision = PCI_REVISION(pa->pa_class); 
195 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision); 
196 193
197 /* enable bus-mastering */ 194 /* enable bus-mastering */
198 data = pci_conf_read(sc->sc_pct, pa->pa_tag, PCI_COMMAND_STATUS_REG); 195 data = pci_conf_read(sc->sc_pct, pa->pa_tag, PCI_COMMAND_STATUS_REG);
199 data |= PCI_COMMAND_MASTER_ENABLE; 196 data |= PCI_COMMAND_MASTER_ENABLE;
200 pci_conf_write(sc->sc_pct, pa->pa_tag, PCI_COMMAND_STATUS_REG, data); 197 pci_conf_write(sc->sc_pct, pa->pa_tag, PCI_COMMAND_STATUS_REG, data);
201 198
202 /* map the register window */ 199 /* map the register window */
203 error = pci_mapreg_map(pa, IPW_PCI_BAR0, PCI_MAPREG_TYPE_MEM | 200 error = pci_mapreg_map(pa, IPW_PCI_BAR0, PCI_MAPREG_TYPE_MEM |
204 PCI_MAPREG_MEM_TYPE_32BIT, 0, &memt, &memh, &base, &sc->sc_sz); 201 PCI_MAPREG_MEM_TYPE_32BIT, 0, &memt, &memh, &base, &sc->sc_sz);
205 if (error != 0) { 202 if (error != 0) {
206 aprint_error_dev(&sc->sc_dev, "could not map memory space\n"); 203 aprint_error_dev(&sc->sc_dev, "could not map memory space\n");
207 return; 204 return;
208 } 205 }

cvs diff -r1.52 -r1.53 src/sys/dev/pci/radeonfb.c (expand / switch to unified diff)

--- src/sys/dev/pci/radeonfb.c 2012/01/11 16:02:30 1.52
+++ src/sys/dev/pci/radeonfb.c 2012/01/30 19:41:23 1.53
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: radeonfb.c,v 1.52 2012/01/11 16:02:30 macallan Exp $ */ 1/* $NetBSD: radeonfb.c,v 1.53 2012/01/30 19:41:23 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Itronix Inc. 4 * Copyright (c) 2006 Itronix Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Garrett D'Amore for Itronix Inc. 7 * Written by Garrett D'Amore for Itronix Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -60,27 +60,27 @@ @@ -60,27 +60,27 @@
60 * portions of the Software. 60 * portions of the Software.
61 * 61 *
62 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 62 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
63 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 63 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
64 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 64 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
65 * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR 65 * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
66 * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 66 * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
67 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 67 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 68 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
69 * DEALINGS IN THE SOFTWARE. 69 * DEALINGS IN THE SOFTWARE.
70 */ 70 */
71 71
72#include <sys/cdefs.h> 72#include <sys/cdefs.h>
73__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.52 2012/01/11 16:02:30 macallan Exp $"); 73__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.53 2012/01/30 19:41:23 drochner Exp $");
74 74
75#include <sys/param.h> 75#include <sys/param.h>
76#include <sys/systm.h> 76#include <sys/systm.h>
77#include <sys/device.h> 77#include <sys/device.h>
78#include <sys/malloc.h> 78#include <sys/malloc.h>
79#include <sys/bus.h> 79#include <sys/bus.h>
80#include <sys/kernel.h> 80#include <sys/kernel.h>
81#include <sys/lwp.h> 81#include <sys/lwp.h>
82#include <sys/kauth.h> 82#include <sys/kauth.h>
83 83
84#include <dev/wscons/wsdisplayvar.h> 84#include <dev/wscons/wsdisplayvar.h>
85#include <dev/wscons/wsconsio.h> 85#include <dev/wscons/wsconsio.h>
86#include <dev/wsfont/wsfont.h> 86#include <dev/wsfont/wsfont.h>
@@ -440,31 +440,27 @@ radeonfb_attach(device_t parent, device_ @@ -440,31 +440,27 @@ radeonfb_attach(device_t parent, device_
440 const char *mptr; 440 const char *mptr;
441 bus_size_t bsz; 441 bus_size_t bsz;
442 pcireg_t screg; 442 pcireg_t screg;
443 int i, j, fg, bg, ul, flags; 443 int i, j, fg, bg, ul, flags;
444 uint32_t v; 444 uint32_t v;
445 445
446 sc->sc_dev = dev; 446 sc->sc_dev = dev;
447 sc->sc_id = pa->pa_id; 447 sc->sc_id = pa->pa_id;
448 for (i = 0; radeonfb_devices[i].devid; i++) { 448 for (i = 0; radeonfb_devices[i].devid; i++) {
449 if (PCI_PRODUCT(sc->sc_id) == radeonfb_devices[i].devid) 449 if (PCI_PRODUCT(sc->sc_id) == radeonfb_devices[i].devid)
450 break; 450 break;
451 } 451 }
452 452
453 pci_devinfo(sc->sc_id, pa->pa_class, 0, sc->sc_devinfo, 453 pci_aprint_devinfo(pa, NULL);
454 sizeof(sc->sc_devinfo)); 
455 
456 aprint_naive("\n"); 
457 aprint_normal(": %s\n", sc->sc_devinfo); 
458 454
459 DPRINTF((prop_dictionary_externalize(device_properties(dev)))); 455 DPRINTF((prop_dictionary_externalize(device_properties(dev))));
460 456
461 KASSERT(radeonfb_devices[i].devid != 0); 457 KASSERT(radeonfb_devices[i].devid != 0);
462 sc->sc_pt = pa->pa_tag; 458 sc->sc_pt = pa->pa_tag;
463 sc->sc_iot = pa->pa_iot; 459 sc->sc_iot = pa->pa_iot;
464 sc->sc_pc = pa->pa_pc; 460 sc->sc_pc = pa->pa_pc;
465 sc->sc_family = radeonfb_devices[i].family; 461 sc->sc_family = radeonfb_devices[i].family;
466 sc->sc_flags = radeonfb_devices[i].flags; 462 sc->sc_flags = radeonfb_devices[i].flags;
467 463
468 /* enable memory and IO access */ 464 /* enable memory and IO access */
469 screg = pci_conf_read(sc->sc_pc, sc->sc_pt, PCI_COMMAND_STATUS_REG); 465 screg = pci_conf_read(sc->sc_pc, sc->sc_pt, PCI_COMMAND_STATUS_REG);
470 screg |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE; 466 screg |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE;

cvs diff -r1.52 -r1.53 src/sys/dev/pci/yds.c (expand / switch to unified diff)

--- src/sys/dev/pci/yds.c 2011/11/24 03:35:59 1.52
+++ src/sys/dev/pci/yds.c 2012/01/30 19:41:23 1.53
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: yds.c,v 1.52 2011/11/24 03:35:59 mrg Exp $ */ 1/* $NetBSD: yds.c,v 1.53 2012/01/30 19:41:23 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto. 4 * Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29 * Yamaha YMF724[B-F]/740[B-C]/744/754 29 * Yamaha YMF724[B-F]/740[B-C]/744/754
30 * 30 *
31 * Documentation links: 31 * Documentation links:
32 * - ftp://ftp.alsa-project.org/pub/manuals/yamaha/ 32 * - ftp://ftp.alsa-project.org/pub/manuals/yamaha/
33 * - ftp://ftp.alsa-project.org/pub/manuals/yamaha/pci/ 33 * - ftp://ftp.alsa-project.org/pub/manuals/yamaha/pci/
34 * 34 *
35 * TODO: 35 * TODO:
36 * - FM synth volume (difficult: mixed before ac97) 36 * - FM synth volume (difficult: mixed before ac97)
37 * - Digital in/out (SPDIF) support 37 * - Digital in/out (SPDIF) support
38 * - Effect?? 38 * - Effect??
39 */ 39 */
40 40
41#include <sys/cdefs.h> 41#include <sys/cdefs.h>
42__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.52 2011/11/24 03:35:59 mrg Exp $"); 42__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.53 2012/01/30 19:41:23 drochner Exp $");
43 43
44#include "mpu.h" 44#include "mpu.h"
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/kernel.h> 48#include <sys/kernel.h>
49#include <sys/fcntl.h> 49#include <sys/fcntl.h>
50#include <sys/kmem.h> 50#include <sys/kmem.h>
51#include <sys/device.h> 51#include <sys/device.h>
52#include <sys/proc.h> 52#include <sys/proc.h>
53 53
54#include <dev/pci/pcidevs.h> 54#include <dev/pci/pcidevs.h>
55#include <dev/pci/pcireg.h> 55#include <dev/pci/pcireg.h>
@@ -730,38 +730,37 @@ yds_resume(device_t dv, const pmf_qual_t @@ -730,38 +730,37 @@ yds_resume(device_t dv, const pmf_qual_t
730 return true; 730 return true;
731} 731}
732 732
733static void 733static void
734yds_attach(device_t parent, device_t self, void *aux) 734yds_attach(device_t parent, device_t self, void *aux)
735{ 735{
736 struct yds_softc *sc; 736 struct yds_softc *sc;
737 struct pci_attach_args *pa; 737 struct pci_attach_args *pa;
738 pci_chipset_tag_t pc; 738 pci_chipset_tag_t pc;
739 char const *intrstr; 739 char const *intrstr;
740 pci_intr_handle_t ih; 740 pci_intr_handle_t ih;
741 pcireg_t reg; 741 pcireg_t reg;
742 struct yds_codec_softc *codec; 742 struct yds_codec_softc *codec;
743 char devinfo[256]; 
744 int i, r, to; 743 int i, r, to;
745 int revision; 744 int revision;
746 int ac97_id2; 745 int ac97_id2;
747 746
748 sc = device_private(self); 747 sc = device_private(self);
749 sc->sc_dev = self; 748 sc->sc_dev = self;
750 pa = (struct pci_attach_args *)aux; 749 pa = (struct pci_attach_args *)aux;
751 pc = pa->pa_pc; 750 pc = pa->pa_pc;
752 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
753 revision = PCI_REVISION(pa->pa_class); 751 revision = PCI_REVISION(pa->pa_class);
754 printf(": %s (rev. 0x%02x)\n", devinfo, revision); 752
 753 pci_aprint_devinfo(pa, NULL);
755 754
756 /* Map register to memory */ 755 /* Map register to memory */
757 if (pci_mapreg_map(pa, YDS_PCI_MBA, PCI_MAPREG_TYPE_MEM, 0, 756 if (pci_mapreg_map(pa, YDS_PCI_MBA, PCI_MAPREG_TYPE_MEM, 0,
758 &sc->memt, &sc->memh, NULL, NULL)) { 757 &sc->memt, &sc->memh, NULL, NULL)) {
759 aprint_error_dev(self, "can't map memory space\n"); 758 aprint_error_dev(self, "can't map memory space\n");
760 return; 759 return;
761 } 760 }
762 761
763 /* Map and establish the interrupt. */ 762 /* Map and establish the interrupt. */
764 if (pci_intr_map(pa, &ih)) { 763 if (pci_intr_map(pa, &ih)) {
765 aprint_error_dev(self, "couldn't map interrupt\n"); 764 aprint_error_dev(self, "couldn't map interrupt\n");
766 return; 765 return;
767 } 766 }

cvs diff -r1.88 -r1.89 src/sys/dev/pci/if_iwi.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_iwi.c 2011/11/19 22:51:23 1.88
+++ src/sys/dev/pci/if_iwi.c 2012/01/30 19:41:20 1.89
@@ -1,35 +1,35 @@ @@ -1,35 +1,35 @@
1/* $NetBSD: if_iwi.c,v 1.88 2011/11/19 22:51:23 tls Exp $ */ 1/* $NetBSD: if_iwi.c,v 1.89 2012/01/30 19:41:20 drochner Exp $ */
2/* $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $ */ 2/* $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2004-2008 5 * Copyright (c) 2004-2008
6 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved. 6 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
7 * 7 *
8 * Permission to use, copy, modify, and distribute this software for any 8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above 9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies. 10 * copyright notice and this permission notice appear in all copies.
11 * 11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 */ 19 */
20 20
21#include <sys/cdefs.h> 21#include <sys/cdefs.h>
22__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.88 2011/11/19 22:51:23 tls Exp $"); 22__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.89 2012/01/30 19:41:20 drochner Exp $");
23 23
24/*- 24/*-
25 * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver 25 * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
26 * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm 26 * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm
27 */ 27 */
28 28
29 29
30#include <sys/param.h> 30#include <sys/param.h>
31#include <sys/sockio.h> 31#include <sys/sockio.h>
32#include <sys/sysctl.h> 32#include <sys/sysctl.h>
33#include <sys/mbuf.h> 33#include <sys/mbuf.h>
34#include <sys/kernel.h> 34#include <sys/kernel.h>
35#include <sys/socket.h> 35#include <sys/socket.h>
@@ -193,41 +193,38 @@ iwi_match(device_t parent, cfdata_t matc @@ -193,41 +193,38 @@ iwi_match(device_t parent, cfdata_t matc
193} 193}
194 194
195/* Base Address Register */ 195/* Base Address Register */
196#define IWI_PCI_BAR0 0x10 196#define IWI_PCI_BAR0 0x10
197 197
198static void 198static void
199iwi_attach(device_t parent, device_t self, void *aux) 199iwi_attach(device_t parent, device_t self, void *aux)
200{ 200{
201 struct iwi_softc *sc = device_private(self); 201 struct iwi_softc *sc = device_private(self);
202 struct ieee80211com *ic = &sc->sc_ic; 202 struct ieee80211com *ic = &sc->sc_ic;
203 struct ifnet *ifp = &sc->sc_if; 203 struct ifnet *ifp = &sc->sc_if;
204 struct pci_attach_args *pa = aux; 204 struct pci_attach_args *pa = aux;
205 const char *intrstr; 205 const char *intrstr;
206 char devinfo[256]; 
207 bus_space_tag_t memt; 206 bus_space_tag_t memt;
208 bus_space_handle_t memh; 207 bus_space_handle_t memh;
209 pci_intr_handle_t ih; 208 pci_intr_handle_t ih;
210 pcireg_t data; 209 pcireg_t data;
211 uint16_t val; 210 uint16_t val;
212 int error, revision, i; 211 int error, i;
213 212
214 sc->sc_dev = self; 213 sc->sc_dev = self;
215 sc->sc_pct = pa->pa_pc; 214 sc->sc_pct = pa->pa_pc;
216 sc->sc_pcitag = pa->pa_tag; 215 sc->sc_pcitag = pa->pa_tag;
217 216
218 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof devinfo); 217 pci_aprint_devinfo(pa, NULL);
219 revision = PCI_REVISION(pa->pa_class); 
220 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision); 
221 218
222 /* clear unit numbers allocated to IBSS */ 219 /* clear unit numbers allocated to IBSS */
223 sc->sc_unr = 0; 220 sc->sc_unr = 0;
224 221
225 /* power up chip */ 222 /* power up chip */
226 if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self, 223 if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
227 NULL)) && error != EOPNOTSUPP) { 224 NULL)) && error != EOPNOTSUPP) {
228 aprint_error_dev(self, "cannot activate %d\n", error); 225 aprint_error_dev(self, "cannot activate %d\n", error);
229 return; 226 return;
230 } 227 }
231 228
232 /* clear device specific PCI configuration register 0x41 */ 229 /* clear device specific PCI configuration register 0x41 */
233 data = pci_conf_read(sc->sc_pct, sc->sc_pcitag, 0x40); 230 data = pci_conf_read(sc->sc_pct, sc->sc_pcitag, 0x40);

cvs diff -r1.16 -r1.17 src/sys/dev/pci/if_mtd_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_mtd_pci.c 2011/07/26 20:51:24 1.16
+++ src/sys/dev/pci/if_mtd_pci.c 2012/01/30 19:41:20 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_mtd_pci.c,v 1.16 2011/07/26 20:51:24 dyoung Exp $ */ 1/* $NetBSD: if_mtd_pci.c,v 1.17 2012/01/30 19:41:20 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Peter Bex <Peter.Bex@student.kun.nl>. 8 * by Peter Bex <Peter.Bex@student.kun.nl>.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * PCI interface for MTD803 cards 33 * PCI interface for MTD803 cards
34 * Written by Peter Bex (peter.bex@student.kun.nl) 34 * Written by Peter Bex (peter.bex@student.kun.nl)
35 */ 35 */
36 36
37/* TODO: Check why in IO space, the MII won't work. Memory mapped works */ 37/* TODO: Check why in IO space, the MII won't work. Memory mapped works */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: if_mtd_pci.c,v 1.16 2011/07/26 20:51:24 dyoung Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: if_mtd_pci.c,v 1.17 2012/01/30 19:41:20 drochner Exp $");
41 41
42#include <sys/param.h> 42#include <sys/param.h>
43#include <sys/device.h> 43#include <sys/device.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45#include <sys/socket.h> 45#include <sys/socket.h>
46#include <net/if.h> 46#include <net/if.h>
47#include <net/if_ether.h> 47#include <net/if_ether.h>
48#include <net/if_media.h> 48#include <net/if_media.h>
49#include <sys/bus.h> 49#include <sys/bus.h>
50#include <dev/mii/miivar.h> 50#include <dev/mii/miivar.h>
51#include <dev/ic/mtd803reg.h> 51#include <dev/ic/mtd803reg.h>
52#include <dev/ic/mtd803var.h> 52#include <dev/ic/mtd803var.h>
53#include <dev/pci/pcidevs.h> 53#include <dev/pci/pcidevs.h>
@@ -87,30 +87,28 @@ mtd_pci_match(device_t parent, cfdata_t  @@ -87,30 +87,28 @@ mtd_pci_match(device_t parent, cfdata_t
87 return (0); 87 return (0);
88} 88}
89 89
90static void 90static void
91mtd_pci_attach(device_t parent, device_t self, void *aux) 91mtd_pci_attach(device_t parent, device_t self, void *aux)
92{ 92{
93 struct pci_attach_args * const pa = aux; 93 struct pci_attach_args * const pa = aux;
94 struct mtd_softc * const sc = device_private(self); 94 struct mtd_softc * const sc = device_private(self);
95 pci_intr_handle_t ih; 95 pci_intr_handle_t ih;
96 const char *intrstring = NULL; 96 const char *intrstring = NULL;
97 bus_space_tag_t iot, memt; 97 bus_space_tag_t iot, memt;
98 bus_space_handle_t ioh, memh; 98 bus_space_handle_t ioh, memh;
99 int io_valid, mem_valid; 99 int io_valid, mem_valid;
100 char devinfo[256]; 
101 100
102 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 101 pci_aprint_devinfo(pa, NULL);
103 printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class)); 
104 102
105 io_valid = (pci_mapreg_map(pa, PCI_IO_MAP_REG, PCI_MAPREG_TYPE_IO, 103 io_valid = (pci_mapreg_map(pa, PCI_IO_MAP_REG, PCI_MAPREG_TYPE_IO,
106 0, &iot, &ioh, NULL, NULL) == 0); 104 0, &iot, &ioh, NULL, NULL) == 0);
107 mem_valid = (pci_mapreg_map(pa, PCI_MEM_MAP_REG, PCI_MAPREG_TYPE_MEM 105 mem_valid = (pci_mapreg_map(pa, PCI_MEM_MAP_REG, PCI_MAPREG_TYPE_MEM
108 | PCI_MAPREG_MEM_TYPE_32BIT, 0, &memt, &memh, 106 | PCI_MAPREG_MEM_TYPE_32BIT, 0, &memt, &memh,
109 NULL, NULL) == 0); 107 NULL, NULL) == 0);
110 108
111 if (mem_valid) { 109 if (mem_valid) {
112 sc->bus_tag = memt; 110 sc->bus_tag = memt;
113 sc->bus_handle = memh; 111 sc->bus_handle = memh;
114 } else if (io_valid) { 112 } else if (io_valid) {
115 sc->bus_tag = iot; 113 sc->bus_tag = iot;
116 sc->bus_handle = ioh; 114 sc->bus_handle = ioh;

cvs diff -r1.54 -r1.55 src/sys/dev/pci/if_nfe.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_nfe.c 2011/01/23 03:15:06 1.54
+++ src/sys/dev/pci/if_nfe.c 2012/01/30 19:41:20 1.55
@@ -1,37 +1,37 @@ @@ -1,37 +1,37 @@
1/* $NetBSD: if_nfe.c,v 1.54 2011/01/23 03:15:06 tsutsui Exp $ */ 1/* $NetBSD: if_nfe.c,v 1.55 2012/01/30 19:41:20 drochner Exp $ */
2/* $OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $ */ 2/* $OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr> 5 * Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr>
6 * Copyright (c) 2005, 2006 Jonathan Gray <jsg@openbsd.org> 6 * Copyright (c) 2005, 2006 Jonathan Gray <jsg@openbsd.org>
7 * 7 *
8 * Permission to use, copy, modify, and distribute this software for any 8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above 9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies. 10 * copyright notice and this permission notice appear in all copies.
11 * 11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 */ 19 */
20 20
21/* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ 21/* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
22 22
23#include <sys/cdefs.h> 23#include <sys/cdefs.h>
24__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.54 2011/01/23 03:15:06 tsutsui Exp $"); 24__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.55 2012/01/30 19:41:20 drochner Exp $");
25 25
26#include "opt_inet.h" 26#include "opt_inet.h"
27#include "vlan.h" 27#include "vlan.h"
28 28
29#include <sys/param.h> 29#include <sys/param.h>
30#include <sys/endian.h> 30#include <sys/endian.h>
31#include <sys/systm.h> 31#include <sys/systm.h>
32#include <sys/types.h> 32#include <sys/types.h>
33#include <sys/sockio.h> 33#include <sys/sockio.h>
34#include <sys/mbuf.h> 34#include <sys/mbuf.h>
35#include <sys/mutex.h> 35#include <sys/mutex.h>
36#include <sys/queue.h> 36#include <sys/queue.h>
37#include <sys/kernel.h> 37#include <sys/kernel.h>
@@ -210,33 +210,31 @@ nfe_match(device_t dev, cfdata_t match,  @@ -210,33 +210,31 @@ nfe_match(device_t dev, cfdata_t match,
210 return 0; 210 return 0;
211} 211}
212 212
213void 213void
214nfe_attach(device_t parent, device_t self, void *aux) 214nfe_attach(device_t parent, device_t self, void *aux)
215{ 215{
216 struct nfe_softc *sc = device_private(self); 216 struct nfe_softc *sc = device_private(self);
217 struct pci_attach_args *pa = aux; 217 struct pci_attach_args *pa = aux;
218 pci_chipset_tag_t pc = pa->pa_pc; 218 pci_chipset_tag_t pc = pa->pa_pc;
219 pci_intr_handle_t ih; 219 pci_intr_handle_t ih;
220 const char *intrstr; 220 const char *intrstr;
221 struct ifnet *ifp; 221 struct ifnet *ifp;
222 pcireg_t memtype, csr; 222 pcireg_t memtype, csr;
223 char devinfo[256]; 
224 int mii_flags = 0; 223 int mii_flags = 0;
225 224
226 sc->sc_dev = self; 225 sc->sc_dev = self;
227 sc->sc_pc = pa->pa_pc; 226 sc->sc_pc = pa->pa_pc;
228 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 227 pci_aprint_devinfo(pa, NULL);
229 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class)); 
230 228
231 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, NFE_PCI_BA); 229 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, NFE_PCI_BA);
232 switch (memtype) { 230 switch (memtype) {
233 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT: 231 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
234 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT: 232 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
235 if (pci_mapreg_map(pa, NFE_PCI_BA, memtype, 0, &sc->sc_memt, 233 if (pci_mapreg_map(pa, NFE_PCI_BA, memtype, 0, &sc->sc_memt,
236 &sc->sc_memh, NULL, &sc->sc_mems) == 0) 234 &sc->sc_memh, NULL, &sc->sc_mems) == 0)
237 break; 235 break;
238 /* FALLTHROUGH */ 236 /* FALLTHROUGH */
239 default: 237 default:
240 aprint_error_dev(self, "could not map mem space\n"); 238 aprint_error_dev(self, "could not map mem space\n");
241 return; 239 return;
242 } 240 }

cvs diff -r1.18 -r1.19 src/sys/dev/pci/if_ral_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_ral_pci.c 2011/07/26 20:51:24 1.18
+++ src/sys/dev/pci/if_ral_pci.c 2012/01/30 19:41:20 1.19
@@ -1,38 +1,38 @@ @@ -1,38 +1,38 @@
1/* $NetBSD: if_ral_pci.c,v 1.18 2011/07/26 20:51:24 dyoung Exp $ */ 1/* $NetBSD: if_ral_pci.c,v 1.19 2012/01/30 19:41:20 drochner Exp $ */
2/* $OpenBSD: if_ral_pci.c,v 1.6 2006/01/09 20:03:43 damien Exp $ */ 2/* $OpenBSD: if_ral_pci.c,v 1.6 2006/01/09 20:03:43 damien Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2005, 2006 5 * Copyright (c) 2005, 2006
6 * Damien Bergamini <damien.bergamini@free.fr> 6 * Damien Bergamini <damien.bergamini@free.fr>
7 * 7 *
8 * Permission to use, copy, modify, and distribute this software for any 8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above 9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies. 10 * copyright notice and this permission notice appear in all copies.
11 * 11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 */ 19 */
20 20
21/* 21/*
22 * PCI front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver. 22 * PCI front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
23 */ 23 */
24#include <sys/cdefs.h> 24#include <sys/cdefs.h>
25__KERNEL_RCSID(0, "$NetBSD: if_ral_pci.c,v 1.18 2011/07/26 20:51:24 dyoung Exp $"); 25__KERNEL_RCSID(0, "$NetBSD: if_ral_pci.c,v 1.19 2012/01/30 19:41:20 drochner Exp $");
26 26
27 27
28#include <sys/param.h> 28#include <sys/param.h>
29#include <sys/sockio.h> 29#include <sys/sockio.h>
30#include <sys/mbuf.h> 30#include <sys/mbuf.h>
31#include <sys/kernel.h> 31#include <sys/kernel.h>
32#include <sys/socket.h> 32#include <sys/socket.h>
33#include <sys/systm.h> 33#include <sys/systm.h>
34#include <sys/malloc.h> 34#include <sys/malloc.h>
35#include <sys/device.h> 35#include <sys/device.h>
36 36
37#include <sys/bus.h> 37#include <sys/bus.h>
38#include <sys/intr.h> 38#include <sys/intr.h>
@@ -114,35 +114,32 @@ ral_pci_match(device_t parent, cfdata_t  @@ -114,35 +114,32 @@ ral_pci_match(device_t parent, cfdata_t
114 } 114 }
115 } 115 }
116 116
117 return 0; 117 return 0;
118} 118}
119 119
120void 120void
121ral_pci_attach(device_t parent, device_t self, void *aux) 121ral_pci_attach(device_t parent, device_t self, void *aux)
122{ 122{
123 struct ral_pci_softc *psc = device_private(self); 123 struct ral_pci_softc *psc = device_private(self);
124 struct rt2560_softc *sc = &psc->sc_sc; 124 struct rt2560_softc *sc = &psc->sc_sc;
125 const struct pci_attach_args *pa = aux; 125 const struct pci_attach_args *pa = aux;
126 const char *intrstr; 126 const char *intrstr;
127 char devinfo[256]; 
128 bus_addr_t base; 127 bus_addr_t base;
129 pci_intr_handle_t ih; 128 pci_intr_handle_t ih;
130 pcireg_t reg; 129 pcireg_t reg;
131 int error, revision; 130 int error;
132 131
133 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 132 pci_aprint_devinfo(pa, NULL);
134 revision = PCI_REVISION(pa->pa_class); 
135 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision); 
136 133
137 psc->sc_opns = (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_RALINK_RT2560) ? 134 psc->sc_opns = (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_RALINK_RT2560) ?
138 &ral_rt2560_opns : &ral_rt2661_opns; 135 &ral_rt2560_opns : &ral_rt2661_opns;
139 136
140 sc->sc_dmat = pa->pa_dmat; 137 sc->sc_dmat = pa->pa_dmat;
141 psc->sc_pc = pa->pa_pc; 138 psc->sc_pc = pa->pa_pc;
142 139
143 /* enable the appropriate bits in the PCI CSR */ 140 /* enable the appropriate bits in the PCI CSR */
144 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); 141 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
145 reg |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE; 142 reg |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE;
146 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, reg); 143 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, reg);
147 144
148 /* map control/status registers */ 145 /* map control/status registers */

cvs diff -r1.40 -r1.41 src/sys/dev/pci/if_re_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_re_pci.c 2010/07/27 21:48:41 1.40
+++ src/sys/dev/pci/if_re_pci.c 2012/01/30 19:41:20 1.41
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_re_pci.c,v 1.40 2010/07/27 21:48:41 jakllsch Exp $ */ 1/* $NetBSD: if_re_pci.c,v 1.41 2012/01/30 19:41:20 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997, 1998-2003 4 * Copyright (c) 1997, 1998-2003
5 * Bill Paul <wpaul@windriver.com>. All rights reserved. 5 * Bill Paul <wpaul@windriver.com>. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -36,27 +36,27 @@ @@ -36,27 +36,27 @@
36 36
37/* 37/*
38 * RealTek 8139C+/8169/8169S/8110S PCI NIC driver 38 * RealTek 8139C+/8169/8169S/8110S PCI NIC driver
39 * 39 *
40 * Written by Bill Paul <wpaul@windriver.com> 40 * Written by Bill Paul <wpaul@windriver.com>
41 * Senior Networking Software Engineer 41 * Senior Networking Software Engineer
42 * Wind River Systems 42 * Wind River Systems
43 * 43 *
44 * NetBSD bus-specific frontends for written by 44 * NetBSD bus-specific frontends for written by
45 * Jonathan Stone <jonathan@netbsd.org> 45 * Jonathan Stone <jonathan@netbsd.org>
46 */ 46 */
47 47
48#include <sys/cdefs.h> 48#include <sys/cdefs.h>
49__KERNEL_RCSID(0, "$NetBSD: if_re_pci.c,v 1.40 2010/07/27 21:48:41 jakllsch Exp $"); 49__KERNEL_RCSID(0, "$NetBSD: if_re_pci.c,v 1.41 2012/01/30 19:41:20 drochner Exp $");
50 50
51#include <sys/types.h> 51#include <sys/types.h>
52 52
53#include <sys/param.h> 53#include <sys/param.h>
54#include <sys/systm.h> 54#include <sys/systm.h>
55#include <sys/device.h> 55#include <sys/device.h>
56 56
57#include <net/if.h> 57#include <net/if.h>
58#include <net/if_ether.h> 58#include <net/if_ether.h>
59#include <net/if_media.h> 59#include <net/if_media.h>
60 60
61#include <sys/bus.h> 61#include <sys/bus.h>
62 62
@@ -216,28 +216,27 @@ re_pci_attach(device_t parent, device_t  @@ -216,28 +216,27 @@ re_pci_attach(device_t parent, device_t
216 bus_space_unmap(memt, memh, memsize); 216 bus_space_unmap(memt, memh, memsize);
217 } else if (memh_valid) { 217 } else if (memh_valid) {
218 sc->rtk_btag = memt; 218 sc->rtk_btag = memt;
219 sc->rtk_bhandle = memh; 219 sc->rtk_bhandle = memh;
220 sc->rtk_bsize = memsize; 220 sc->rtk_bsize = memsize;
221 } else { 221 } else {
222 aprint_error(": can't map registers\n"); 222 aprint_error(": can't map registers\n");
223 return; 223 return;
224 } 224 }
225 225
226 t = re_pci_lookup(pa); 226 t = re_pci_lookup(pa);
227 KASSERT(t != NULL); 227 KASSERT(t != NULL);
228 228
229 aprint_normal(": %s (rev. 0x%02x)\n", 229 pci_aprint_devinfo_fancy(pa, NULL, t->rtk_name, 1);
230 t->rtk_name, PCI_REVISION(pa->pa_class)); 
231 230
232 if (t->rtk_basetype == RTK_8139CPLUS) 231 if (t->rtk_basetype == RTK_8139CPLUS)
233 sc->sc_quirk |= RTKQ_8139CPLUS; 232 sc->sc_quirk |= RTKQ_8139CPLUS;
234 233
235 if (t->rtk_basetype == RTK_8168 || 234 if (t->rtk_basetype == RTK_8168 ||
236 t->rtk_basetype == RTK_8101E) 235 t->rtk_basetype == RTK_8101E)
237 sc->sc_quirk |= RTKQ_PCIE; 236 sc->sc_quirk |= RTKQ_PCIE;
238 237
239 if (pci_dma64_available(pa) && (sc->sc_quirk & RTKQ_PCIE)) 238 if (pci_dma64_available(pa) && (sc->sc_quirk & RTKQ_PCIE))
240 sc->sc_dmat = pa->pa_dmat64; 239 sc->sc_dmat = pa->pa_dmat64;
241 else 240 else
242 sc->sc_dmat = pa->pa_dmat; 241 sc->sc_dmat = pa->pa_dmat;
243 242

cvs diff -r1.42 -r1.43 src/sys/dev/pci/if_rtk_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_rtk_pci.c 2010/11/02 16:54:29 1.42
+++ src/sys/dev/pci/if_rtk_pci.c 2012/01/30 19:41:20 1.43
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_rtk_pci.c,v 1.42 2010/11/02 16:54:29 jakllsch Exp $ */ 1/* $NetBSD: if_rtk_pci.c,v 1.43 2012/01/30 19:41:20 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997, 1998 4 * Copyright (c) 1997, 1998
5 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 5 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -37,27 +37,27 @@ @@ -37,27 +37,27 @@
37/* 37/*
38 * Realtek 8129/8139 PCI NIC driver 38 * Realtek 8129/8139 PCI NIC driver
39 * 39 *
40 * Supports several extremely cheap PCI 10/100 adapters based on 40 * Supports several extremely cheap PCI 10/100 adapters based on
41 * the Realtek chipset. Datasheets can be obtained from 41 * the Realtek chipset. Datasheets can be obtained from
42 * www.realtek.com.tw. 42 * www.realtek.com.tw.
43 * 43 *
44 * Written by Bill Paul <wpaul@ctr.columbia.edu> 44 * Written by Bill Paul <wpaul@ctr.columbia.edu>
45 * Electrical Engineering Department 45 * Electrical Engineering Department
46 * Columbia University, New York City 46 * Columbia University, New York City
47 */ 47 */
48 48
49#include <sys/cdefs.h> 49#include <sys/cdefs.h>
50__KERNEL_RCSID(0, "$NetBSD: if_rtk_pci.c,v 1.42 2010/11/02 16:54:29 jakllsch Exp $"); 50__KERNEL_RCSID(0, "$NetBSD: if_rtk_pci.c,v 1.43 2012/01/30 19:41:20 drochner Exp $");
51 51
52#include <sys/param.h> 52#include <sys/param.h>
53#include <sys/systm.h> 53#include <sys/systm.h>
54#include <sys/callout.h> 54#include <sys/callout.h>
55#include <sys/device.h> 55#include <sys/device.h>
56#include <sys/sockio.h> 56#include <sys/sockio.h>
57#include <sys/mbuf.h> 57#include <sys/mbuf.h>
58#include <sys/malloc.h> 58#include <sys/malloc.h>
59#include <sys/kernel.h> 59#include <sys/kernel.h>
60#include <sys/socket.h> 60#include <sys/socket.h>
61 61
62#include <net/if.h> 62#include <net/if.h>
63#include <net/if_arp.h> 63#include <net/if_arp.h>
@@ -159,29 +159,27 @@ rtk_pci_attach(device_t parent, device_t @@ -159,29 +159,27 @@ rtk_pci_attach(device_t parent, device_t
159 bus_space_handle_t ioh, memh; 159 bus_space_handle_t ioh, memh;
160 bus_size_t iosize, memsize; 160 bus_size_t iosize, memsize;
161 pcireg_t csr; 161 pcireg_t csr;
162 const char *intrstr = NULL; 162 const char *intrstr = NULL;
163 const struct rtk_type *t; 163 const struct rtk_type *t;
164 bool ioh_valid, memh_valid; 164 bool ioh_valid, memh_valid;
165 165
166 sc->sc_dev = self; 166 sc->sc_dev = self;
167 psc->sc_pc = pa->pa_pc; 167 psc->sc_pc = pa->pa_pc;
168 168
169 t = rtk_pci_lookup(pa); 169 t = rtk_pci_lookup(pa);
170 KASSERT(t != NULL); 170 KASSERT(t != NULL);
171 171
172 aprint_naive("\n"); 172 pci_aprint_devinfo_fancy(pa, NULL, t->rtk_name, 1);
173 aprint_normal(": %s (rev. 0x%02x)\n", 
174 t->rtk_name, PCI_REVISION(pa->pa_class)); 
175 173
176 /* 174 /*
177 * Map control/status registers. 175 * Map control/status registers.
178 * 176 *
179 * The original FreeBSD's driver has the following comment: 177 * The original FreeBSD's driver has the following comment:
180 * 178 *
181 * Default to using PIO access for this driver. On SMP systems, 179 * Default to using PIO access for this driver. On SMP systems,
182 * there appear to be problems with memory mapped mode: 180 * there appear to be problems with memory mapped mode:
183 * it looks like doing too many memory mapped access 181 * it looks like doing too many memory mapped access
184 * back to back in rapid succession can hang the bus. 182 * back to back in rapid succession can hang the bus.
185 * I'm inclined to blame this on crummy design/construction 183 * I'm inclined to blame this on crummy design/construction
186 * on the part of Realtek. Memory mapped mode does appear to 184 * on the part of Realtek. Memory mapped mode does appear to
187 * work on uniprocessor systems though. 185 * work on uniprocessor systems though.

cvs diff -r1.51 -r1.52 src/sys/dev/pci/if_vge.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_vge.c 2010/04/05 07:20:27 1.51
+++ src/sys/dev/pci/if_vge.c 2012/01/30 19:41:21 1.52
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_vge.c,v 1.51 2010/04/05 07:20:27 joerg Exp $ */ 1/* $NetBSD: if_vge.c,v 1.52 2012/01/30 19:41:21 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2004 4 * Copyright (c) 2004
5 * Bill Paul <wpaul@windriver.com>. All rights reserved. 5 * Bill Paul <wpaul@windriver.com>. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD 25 * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
26 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 * THE POSSIBILITY OF SUCH DAMAGE. 32 * THE POSSIBILITY OF SUCH DAMAGE.
33 * 33 *
34 * FreeBSD: src/sys/dev/vge/if_vge.c,v 1.5 2005/02/07 19:39:29 glebius Exp 34 * FreeBSD: src/sys/dev/vge/if_vge.c,v 1.5 2005/02/07 19:39:29 glebius Exp
35 */ 35 */
36 36
37#include <sys/cdefs.h> 37#include <sys/cdefs.h>
38__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.51 2010/04/05 07:20:27 joerg Exp $"); 38__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.52 2012/01/30 19:41:21 drochner Exp $");
39 39
40/* 40/*
41 * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver. 41 * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
42 * 42 *
43 * Written by Bill Paul <wpaul@windriver.com> 43 * Written by Bill Paul <wpaul@windriver.com>
44 * Senior Networking Software Engineer 44 * Senior Networking Software Engineer
45 * Wind River Systems 45 * Wind River Systems
46 */ 46 */
47 47
48/* 48/*
49 * The VIA Networking VT6122 is a 32bit, 33/66 MHz PCI device that 49 * The VIA Networking VT6122 is a 32bit, 33/66 MHz PCI device that
50 * combines a tri-speed ethernet MAC and PHY, with the following 50 * combines a tri-speed ethernet MAC and PHY, with the following
51 * features: 51 * features:
@@ -934,28 +934,27 @@ static void @@ -934,28 +934,27 @@ static void
934vge_attach(device_t parent, device_t self, void *aux) 934vge_attach(device_t parent, device_t self, void *aux)
935{ 935{
936 uint8_t *eaddr; 936 uint8_t *eaddr;
937 struct vge_softc *sc = device_private(self); 937 struct vge_softc *sc = device_private(self);
938 struct ifnet *ifp; 938 struct ifnet *ifp;
939 struct pci_attach_args *pa = aux; 939 struct pci_attach_args *pa = aux;
940 pci_chipset_tag_t pc = pa->pa_pc; 940 pci_chipset_tag_t pc = pa->pa_pc;
941 const char *intrstr; 941 const char *intrstr;
942 pci_intr_handle_t ih; 942 pci_intr_handle_t ih;
943 uint16_t val; 943 uint16_t val;
944 944
945 sc->sc_dev = self; 945 sc->sc_dev = self;
946 946
947 aprint_normal(": VIA VT612X Gigabit Ethernet (rev. %#x)\n", 947 pci_aprint_devinfo_fancy(pa, NULL, "VIA VT612X Gigabit Ethernet", 1);
948 PCI_REVISION(pa->pa_class)); 
949 948
950 /* Make sure bus-mastering is enabled */ 949 /* Make sure bus-mastering is enabled */
951 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, 950 pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
952 pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG) | 951 pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG) |
953 PCI_COMMAND_MASTER_ENABLE); 952 PCI_COMMAND_MASTER_ENABLE);
954 953
955 /* 954 /*
956 * Map control/status registers. 955 * Map control/status registers.
957 */ 956 */
958 if (pci_mapreg_map(pa, VGE_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0, 957 if (pci_mapreg_map(pa, VGE_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
959 &sc->sc_bst, &sc->sc_bsh, NULL, NULL) != 0) { 958 &sc->sc_bst, &sc->sc_bsh, NULL, NULL) != 0) {
960 aprint_error_dev(self, "couldn't map memory\n"); 959 aprint_error_dev(self, "couldn't map memory\n");
961 return; 960 return;

cvs diff -r1.51 -r1.52 src/sys/dev/pci/pciide_common.c (expand / switch to unified diff)

--- src/sys/dev/pci/pciide_common.c 2011/05/17 17:34:54 1.51
+++ src/sys/dev/pci/pciide_common.c 2012/01/30 19:41:22 1.52
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pciide_common.c,v 1.51 2011/05/17 17:34:54 dyoung Exp $ */ 1/* $NetBSD: pciide_common.c,v 1.52 2012/01/30 19:41:22 drochner Exp $ */
2 2
3 3
4/* 4/*
5 * Copyright (c) 1999, 2000, 2001, 2003 Manuel Bouyer. 5 * Copyright (c) 1999, 2000, 2001, 2003 Manuel Bouyer.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -60,27 +60,27 @@ @@ -60,27 +60,27 @@
60/* 60/*
61 * PCI IDE controller driver. 61 * PCI IDE controller driver.
62 * 62 *
63 * Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD 63 * Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
64 * sys/dev/pci/ppb.c, revision 1.16). 64 * sys/dev/pci/ppb.c, revision 1.16).
65 * 65 *
66 * See "PCI IDE Controller Specification, Revision 1.0 3/4/94" and 66 * See "PCI IDE Controller Specification, Revision 1.0 3/4/94" and
67 * "Programming Interface for Bus Master IDE Controller, Revision 1.0 67 * "Programming Interface for Bus Master IDE Controller, Revision 1.0
68 * 5/16/94" from the PCI SIG. 68 * 5/16/94" from the PCI SIG.
69 * 69 *
70 */ 70 */
71 71
72#include <sys/cdefs.h> 72#include <sys/cdefs.h>
73__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.51 2011/05/17 17:34:54 dyoung Exp $"); 73__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.52 2012/01/30 19:41:22 drochner Exp $");
74 74
75#include <sys/param.h> 75#include <sys/param.h>
76#include <sys/malloc.h> 76#include <sys/malloc.h>
77 77
78#include <dev/pci/pcireg.h> 78#include <dev/pci/pcireg.h>
79#include <dev/pci/pcivar.h> 79#include <dev/pci/pcivar.h>
80#include <dev/pci/pcidevs.h> 80#include <dev/pci/pcidevs.h>
81#include <dev/pci/pciidereg.h> 81#include <dev/pci/pciidereg.h>
82#include <dev/pci/pciidevar.h> 82#include <dev/pci/pciidevar.h>
83 83
84#include <dev/ic/wdcreg.h> 84#include <dev/ic/wdcreg.h>
85 85
86#ifdef ATADEBUG 86#ifdef ATADEBUG
@@ -110,48 +110,47 @@ pciide_lookup_product(pcireg_t id, const @@ -110,48 +110,47 @@ pciide_lookup_product(pcireg_t id, const
110 if (pp->chip_map == NULL) 110 if (pp->chip_map == NULL)
111 return NULL; 111 return NULL;
112 return pp; 112 return pp;
113} 113}
114 114
115void 115void
116pciide_common_attach(struct pciide_softc *sc, const struct pci_attach_args *pa, const struct pciide_product_desc *pp) 116pciide_common_attach(struct pciide_softc *sc, const struct pci_attach_args *pa, const struct pciide_product_desc *pp)
117{ 117{
118 pci_chipset_tag_t pc = pa->pa_pc; 118 pci_chipset_tag_t pc = pa->pa_pc;
119 pcitag_t tag = pa->pa_tag; 119 pcitag_t tag = pa->pa_tag;
120#if NATA_DMA 120#if NATA_DMA
121 pcireg_t csr; 121 pcireg_t csr;
122#endif 122#endif
123 char devinfo[256]; 123 const char *displaydev = NULL;
124 const char *displaydev; 124 int dontprint = 0;
125 
126 aprint_naive(": disk controller\n"); 
127 125
128 sc->sc_pci_id = pa->pa_id; 126 sc->sc_pci_id = pa->pa_id;
129 if (pp == NULL) { 127 if (pp == NULL) {
130 /* should only happen for generic pciide devices */ 128 /* should only happen for generic pciide devices */
131 sc->sc_pp = &default_product_desc; 129 sc->sc_pp = &default_product_desc;
132 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
133 displaydev = devinfo; 
134 } else { 130 } else {
135 sc->sc_pp = pp; 131 sc->sc_pp = pp;
136 displaydev = sc->sc_pp->ide_name; 132 /* if ide_name == NULL, printf is done in chip-specific map */
 133 if (pp->ide_name)
 134 displaydev = pp->ide_name;
 135 else
 136 dontprint = 1;
137 } 137 }
138 138
139 /* if displaydev == NULL, printf is done in chip-specific map */ 139 if (dontprint) {
140 if (displaydev) 140 aprint_naive("disk controller\n");
141 aprint_normal(": %s (rev. 0x%02x)\n", displaydev, 141 aprint_normal("\n"); /* ??? */
142 PCI_REVISION(pa->pa_class)); 142 } else
143 else 143 pci_aprint_devinfo_fancy(pa, "disk controller", displaydev, 1);
144 aprint_normal("\n"); 
145 144
146 sc->sc_pc = pa->pa_pc; 145 sc->sc_pc = pa->pa_pc;
147 sc->sc_tag = pa->pa_tag; 146 sc->sc_tag = pa->pa_tag;
148 147
149#if NATA_DMA 148#if NATA_DMA
150 /* Set up DMA defaults; these might be adjusted by chip_map. */ 149 /* Set up DMA defaults; these might be adjusted by chip_map. */
151 sc->sc_dma_maxsegsz = IDEDMA_BYTE_COUNT_MAX; 150 sc->sc_dma_maxsegsz = IDEDMA_BYTE_COUNT_MAX;
152 sc->sc_dma_boundary = IDEDMA_BYTE_COUNT_ALIGN; 151 sc->sc_dma_boundary = IDEDMA_BYTE_COUNT_ALIGN;
153#endif 152#endif
154 153
155#ifdef ATADEBUG 154#ifdef ATADEBUG
156 if (atadebug_pciide_mask & DEBUG_PROBE) 155 if (atadebug_pciide_mask & DEBUG_PROBE)
157 pci_conf_print(sc->sc_pc, sc->sc_tag, NULL); 156 pci_conf_print(sc->sc_pc, sc->sc_tag, NULL);

cvs diff -r1.108 -r1.109 src/sys/dev/pci/if_vr.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_vr.c 2011/11/19 22:51:23 1.108
+++ src/sys/dev/pci/if_vr.c 2012/01/30 19:41:21 1.109
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_vr.c,v 1.108 2011/11/19 22:51:23 tls Exp $ */ 1/* $NetBSD: if_vr.c,v 1.109 2012/01/30 19:41:21 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -87,27 +87,27 @@ @@ -87,27 +87,27 @@
87 * The Rhine has a serious flaw in its transmit DMA mechanism: 87 * The Rhine has a serious flaw in its transmit DMA mechanism:
88 * transmit buffers must be longword aligned. Unfortunately, 88 * transmit buffers must be longword aligned. Unfortunately,
89 * the kernel doesn't guarantee that mbufs will be filled in starting 89 * the kernel doesn't guarantee that mbufs will be filled in starting
90 * at longword boundaries, so we have to do a buffer copy before 90 * at longword boundaries, so we have to do a buffer copy before
91 * transmission. 91 * transmission.
92 * 92 *
93 * Apparently, the receive DMA mechanism also has the same flaw. This 93 * Apparently, the receive DMA mechanism also has the same flaw. This
94 * means that on systems with struct alignment requirements, incoming 94 * means that on systems with struct alignment requirements, incoming
95 * frames must be copied to a new buffer which shifts the data forward 95 * frames must be copied to a new buffer which shifts the data forward
96 * 2 bytes so that the payload is aligned on a 4-byte boundary. 96 * 2 bytes so that the payload is aligned on a 4-byte boundary.
97 */ 97 */
98 98
99#include <sys/cdefs.h> 99#include <sys/cdefs.h>
100__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.108 2011/11/19 22:51:23 tls Exp $"); 100__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.109 2012/01/30 19:41:21 drochner Exp $");
101 101
102#include "rnd.h" 102#include "rnd.h"
103 103
104#include <sys/param.h> 104#include <sys/param.h>
105#include <sys/systm.h> 105#include <sys/systm.h>
106#include <sys/callout.h> 106#include <sys/callout.h>
107#include <sys/sockio.h> 107#include <sys/sockio.h>
108#include <sys/mbuf.h> 108#include <sys/mbuf.h>
109#include <sys/malloc.h> 109#include <sys/malloc.h>
110#include <sys/kernel.h> 110#include <sys/kernel.h>
111#include <sys/socket.h> 111#include <sys/socket.h>
112#include <sys/device.h> 112#include <sys/device.h>
113 113
@@ -1430,41 +1430,37 @@ vr_shutdown(device_t self, int howto) @@ -1430,41 +1430,37 @@ vr_shutdown(device_t self, int howto)
1430 * Attach the interface. Allocate softc structures, do ifmedia 1430 * Attach the interface. Allocate softc structures, do ifmedia
1431 * setup and ethernet/BPF attach. 1431 * setup and ethernet/BPF attach.
1432 */ 1432 */
1433static void 1433static void
1434vr_attach(device_t parent, device_t self, void *aux) 1434vr_attach(device_t parent, device_t self, void *aux)
1435{ 1435{
1436 struct vr_softc *sc = device_private(self); 1436 struct vr_softc *sc = device_private(self);
1437 struct pci_attach_args *pa = (struct pci_attach_args *) aux; 1437 struct pci_attach_args *pa = (struct pci_attach_args *) aux;
1438 bus_dma_segment_t seg; 1438 bus_dma_segment_t seg;
1439 uint32_t reg; 1439 uint32_t reg;
1440 struct ifnet *ifp; 1440 struct ifnet *ifp;
1441 uint8_t eaddr[ETHER_ADDR_LEN], mac; 1441 uint8_t eaddr[ETHER_ADDR_LEN], mac;
1442 int i, rseg, error; 1442 int i, rseg, error;
1443 char devinfo[256]; 
1444 1443
1445#define PCI_CONF_WRITE(r, v) pci_conf_write(sc->vr_pc, sc->vr_tag, (r), (v)) 1444#define PCI_CONF_WRITE(r, v) pci_conf_write(sc->vr_pc, sc->vr_tag, (r), (v))
1446#define PCI_CONF_READ(r) pci_conf_read(sc->vr_pc, sc->vr_tag, (r)) 1445#define PCI_CONF_READ(r) pci_conf_read(sc->vr_pc, sc->vr_tag, (r))
1447 1446
1448 sc->vr_dev = self; 1447 sc->vr_dev = self;
1449 sc->vr_pc = pa->pa_pc; 1448 sc->vr_pc = pa->pa_pc;
1450 sc->vr_tag = pa->pa_tag; 1449 sc->vr_tag = pa->pa_tag;
1451 sc->vr_id = pa->pa_id; 1450 sc->vr_id = pa->pa_id;
1452 callout_init(&sc->vr_tick_ch, 0); 1451 callout_init(&sc->vr_tick_ch, 0);
1453 1452
1454 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 1453 pci_aprint_devinfo(pa, NULL);
1455 aprint_naive("\n"); 
1456 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
1457 PCI_REVISION(pa->pa_class)); 
1458 1454
1459 /* 1455 /*
1460 * Handle power management nonsense. 1456 * Handle power management nonsense.
1461 */ 1457 */
1462 1458
1463 sc->vr_save_iobase = PCI_CONF_READ(VR_PCI_LOIO); 1459 sc->vr_save_iobase = PCI_CONF_READ(VR_PCI_LOIO);
1464 sc->vr_save_membase = PCI_CONF_READ(VR_PCI_LOMEM); 1460 sc->vr_save_membase = PCI_CONF_READ(VR_PCI_LOMEM);
1465 sc->vr_save_irq = PCI_CONF_READ(PCI_INTERRUPT_REG); 1461 sc->vr_save_irq = PCI_CONF_READ(PCI_INTERRUPT_REG);
1466 1462
1467 /* power up chip */ 1463 /* power up chip */
1468 if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self, 1464 if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
1469 vr_restore_state)) && error != EOPNOTSUPP) { 1465 vr_restore_state)) && error != EOPNOTSUPP) {
1470 aprint_error_dev(self, "cannot activate %d\n", 1466 aprint_error_dev(self, "cannot activate %d\n",

cvs diff -r1.3 -r1.4 src/sys/dev/pci/if_vte.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_vte.c 2011/04/28 17:32:48 1.3
+++ src/sys/dev/pci/if_vte.c 2012/01/30 19:41:21 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_vte.c,v 1.3 2011/04/28 17:32:48 bouyer Exp $ */ 1/* $NetBSD: if_vte.c,v 1.4 2012/01/30 19:41:21 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2011 Manuel Bouyer. All rights reserved. 4 * Copyright (c) 2011 Manuel Bouyer. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -45,27 +45,27 @@ @@ -45,27 +45,27 @@
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE. 51 * SUCH DAMAGE.
52 */ 52 */
53/* FreeBSD: src/sys/dev/vte/if_vte.c,v 1.2 2010/12/31 01:23:04 yongari Exp */ 53/* FreeBSD: src/sys/dev/vte/if_vte.c,v 1.2 2010/12/31 01:23:04 yongari Exp */
54 54
55/* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */ 55/* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
56 56
57#include <sys/cdefs.h> 57#include <sys/cdefs.h>
58__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.3 2011/04/28 17:32:48 bouyer Exp $"); 58__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.4 2012/01/30 19:41:21 drochner Exp $");
59 59
60#include <sys/param.h> 60#include <sys/param.h>
61#include <sys/systm.h> 61#include <sys/systm.h>
62#include <sys/mbuf.h> 62#include <sys/mbuf.h>
63#include <sys/protosw.h> 63#include <sys/protosw.h>
64#include <sys/socket.h> 64#include <sys/socket.h>
65#include <sys/ioctl.h> 65#include <sys/ioctl.h>
66#include <sys/errno.h> 66#include <sys/errno.h>
67#include <sys/malloc.h> 67#include <sys/malloc.h>
68#include <sys/kernel.h> 68#include <sys/kernel.h>
69#include <sys/device.h> 69#include <sys/device.h>
70#include <sys/sysctl.h> 70#include <sys/sysctl.h>
71 71
@@ -165,32 +165,30 @@ vte_match(device_t parent, cfdata_t cf,  @@ -165,32 +165,30 @@ vte_match(device_t parent, cfdata_t cf,
165} 165}
166 166
167static void 167static void
168vte_attach(device_t parent, device_t self, void *aux) 168vte_attach(device_t parent, device_t self, void *aux)
169{ 169{
170 struct vte_softc *sc = device_private(self); 170 struct vte_softc *sc = device_private(self);
171 struct pci_attach_args * const pa = (struct pci_attach_args *)aux; 171 struct pci_attach_args * const pa = (struct pci_attach_args *)aux;
172 struct ifnet * const ifp = &sc->vte_if; 172 struct ifnet * const ifp = &sc->vte_if;
173 int h_valid; 173 int h_valid;
174 pcireg_t reg, csr; 174 pcireg_t reg, csr;
175 pci_intr_handle_t intrhandle; 175 pci_intr_handle_t intrhandle;
176 const char *intrstr; 176 const char *intrstr;
177 int error; 177 int error;
178 char devinfo[256]; 
179 const struct sysctlnode *node; 178 const struct sysctlnode *node;
180 int vte_nodenum; 179 int vte_nodenum;
181 180
182 sc->vte_dev = self; 181 sc->vte_dev = self;
183 aprint_normal("\n"); 
184 182
185 callout_init(&sc->vte_tick_ch, 0); 183 callout_init(&sc->vte_tick_ch, 0);
186 184
187 /* Map the device. */ 185 /* Map the device. */
188 h_valid = 0; 186 h_valid = 0;
189 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, VTE_PCI_BMEM); 187 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, VTE_PCI_BMEM);
190 if (PCI_MAPREG_TYPE(reg) == PCI_MAPREG_TYPE_MEM) { 188 if (PCI_MAPREG_TYPE(reg) == PCI_MAPREG_TYPE_MEM) {
191 h_valid = (pci_mapreg_map(pa, VTE_PCI_BMEM, 189 h_valid = (pci_mapreg_map(pa, VTE_PCI_BMEM,
192 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 190 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
193 0, &sc->vte_bustag, &sc->vte_bushandle, NULL, NULL) == 0); 191 0, &sc->vte_bustag, &sc->vte_bushandle, NULL, NULL) == 0);
194 } 192 }
195 if (h_valid == 0) { 193 if (h_valid == 0) {
196 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, VTE_PCI_BIO); 194 reg = pci_conf_read(pa->pa_pc, pa->pa_tag, VTE_PCI_BIO);
@@ -200,28 +198,27 @@ vte_attach(device_t parent, device_t sel @@ -200,28 +198,27 @@ vte_attach(device_t parent, device_t sel
200 &sc->vte_bushandle, NULL, NULL) == 0); 198 &sc->vte_bushandle, NULL, NULL) == 0);
201 } 199 }
202 } 200 }
203 if (h_valid == 0) { 201 if (h_valid == 0) {
204 aprint_error_dev(self, "unable to map device registers\n"); 202 aprint_error_dev(self, "unable to map device registers\n");
205 return; 203 return;
206 } 204 }
207 sc->vte_dmatag = pa->pa_dmat; 205 sc->vte_dmatag = pa->pa_dmat;
208 /* Enable the device. */ 206 /* Enable the device. */
209 csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); 207 csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
210 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, 208 pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
211 csr | PCI_COMMAND_MASTER_ENABLE); 209 csr | PCI_COMMAND_MASTER_ENABLE);
212 210
213 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 211 pci_aprint_devinfo(pa, NULL);
214 aprint_normal_dev(self, "%s\n", devinfo); 
215 212
216 /* Reset the ethernet controller. */ 213 /* Reset the ethernet controller. */
217 vte_reset(sc); 214 vte_reset(sc);
218 215
219 if ((error = vte_dma_alloc(sc)) != 0) 216 if ((error = vte_dma_alloc(sc)) != 0)
220 return; 217 return;
221 218
222 /* Load station address. */ 219 /* Load station address. */
223 vte_get_macaddr(sc); 220 vte_get_macaddr(sc);
224 221
225 aprint_normal_dev(self, "Ethernet address %s\n", 222 aprint_normal_dev(self, "Ethernet address %s\n",
226 ether_sprintf(sc->vte_eaddr)); 223 ether_sprintf(sc->vte_eaddr));
227 224

cvs diff -r1.225 -r1.226 src/sys/dev/pci/if_wm.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_wm.c 2011/11/28 18:21:46 1.225
+++ src/sys/dev/pci/if_wm.c 2012/01/30 19:41:21 1.226
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_wm.c,v 1.225 2011/11/28 18:21:46 bouyer Exp $ */ 1/* $NetBSD: if_wm.c,v 1.226 2012/01/30 19:41:21 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -66,27 +66,27 @@ @@ -66,27 +66,27 @@
66 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 66 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
67 POSSIBILITY OF SUCH DAMAGE. 67 POSSIBILITY OF SUCH DAMAGE.
68 68
69*******************************************************************************/ 69*******************************************************************************/
70/* 70/*
71 * Device driver for the Intel i8254x family of Gigabit Ethernet chips. 71 * Device driver for the Intel i8254x family of Gigabit Ethernet chips.
72 * 72 *
73 * TODO (in order of importance): 73 * TODO (in order of importance):
74 * 74 *
75 * - Rework how parameters are loaded from the EEPROM. 75 * - Rework how parameters are loaded from the EEPROM.
76 */ 76 */
77 77
78#include <sys/cdefs.h> 78#include <sys/cdefs.h>
79__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.225 2011/11/28 18:21:46 bouyer Exp $"); 79__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.226 2012/01/30 19:41:21 drochner Exp $");
80 80
81#include "rnd.h" 81#include "rnd.h"
82 82
83#include <sys/param.h> 83#include <sys/param.h>
84#include <sys/systm.h> 84#include <sys/systm.h>
85#include <sys/callout.h> 85#include <sys/callout.h>
86#include <sys/mbuf.h> 86#include <sys/mbuf.h>
87#include <sys/malloc.h> 87#include <sys/malloc.h>
88#include <sys/kernel.h> 88#include <sys/kernel.h>
89#include <sys/socket.h> 89#include <sys/socket.h>
90#include <sys/ioctl.h> 90#include <sys/ioctl.h>
91#include <sys/errno.h> 91#include <sys/errno.h>
92#include <sys/device.h> 92#include <sys/device.h>
@@ -1133,28 +1133,27 @@ wm_attach(device_t parent, device_t self @@ -1133,28 +1133,27 @@ wm_attach(device_t parent, device_t self
1133 printf("\n"); 1133 printf("\n");
1134 panic("wm_attach: impossible"); 1134 panic("wm_attach: impossible");
1135 } 1135 }
1136 1136
1137 sc->sc_pc = pa->pa_pc; 1137 sc->sc_pc = pa->pa_pc;
1138 sc->sc_pcitag = pa->pa_tag; 1138 sc->sc_pcitag = pa->pa_tag;
1139 1139
1140 if (pci_dma64_available(pa)) 1140 if (pci_dma64_available(pa))
1141 sc->sc_dmat = pa->pa_dmat64; 1141 sc->sc_dmat = pa->pa_dmat64;
1142 else 1142 else
1143 sc->sc_dmat = pa->pa_dmat; 1143 sc->sc_dmat = pa->pa_dmat;
1144 1144
1145 sc->sc_rev = PCI_REVISION(pci_conf_read(pc, pa->pa_tag, PCI_CLASS_REG)); 1145 sc->sc_rev = PCI_REVISION(pci_conf_read(pc, pa->pa_tag, PCI_CLASS_REG));
1146 aprint_naive(": Ethernet controller\n"); 1146 pci_aprint_devinfo_fancy(pa, "Ethernet controller", wmp->wmp_name, 1);
1147 aprint_normal(": %s, rev. %d\n", wmp->wmp_name, sc->sc_rev); 
1148 1147
1149 sc->sc_type = wmp->wmp_type; 1148 sc->sc_type = wmp->wmp_type;
1150 if (sc->sc_type < WM_T_82543) { 1149 if (sc->sc_type < WM_T_82543) {
1151 if (sc->sc_rev < 2) { 1150 if (sc->sc_rev < 2) {
1152 aprint_error_dev(sc->sc_dev, 1151 aprint_error_dev(sc->sc_dev,
1153 "i82542 must be at least rev. 2\n"); 1152 "i82542 must be at least rev. 2\n");
1154 return; 1153 return;
1155 } 1154 }
1156 if (sc->sc_rev < 3) 1155 if (sc->sc_rev < 3)
1157 sc->sc_type = WM_T_82542_2_0; 1156 sc->sc_type = WM_T_82542_2_0;
1158 } 1157 }
1159 1158
1160 if ((sc->sc_type == WM_T_82575) || (sc->sc_type == WM_T_82576) 1159 if ((sc->sc_type == WM_T_82575) || (sc->sc_type == WM_T_82576)

cvs diff -r1.49 -r1.50 src/sys/dev/pci/if_wpi.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_wpi.c 2011/04/02 08:11:31 1.49
+++ src/sys/dev/pci/if_wpi.c 2012/01/30 19:41:21 1.50
@@ -1,34 +1,34 @@ @@ -1,34 +1,34 @@
1/* $NetBSD: if_wpi.c,v 1.49 2011/04/02 08:11:31 mbalmer Exp $ */ 1/* $NetBSD: if_wpi.c,v 1.50 2012/01/30 19:41:21 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006, 2007 4 * Copyright (c) 2006, 2007
5 * Damien Bergamini <damien.bergamini@free.fr> 5 * Damien Bergamini <damien.bergamini@free.fr>
6 * 6 *
7 * Permission to use, copy, modify, and distribute this software for any 7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above 8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies. 9 * copyright notice and this permission notice appear in all copies.
10 * 10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */ 18 */
19 19
20#include <sys/cdefs.h> 20#include <sys/cdefs.h>
21__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.49 2011/04/02 08:11:31 mbalmer Exp $"); 21__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.50 2012/01/30 19:41:21 drochner Exp $");
22 22
23/* 23/*
24 * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters. 24 * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
25 */ 25 */
26 26
27 27
28#include <sys/param.h> 28#include <sys/param.h>
29#include <sys/sockio.h> 29#include <sys/sockio.h>
30#include <sys/sysctl.h> 30#include <sys/sysctl.h>
31#include <sys/mbuf.h> 31#include <sys/mbuf.h>
32#include <sys/kernel.h> 32#include <sys/kernel.h>
33#include <sys/socket.h> 33#include <sys/socket.h>
34#include <sys/systm.h> 34#include <sys/systm.h>
@@ -199,46 +199,43 @@ wpi_attach_once(void) @@ -199,46 +199,43 @@ wpi_attach_once(void)
199{ 199{
200 mutex_init(&wpi_firmware_mutex, MUTEX_DEFAULT, IPL_NONE); 200 mutex_init(&wpi_firmware_mutex, MUTEX_DEFAULT, IPL_NONE);
201 return 0; 201 return 0;
202} 202}
203 203
204static void 204static void
205wpi_attach(device_t parent __unused, device_t self, void *aux) 205wpi_attach(device_t parent __unused, device_t self, void *aux)
206{ 206{
207 struct wpi_softc *sc = device_private(self); 207 struct wpi_softc *sc = device_private(self);
208 struct ieee80211com *ic = &sc->sc_ic; 208 struct ieee80211com *ic = &sc->sc_ic;
209 struct ifnet *ifp = &sc->sc_ec.ec_if; 209 struct ifnet *ifp = &sc->sc_ec.ec_if;
210 struct pci_attach_args *pa = aux; 210 struct pci_attach_args *pa = aux;
211 const char *intrstr; 211 const char *intrstr;
212 char devinfo[256]; 
213 bus_space_tag_t memt; 212 bus_space_tag_t memt;
214 bus_space_handle_t memh; 213 bus_space_handle_t memh;
215 pci_intr_handle_t ih; 214 pci_intr_handle_t ih;
216 pcireg_t data; 215 pcireg_t data;
217 int error, ac, revision; 216 int error, ac;
218 217
219 RUN_ONCE(&wpi_firmware_init, wpi_attach_once); 218 RUN_ONCE(&wpi_firmware_init, wpi_attach_once);
220 sc->fw_used = false; 219 sc->fw_used = false;
221 220
222 sc->sc_dev = self; 221 sc->sc_dev = self;
223 sc->sc_pct = pa->pa_pc; 222 sc->sc_pct = pa->pa_pc;
224 sc->sc_pcitag = pa->pa_tag; 223 sc->sc_pcitag = pa->pa_tag;
225 224
226 callout_init(&sc->calib_to, 0); 225 callout_init(&sc->calib_to, 0);
227 callout_setfunc(&sc->calib_to, wpi_calib_timeout, sc); 226 callout_setfunc(&sc->calib_to, wpi_calib_timeout, sc);
228 227
229 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof devinfo); 228 pci_aprint_devinfo(pa, NULL);
230 revision = PCI_REVISION(pa->pa_class); 
231 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision); 
232 229
233 /* enable bus-mastering */ 230 /* enable bus-mastering */
234 data = pci_conf_read(sc->sc_pct, sc->sc_pcitag, PCI_COMMAND_STATUS_REG); 231 data = pci_conf_read(sc->sc_pct, sc->sc_pcitag, PCI_COMMAND_STATUS_REG);
235 data |= PCI_COMMAND_MASTER_ENABLE; 232 data |= PCI_COMMAND_MASTER_ENABLE;
236 pci_conf_write(sc->sc_pct, sc->sc_pcitag, PCI_COMMAND_STATUS_REG, data); 233 pci_conf_write(sc->sc_pct, sc->sc_pcitag, PCI_COMMAND_STATUS_REG, data);
237 234
238 /* map the register window */ 235 /* map the register window */
239 error = pci_mapreg_map(pa, WPI_PCI_BAR0, PCI_MAPREG_TYPE_MEM | 236 error = pci_mapreg_map(pa, WPI_PCI_BAR0, PCI_MAPREG_TYPE_MEM |
240 PCI_MAPREG_MEM_TYPE_32BIT, 0, &memt, &memh, NULL, &sc->sc_sz); 237 PCI_MAPREG_MEM_TYPE_32BIT, 0, &memt, &memh, NULL, &sc->sc_sz);
241 if (error != 0) { 238 if (error != 0) {
242 aprint_error_dev(self, "could not map memory space\n"); 239 aprint_error_dev(self, "could not map memory space\n");
243 return; 240 return;
244 } 241 }

cvs diff -r1.22 -r1.23 src/sys/dev/pci/igsfb_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/igsfb_pci.c 2011/08/27 20:02:18 1.22
+++ src/sys/dev/pci/igsfb_pci.c 2012/01/30 19:41:21 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: igsfb_pci.c,v 1.22 2011/08/27 20:02:18 martin Exp $ */ 1/* $NetBSD: igsfb_pci.c,v 1.23 2012/01/30 19:41:21 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2002, 2003 Valeriy E. Ushakov 4 * Copyright (c) 2002, 2003 Valeriy E. Ushakov
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30/* 30/*
31 * Integraphics Systems IGA 168x and CyberPro series. 31 * Integraphics Systems IGA 168x and CyberPro series.
32 */ 32 */
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: igsfb_pci.c,v 1.22 2011/08/27 20:02:18 martin Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: igsfb_pci.c,v 1.23 2012/01/30 19:41:21 drochner Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41#include <sys/buf.h> 41#include <sys/buf.h>
42 42
43#ifdef __sparc__ /* XXX: this doesn't belong here */ 43#ifdef __sparc__ /* XXX: this doesn't belong here */
44#include <machine/autoconf.h> 44#include <machine/autoconf.h>
45#endif 45#endif
46#include <sys/bus.h> 46#include <sys/bus.h>
47#include <sys/intr.h> 47#include <sys/intr.h>
@@ -146,32 +146,30 @@ igsfb_pci_match(device_t parent, cfdata_ @@ -146,32 +146,30 @@ igsfb_pci_match(device_t parent, cfdata_
146{ 146{
147 struct pci_attach_args *pa = aux; 147 struct pci_attach_args *pa = aux;
148 148
149 return igsfb_pci_match_by_id(pa->pa_id); 149 return igsfb_pci_match_by_id(pa->pa_id);
150} 150}
151 151
152 152
153static void 153static void
154igsfb_pci_attach(device_t parent, device_t self, void *aux) 154igsfb_pci_attach(device_t parent, device_t self, void *aux)
155{ 155{
156 struct igsfb_softc *sc = device_private(self); 156 struct igsfb_softc *sc = device_private(self);
157 struct pci_attach_args *pa = aux; 157 struct pci_attach_args *pa = aux;
158 int isconsole; 158 int isconsole;
159 char devinfo[256]; 
160 159
161 sc->sc_dev = self; 160 sc->sc_dev = self;
162 161
163 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 162 pci_aprint_devinfo(pa, NULL);
164 printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class)); 
165 163
166#if defined(__sparc__) && !defined(KRUPS_FORCE_SERIAL_CONSOLE) 164#if defined(__sparc__) && !defined(KRUPS_FORCE_SERIAL_CONSOLE)
167 /* XXX: this doesn't belong here */ 165 /* XXX: this doesn't belong here */
168 if (PCITAG_NODE(pa->pa_tag) == prom_instance_to_package(prom_stdout())) 166 if (PCITAG_NODE(pa->pa_tag) == prom_instance_to_package(prom_stdout()))
169 { 167 {
170 int b, d, f; 168 int b, d, f;
171 169
172 pci_decompose_tag(pa->pa_pc, pa->pa_tag, &b, &d, &f); 170 pci_decompose_tag(pa->pa_pc, pa->pa_tag, &b, &d, &f);
173 igsfb_pci_cnattach(pa->pa_iot, pa->pa_memt, pa->pa_pc, b,d,f); 171 igsfb_pci_cnattach(pa->pa_iot, pa->pa_memt, pa->pa_pc, b,d,f);
174 } 172 }
175#endif 173#endif
176 174
177 isconsole = 0; 175 isconsole = 0;

cvs diff -r1.11 -r1.12 src/sys/dev/pci/jmide.c (expand / switch to unified diff)

--- src/sys/dev/pci/jmide.c 2011/08/13 16:04:09 1.11
+++ src/sys/dev/pci/jmide.c 2012/01/30 19:41:22 1.12
@@ -1,41 +1,41 @@ @@ -1,41 +1,41 @@
1/* $NetBSD: jmide.c,v 1.11 2011/08/13 16:04:09 jakllsch Exp $ */ 1/* $NetBSD: jmide.c,v 1.12 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007 Manuel Bouyer. 4 * Copyright (c) 2007 Manuel Bouyer.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27#include <sys/cdefs.h> 27#include <sys/cdefs.h>
28__KERNEL_RCSID(0, "$NetBSD: jmide.c,v 1.11 2011/08/13 16:04:09 jakllsch Exp $"); 28__KERNEL_RCSID(0, "$NetBSD: jmide.c,v 1.12 2012/01/30 19:41:22 drochner Exp $");
29 29
30#include <sys/param.h> 30#include <sys/param.h>
31#include <sys/systm.h> 31#include <sys/systm.h>
32#include <sys/malloc.h> 32#include <sys/malloc.h>
33 33
34#include <dev/pci/pcivar.h> 34#include <dev/pci/pcivar.h>
35#include <dev/pci/pcidevs.h> 35#include <dev/pci/pcidevs.h>
36#include <dev/pci/pciidereg.h> 36#include <dev/pci/pciidereg.h>
37#include <dev/pci/pciidevar.h> 37#include <dev/pci/pciidevar.h>
38 38
39#include <dev/pci/jmide_reg.h> 39#include <dev/pci/jmide_reg.h>
40 40
41#include <dev/ic/ahcisatavar.h> 41#include <dev/ic/ahcisatavar.h>
@@ -136,49 +136,46 @@ jmide_match(device_t parent, cfdata_t ma @@ -136,49 +136,46 @@ jmide_match(device_t parent, cfdata_t ma
136 if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_JMICRON) { 136 if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_JMICRON) {
137 if (jmide_lookup(pa->pa_id)) 137 if (jmide_lookup(pa->pa_id))
138 return (4); /* higher than ahcisata */ 138 return (4); /* higher than ahcisata */
139 } 139 }
140 return (0); 140 return (0);
141} 141}
142 142
143static void 143static void
144jmide_attach(device_t parent, device_t self, void *aux) 144jmide_attach(device_t parent, device_t self, void *aux)
145{ 145{
146 struct pci_attach_args *pa = aux; 146 struct pci_attach_args *pa = aux;
147 struct jmide_softc *sc = device_private(self); 147 struct jmide_softc *sc = device_private(self);
148 const struct jmide_product *jp; 148 const struct jmide_product *jp;
149 char devinfo[256]; 
150 const char *intrstr; 149 const char *intrstr;
151 pci_intr_handle_t intrhandle; 150 pci_intr_handle_t intrhandle;
152 u_int32_t pcictrl0 = pci_conf_read(pa->pa_pc, pa->pa_tag, 151 u_int32_t pcictrl0 = pci_conf_read(pa->pa_pc, pa->pa_tag,
153 PCI_JM_CONTROL0); 152 PCI_JM_CONTROL0);
154 u_int32_t pcictrl1 = pci_conf_read(pa->pa_pc, pa->pa_tag, 153 u_int32_t pcictrl1 = pci_conf_read(pa->pa_pc, pa->pa_tag,
155 PCI_JM_CONTROL1); 154 PCI_JM_CONTROL1);
156 struct pciide_product_desc *pp; 155 struct pciide_product_desc *pp;
157 int ahci_used = 0; 156 int ahci_used = 0;
158 157
159 sc->sc_pciide.sc_wdcdev.sc_atac.atac_dev = self; 158 sc->sc_pciide.sc_wdcdev.sc_atac.atac_dev = self;
160 159
161 jp = jmide_lookup(pa->pa_id); 160 jp = jmide_lookup(pa->pa_id);
162 if (jp == NULL) { 161 if (jp == NULL) {
163 printf("jmide_attach: WTF?\n"); 162 printf("jmide_attach: WTF?\n");
164 return; 163 return;
165 } 164 }
166 sc->sc_npata = jp->jm_npata; 165 sc->sc_npata = jp->jm_npata;
167 sc->sc_nsata = jp->jm_nsata; 166 sc->sc_nsata = jp->jm_nsata;
168 167
169 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 168 pci_aprint_devinfo(pa, "JMICRON PATA/SATA disk controller");
170 aprint_naive(": JMICRON PATA/SATA disk controller\n"); 
171 aprint_normal(": %s\n", devinfo); 
172 169
173 aprint_normal("%s: ", JM_NAME(sc)); 170 aprint_normal("%s: ", JM_NAME(sc));
174 if (sc->sc_npata) 171 if (sc->sc_npata)
175 aprint_normal("%d PATA port%s", sc->sc_npata, 172 aprint_normal("%d PATA port%s", sc->sc_npata,
176 (sc->sc_npata > 1) ? "s" : ""); 173 (sc->sc_npata > 1) ? "s" : "");
177 if (sc->sc_nsata) 174 if (sc->sc_nsata)
178 aprint_normal("%s%d SATA port%s", sc->sc_npata ? ", " : "", 175 aprint_normal("%s%d SATA port%s", sc->sc_npata ? ", " : "",
179 sc->sc_nsata, (sc->sc_nsata > 1) ? "s" : ""); 176 sc->sc_nsata, (sc->sc_nsata > 1) ? "s" : "");
180 aprint_normal("\n"); 177 aprint_normal("\n");
181 178
182 if (pci_intr_map(pa, &intrhandle) != 0) { 179 if (pci_intr_map(pa, &intrhandle) != 0) {
183 aprint_error("%s: couldn't map interrupt\n", JM_NAME(sc)); 180 aprint_error("%s: couldn't map interrupt\n", JM_NAME(sc));
184 return; 181 return;

cvs diff -r1.11 -r1.12 src/sys/dev/pci/pm2fb.c (expand / switch to unified diff)

--- src/sys/dev/pci/pm2fb.c 2012/01/11 16:02:30 1.11
+++ src/sys/dev/pci/pm2fb.c 2012/01/30 19:41:22 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pm2fb.c,v 1.11 2012/01/11 16:02:30 macallan Exp $ */ 1/* $NetBSD: pm2fb.c,v 1.12 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2009 Michael Lorenz 4 * Copyright (c) 2009 Michael Lorenz
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28/* 28/*
29 * A console driver for Permedia 2 graphics controllers 29 * A console driver for Permedia 2 graphics controllers
30 * tested on sparc64 only so far 30 * tested on sparc64 only so far
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.11 2012/01/11 16:02:30 macallan Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.12 2012/01/30 19:41:22 drochner Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41#include <sys/lwp.h> 41#include <sys/lwp.h>
42#include <sys/kauth.h> 42#include <sys/kauth.h>
43 43
44#include <dev/videomode/videomode.h> 44#include <dev/videomode/videomode.h>
45 45
46#include <dev/pci/pcivar.h> 46#include <dev/pci/pcivar.h>
47#include <dev/pci/pcireg.h> 47#include <dev/pci/pcireg.h>
@@ -214,42 +214,40 @@ pm2fb_match(device_t parent, cfdata_t ma @@ -214,42 +214,40 @@ pm2fb_match(device_t parent, cfdata_t ma
214 /* only cards tested on so far - likely need a list */ 214 /* only cards tested on so far - likely need a list */
215 if ((PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3DLABS_PERMEDIA2) || 215 if ((PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3DLABS_PERMEDIA2) ||
216 (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3DLABS_PERMEDIA2V)) 216 (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_3DLABS_PERMEDIA2V))
217 return 100; 217 return 100;
218 return (0); 218 return (0);
219} 219}
220 220
221static void 221static void
222pm2fb_attach(device_t parent, device_t self, void *aux) 222pm2fb_attach(device_t parent, device_t self, void *aux)
223{ 223{
224 struct pm2fb_softc *sc = device_private(self); 224 struct pm2fb_softc *sc = device_private(self);
225 struct pci_attach_args *pa = aux; 225 struct pci_attach_args *pa = aux;
226 struct rasops_info *ri; 226 struct rasops_info *ri;
227 char devinfo[256]; 
228 struct wsemuldisplaydev_attach_args aa; 227 struct wsemuldisplaydev_attach_args aa;
229 prop_dictionary_t dict; 228 prop_dictionary_t dict;
230 unsigned long defattr; 229 unsigned long defattr;
231 bool is_console; 230 bool is_console;
232 int i, j; 231 int i, j;
233 uint32_t flags; 232 uint32_t flags;
234 233
235 sc->sc_pc = pa->pa_pc; 234 sc->sc_pc = pa->pa_pc;
236 sc->sc_pcitag = pa->pa_tag; 235 sc->sc_pcitag = pa->pa_tag;
237 sc->sc_memt = pa->pa_memt; 236 sc->sc_memt = pa->pa_memt;
238 sc->sc_iot = pa->pa_iot; 237 sc->sc_iot = pa->pa_iot;
239 sc->sc_dev = self; 238 sc->sc_dev = self;
240 239
241 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 240 pci_aprint_devinfo(pa, NULL);
242 aprint_normal(": %s\n", devinfo); 
243 241
244 /* fill in parameters from properties */ 242 /* fill in parameters from properties */
245 dict = device_properties(self); 243 dict = device_properties(self);
246 if (!prop_dictionary_get_uint32(dict, "width", &sc->sc_width)) { 244 if (!prop_dictionary_get_uint32(dict, "width", &sc->sc_width)) {
247 aprint_error("%s: no width property\n", device_xname(self)); 245 aprint_error("%s: no width property\n", device_xname(self));
248 return; 246 return;
249 } 247 }
250 if (!prop_dictionary_get_uint32(dict, "height", &sc->sc_height)) { 248 if (!prop_dictionary_get_uint32(dict, "height", &sc->sc_height)) {
251 aprint_error("%s: no height property\n", device_xname(self)); 249 aprint_error("%s: no height property\n", device_xname(self));
252 return; 250 return;
253 } 251 }
254 if (!prop_dictionary_get_uint32(dict, "depth", &sc->sc_depth)) { 252 if (!prop_dictionary_get_uint32(dict, "depth", &sc->sc_depth)) {
255 aprint_error("%s: no depth property\n", device_xname(self)); 253 aprint_error("%s: no depth property\n", device_xname(self));

cvs diff -r1.19 -r1.20 src/sys/dev/pci/joy_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/joy_pci.c 2011/12/05 19:20:55 1.19
+++ src/sys/dev/pci/joy_pci.c 2012/01/30 19:41:22 1.20
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: joy_pci.c,v 1.19 2011/12/05 19:20:55 christos Exp $ */ 1/* $NetBSD: joy_pci.c,v 1.20 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Martin Husemann <martin@NetBSD.org>. 8 * by Martin Husemann <martin@NetBSD.org>.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: joy_pci.c,v 1.19 2011/12/05 19:20:55 christos Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: joy_pci.c,v 1.20 2012/01/30 19:41:22 drochner Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/kernel.h> 37#include <sys/kernel.h>
38#include <sys/device.h> 38#include <sys/device.h>
39 39
40#include <sys/bus.h> 40#include <sys/bus.h>
41 41
42#include <dev/pci/pcireg.h> 42#include <dev/pci/pcireg.h>
43#include <dev/pci/pcivar.h> 43#include <dev/pci/pcivar.h>
44#include <dev/pci/pcidevs.h> 44#include <dev/pci/pcidevs.h>
45 45
46#include <dev/ic/joyvar.h> 46#include <dev/ic/joyvar.h>
@@ -81,32 +81,30 @@ bar_is_io(pci_chipset_tag_t pc, pcitag_t @@ -81,32 +81,30 @@ bar_is_io(pci_chipset_tag_t pc, pcitag_t
81 mask = pci_conf_read(pc, tag, reg); 81 mask = pci_conf_read(pc, tag, reg);
82 pci_conf_write(pc, tag, reg, address); 82 pci_conf_write(pc, tag, reg, address);
83 83
84 return (PCI_MAPREG_TYPE(address) == PCI_MAPREG_TYPE_IO && 84 return (PCI_MAPREG_TYPE(address) == PCI_MAPREG_TYPE_IO &&
85 PCI_MAPREG_IO_SIZE(mask) > 0); 85 PCI_MAPREG_IO_SIZE(mask) > 0);
86} 86}
87 87
88static void 88static void
89joy_pci_attach(device_t parent, device_t self, void *aux) 89joy_pci_attach(device_t parent, device_t self, void *aux)
90{ 90{
91 struct joy_pci_softc *psc = device_private(self); 91 struct joy_pci_softc *psc = device_private(self);
92 struct joy_softc *sc = &psc->sc_joy; 92 struct joy_softc *sc = &psc->sc_joy;
93 struct pci_attach_args *pa = aux; 93 struct pci_attach_args *pa = aux;
94 char devinfo[256]; 
95 bus_size_t mapsize; 94 bus_size_t mapsize;
96 int reg; 95 int reg;
97 96
98 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 97 pci_aprint_devinfo(pa, NULL);
99 aprint_normal(": %s (rev 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class)); 
100  98
101 for (reg = PCI_MAPREG_START; reg < PCI_MAPREG_END; 99 for (reg = PCI_MAPREG_START; reg < PCI_MAPREG_END;
102 reg += sizeof(pcireg_t)) 100 reg += sizeof(pcireg_t))
103 if (bar_is_io(pa->pa_pc, pa->pa_tag, reg)) 101 if (bar_is_io(pa->pa_pc, pa->pa_tag, reg))
104 break; 102 break;
105 if (reg >= PCI_MAPREG_END) { 103 if (reg >= PCI_MAPREG_END) {
106 aprint_error_dev(self, 104 aprint_error_dev(self,
107 "violates PCI spec, no IO region found\n"); 105 "violates PCI spec, no IO region found\n");
108 return; 106 return;
109 } 107 }
110 108
111 if (pci_mapreg_map(pa, reg, PCI_MAPREG_TYPE_IO, 0, 109 if (pci_mapreg_map(pa, reg, PCI_MAPREG_TYPE_IO, 0,
112 &sc->sc_iot, &sc->sc_ioh, NULL, &mapsize)) { 110 &sc->sc_iot, &sc->sc_ioh, NULL, &mapsize)) {

cvs diff -r1.72 -r1.73 src/sys/dev/pci/machfb.c (expand / switch to unified diff)

--- src/sys/dev/pci/machfb.c 2012/01/11 16:02:29 1.72
+++ src/sys/dev/pci/machfb.c 2012/01/30 19:41:22 1.73
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machfb.c,v 1.72 2012/01/11 16:02:29 macallan Exp $ */ 1/* $NetBSD: machfb.c,v 1.73 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2002 Bang Jun-Young 4 * Copyright (c) 2002 Bang Jun-Young
5 * Copyright (c) 2005, 2006, 2007 Michael Lorenz 5 * Copyright (c) 2005, 2006, 2007 Michael Lorenz
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
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31/* 31/*
32 * Some code is derived from ATI Rage Pro and Derivatives Programmer's Guide. 32 * Some code is derived from ATI Rage Pro and Derivatives Programmer's Guide.
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0,  36__KERNEL_RCSID(0,
37 "$NetBSD: machfb.c,v 1.72 2012/01/11 16:02:29 macallan Exp $"); 37 "$NetBSD: machfb.c,v 1.73 2012/01/30 19:41:22 drochner Exp $");
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/kernel.h> 41#include <sys/kernel.h>
42#include <sys/device.h> 42#include <sys/device.h>
43#include <sys/malloc.h> 43#include <sys/malloc.h>
44#include <sys/callout.h> 44#include <sys/callout.h>
45#include <sys/lwp.h> 45#include <sys/lwp.h>
46#include <sys/kauth.h> 46#include <sys/kauth.h>
47 47
48#include <dev/videomode/videomode.h> 48#include <dev/videomode/videomode.h>
49#include <dev/videomode/edidvar.h> 49#include <dev/videomode/edidvar.h>
50 50
@@ -495,54 +495,50 @@ mach64_match(device_t parent, cfdata_t m @@ -495,54 +495,50 @@ mach64_match(device_t parent, cfdata_t m
495 return 0; 495 return 0;
496} 496}
497 497
498static void 498static void
499mach64_attach(device_t parent, device_t self, void *aux) 499mach64_attach(device_t parent, device_t self, void *aux)
500{ 500{
501 struct mach64_softc *sc = device_private(self); 501 struct mach64_softc *sc = device_private(self);
502 struct pci_attach_args *pa = aux; 502 struct pci_attach_args *pa = aux;
503 struct rasops_info *ri; 503 struct rasops_info *ri;
504 prop_data_t edid_data; 504 prop_data_t edid_data;
505#if defined(__sparc__) || defined(__powerpc__) 505#if defined(__sparc__) || defined(__powerpc__)
506 const struct videomode *mode = NULL; 506 const struct videomode *mode = NULL;
507#endif 507#endif
508 char devinfo[256]; 
509 int bar, id, expected_id; 508 int bar, id, expected_id;
510 int is_gx; 509 int is_gx;
511 const char **memtype_names; 510 const char **memtype_names;
512 struct wsemuldisplaydev_attach_args aa; 511 struct wsemuldisplaydev_attach_args aa;
513 long defattr; 512 long defattr;
514 int setmode, width, height; 513 int setmode, width, height;
515 pcireg_t screg; 514 pcireg_t screg;
516 uint32_t reg; 515 uint32_t reg;
517 const pcireg_t enables = PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_IO_ENABLE; 516 const pcireg_t enables = PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_IO_ENABLE;
518 517
519 sc->sc_dev = self; 518 sc->sc_dev = self;
520 sc->sc_pc = pa->pa_pc; 519 sc->sc_pc = pa->pa_pc;
521 sc->sc_pcitag = pa->pa_tag; 520 sc->sc_pcitag = pa->pa_tag;
522 sc->sc_dacw = -1; 521 sc->sc_dacw = -1;
523 sc->sc_mode = WSDISPLAYIO_MODE_EMUL; 522 sc->sc_mode = WSDISPLAYIO_MODE_EMUL;
524 sc->sc_nbus = pa->pa_bus; 523 sc->sc_nbus = pa->pa_bus;
525 sc->sc_ndev = pa->pa_device; 524 sc->sc_ndev = pa->pa_device;
526 sc->sc_nfunc = pa->pa_function; 525 sc->sc_nfunc = pa->pa_function;
527 sc->sc_locked = 0; 526 sc->sc_locked = 0;
528 sc->sc_iot = pa->pa_iot; 527 sc->sc_iot = pa->pa_iot;
529 sc->sc_accessops.ioctl = mach64_ioctl; 528 sc->sc_accessops.ioctl = mach64_ioctl;
530 sc->sc_accessops.mmap = mach64_mmap; 529 sc->sc_accessops.mmap = mach64_mmap;
531 530
532 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 531 pci_aprint_devinfo(pa, "Graphics processor");
533 aprint_normal(": %s (rev. 0x%02x)\n", devinfo,  
534 PCI_REVISION(pa->pa_class)); 
535 aprint_naive(": Graphics processor\n"); 
536#ifdef MACHFB_DEBUG 532#ifdef MACHFB_DEBUG
537 printf(prop_dictionary_externalize(device_properties(self))); 533 printf(prop_dictionary_externalize(device_properties(self)));
538#endif 534#endif
539  535
540 /* enable memory and disable IO access */ 536 /* enable memory and disable IO access */
541 screg = pci_conf_read(sc->sc_pc, sc->sc_pcitag, PCI_COMMAND_STATUS_REG); 537 screg = pci_conf_read(sc->sc_pc, sc->sc_pcitag, PCI_COMMAND_STATUS_REG);
542 if ((screg & enables) != enables) { 538 if ((screg & enables) != enables) {
543 screg |= enables; 539 screg |= enables;
544 pci_conf_write(sc->sc_pc, sc->sc_pcitag, 540 pci_conf_write(sc->sc_pc, sc->sc_pcitag,
545 PCI_COMMAND_STATUS_REG, screg); 541 PCI_COMMAND_STATUS_REG, screg);
546 } 542 }
547 for (bar = 0; bar < NBARS; bar++) { 543 for (bar = 0; bar < NBARS; bar++) {
548 reg = PCI_MAPREG_START + (bar * 4); 544 reg = PCI_MAPREG_START + (bar * 4);

cvs diff -r1.20 -r1.21 src/sys/dev/pci/mpt_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/mpt_pci.c 2009/11/24 15:51:39 1.20
+++ src/sys/dev/pci/mpt_pci.c 2012/01/30 19:41:22 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mpt_pci.c,v 1.20 2009/11/24 15:51:39 njoly Exp $ */ 1/* $NetBSD: mpt_pci.c,v 1.21 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2003 Wasabi Systems, Inc. 4 * Copyright (c) 2003 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -36,27 +36,27 @@ @@ -36,27 +36,27 @@
36 */ 36 */
37 37
38/* 38/*
39 * Additional contributions by Garrett D'Amore on behalf of TELES AG. 39 * Additional contributions by Garrett D'Amore on behalf of TELES AG.
40 */ 40 */
41 41
42/* 42/*
43 * mpt_pci.c: 43 * mpt_pci.c:
44 * 44 *
45 * NetBSD PCI-specific routines for LSI Fusion adapters. 45 * NetBSD PCI-specific routines for LSI Fusion adapters.
46 */ 46 */
47 47
48#include <sys/cdefs.h> 48#include <sys/cdefs.h>
49__KERNEL_RCSID(0, "$NetBSD: mpt_pci.c,v 1.20 2009/11/24 15:51:39 njoly Exp $"); 49__KERNEL_RCSID(0, "$NetBSD: mpt_pci.c,v 1.21 2012/01/30 19:41:22 drochner Exp $");
50 50
51#include <dev/ic/mpt.h> /* pulls in all headers */ 51#include <dev/ic/mpt.h> /* pulls in all headers */
52 52
53#include <dev/pci/pcireg.h> 53#include <dev/pci/pcireg.h>
54#include <dev/pci/pcivar.h> 54#include <dev/pci/pcivar.h>
55#include <dev/pci/pcidevs.h> 55#include <dev/pci/pcidevs.h>
56 56
57#define MPT_PCI_MMBA (PCI_MAPREG_START+0x04) 57#define MPT_PCI_MMBA (PCI_MAPREG_START+0x04)
58 58
59struct mpt_pci_softc { 59struct mpt_pci_softc {
60 mpt_softc_t sc_mpt; 60 mpt_softc_t sc_mpt;
61 61
62 pci_chipset_tag_t sc_pc; 62 pci_chipset_tag_t sc_pc;
@@ -124,32 +124,28 @@ mpt_pci_match(device_t parent, cfdata_t  @@ -124,32 +124,28 @@ mpt_pci_match(device_t parent, cfdata_t
124 124
125static void 125static void
126mpt_pci_attach(device_t parent, device_t self, void *aux) 126mpt_pci_attach(device_t parent, device_t self, void *aux)
127{ 127{
128 struct mpt_pci_softc *psc = device_private(self); 128 struct mpt_pci_softc *psc = device_private(self);
129 mpt_softc_t *mpt = &psc->sc_mpt; 129 mpt_softc_t *mpt = &psc->sc_mpt;
130 struct pci_attach_args *pa = aux; 130 struct pci_attach_args *pa = aux;
131 pci_intr_handle_t ih; 131 pci_intr_handle_t ih;
132 const char *intrstr; 132 const char *intrstr;
133 pcireg_t reg, memtype; 133 pcireg_t reg, memtype;
134 bus_space_tag_t memt; 134 bus_space_tag_t memt;
135 bus_space_handle_t memh; 135 bus_space_handle_t memh;
136 int memh_valid; 136 int memh_valid;
137 char devinfo[200]; 
138 137
139 pci_devinfo(pa->pa_id, 0, 0, devinfo, sizeof (devinfo)); 138 pci_aprint_devinfo(pa, NULL);
140 
141 aprint_naive("\n"); 
142 aprint_normal(": %s\n", devinfo); 
143 139
144 psc->sc_pc = pa->pa_pc; 140 psc->sc_pc = pa->pa_pc;
145 psc->sc_tag = pa->pa_tag; 141 psc->sc_tag = pa->pa_tag;
146 142
147 mpt->sc_dmat = pa->pa_dmat; 143 mpt->sc_dmat = pa->pa_dmat;
148 144
149 /* 145 /*
150 * Map the device. 146 * Map the device.
151 */ 147 */
152 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, MPT_PCI_MMBA); 148 memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, MPT_PCI_MMBA);
153 switch (memtype) { 149 switch (memtype) {
154 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT: 150 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
155 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT: 151 case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:

cvs diff -r1.6 -r1.7 src/sys/dev/pci/mvsata_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/mvsata_pci.c 2011/01/31 16:30:48 1.6
+++ src/sys/dev/pci/mvsata_pci.c 2012/01/30 19:41:22 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mvsata_pci.c,v 1.6 2011/01/31 16:30:48 jakllsch Exp $ */ 1/* $NetBSD: mvsata_pci.c,v 1.7 2012/01/30 19:41:22 drochner Exp $ */
2/* 2/*
3 * Copyright (c) 2008 KIYOHARA Takashi 3 * Copyright (c) 2008 KIYOHARA Takashi
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE. 25 * POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: mvsata_pci.c,v 1.6 2011/01/31 16:30:48 jakllsch Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: mvsata_pci.c,v 1.7 2012/01/30 19:41:22 drochner Exp $");
30 30
31#include <sys/param.h> 31#include <sys/param.h>
32#include <sys/bus.h> 32#include <sys/bus.h>
33#include <sys/device.h> 33#include <sys/device.h>
34#include <sys/errno.h> 34#include <sys/errno.h>
35#include <sys/pmf.h> 35#include <sys/pmf.h>
36 36
37#include <dev/pci/pcivar.h> 37#include <dev/pci/pcivar.h>
38#include <dev/pci/pcidevs.h> 38#include <dev/pci/pcidevs.h>
39#include <dev/pci/pciidereg.h> 39#include <dev/pci/pciidereg.h>
40#include <dev/pci/pciidevar.h> 40#include <dev/pci/pciidevar.h>
41 41
42#include <dev/ic/mvsatareg.h> 42#include <dev/ic/mvsatareg.h>
@@ -145,38 +145,35 @@ mvsata_pci_match(device_t parent, struct @@ -145,38 +145,35 @@ mvsata_pci_match(device_t parent, struct
145} 145}
146 146
147static void 147static void
148mvsata_pci_attach(device_t parent, device_t self, void *aux) 148mvsata_pci_attach(device_t parent, device_t self, void *aux)
149{ 149{
150 struct pci_attach_args *pa = aux; 150 struct pci_attach_args *pa = aux;
151 struct mvsata_pci_softc *psc = device_private(self); 151 struct mvsata_pci_softc *psc = device_private(self);
152 struct mvsata_softc *sc = &psc->psc_sc; 152 struct mvsata_softc *sc = &psc->psc_sc;
153 pci_intr_handle_t intrhandle; 153 pci_intr_handle_t intrhandle;
154 pcireg_t csr; 154 pcireg_t csr;
155 bus_size_t size; 155 bus_size_t size;
156 uint32_t reg, mask; 156 uint32_t reg, mask;
157 int read_pre_amps, hc, port, rv, i; 157 int read_pre_amps, hc, port, rv, i;
158 char devinfo[256]; 
159 const char *intrstr; 158 const char *intrstr;
160 159
161 sc->sc_wdcdev.sc_atac.atac_dev = self; 160 sc->sc_wdcdev.sc_atac.atac_dev = self;
162 sc->sc_model = PCI_PRODUCT(pa->pa_id); 161 sc->sc_model = PCI_PRODUCT(pa->pa_id);
163 sc->sc_rev = PCI_REVISION(pa->pa_class); 162 sc->sc_rev = PCI_REVISION(pa->pa_class);
164 sc->sc_dmat = pa->pa_dmat; 163 sc->sc_dmat = pa->pa_dmat;
165 sc->sc_enable_intr = mvsata_pci_enable_intr; 164 sc->sc_enable_intr = mvsata_pci_enable_intr;
166 165
167 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 166 pci_aprint_devinfo(pa, "Marvell Serial-ATA Host Controller");
168 aprint_naive(": Marvell Serial-ATA Host Controller\n"); 
169 aprint_normal(": %s\n", devinfo); 
170  167
171 /* Map I/O register */ 168 /* Map I/O register */
172 if (pci_mapreg_map(pa, PCI_MAPREG_START, 169 if (pci_mapreg_map(pa, PCI_MAPREG_START,
173 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0, 170 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
174 &psc->psc_iot, &psc->psc_ioh, NULL, &size) != 0) { 171 &psc->psc_iot, &psc->psc_ioh, NULL, &size) != 0) {
175 aprint_error_dev(self, "can't map registers\n"); 172 aprint_error_dev(self, "can't map registers\n");
176 return; 173 return;
177 } 174 }
178 psc->psc_pc = pa->pa_pc; 175 psc->psc_pc = pa->pa_pc;
179 psc->psc_tag = pa->pa_tag; 176 psc->psc_tag = pa->pa_tag;
180 177
181 if (bus_space_subregion(psc->psc_iot, psc->psc_ioh, 178 if (bus_space_subregion(psc->psc_iot, psc->psc_ioh,
182 MVSATA_PCI_HCARBITER_SPACE_OFFSET, 179 MVSATA_PCI_HCARBITER_SPACE_OFFSET,

cvs diff -r1.1 -r1.2 src/sys/dev/pci/nca_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/nca_pci.c 2010/04/01 04:04:11 1.1
+++ src/sys/dev/pci/nca_pci.c 2012/01/30 19:41:22 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: nca_pci.c,v 1.1 2010/04/01 04:04:11 jakllsch Exp $ */ 1/* $NetBSD: nca_pci.c,v 1.2 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2010 Jonathan A. Kollasch 4 * Copyright (c) 2010 Jonathan A. Kollasch
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29/* 29/*
30 * PCI attachment for 5380-compatible Domex 536 SCSI controller, 30 * PCI attachment for 5380-compatible Domex 536 SCSI controller,
31 * found on Domex DMX-3191D. 31 * found on Domex DMX-3191D.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: nca_pci.c,v 1.1 2010/04/01 04:04:11 jakllsch Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: nca_pci.c,v 1.2 2012/01/30 19:41:22 drochner Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/buf.h> 41#include <sys/buf.h>
42 42
43#include <sys/bus.h> 43#include <sys/bus.h>
44 44
45#include <dev/pci/pcireg.h> 45#include <dev/pci/pcireg.h>
46#include <dev/pci/pcivar.h> 46#include <dev/pci/pcivar.h>
47#include <dev/pci/pcidevs.h> 47#include <dev/pci/pcidevs.h>
48 48
@@ -64,34 +64,30 @@ nca_pci_match(device_t parent, cfdata_t  @@ -64,34 +64,30 @@ nca_pci_match(device_t parent, cfdata_t
64{ 64{
65 struct pci_attach_args *pa = aux; 65 struct pci_attach_args *pa = aux;
66 if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_DOMEX && 66 if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_DOMEX &&
67 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DOMEX_PCISCSI) 67 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DOMEX_PCISCSI)
68 return 1; 68 return 1;
69 return 0; 69 return 0;
70} 70}
71 71
72static void 72static void
73nca_pci_attach(device_t parent, device_t self, void *aux) 73nca_pci_attach(device_t parent, device_t self, void *aux)
74{ 74{
75 struct ncr5380_softc *sc = device_private(self); 75 struct ncr5380_softc *sc = device_private(self);
76 struct pci_attach_args *pa = aux; 76 struct pci_attach_args *pa = aux;
77 char devinfo[128]; 
78 77
79 sc->sc_dev = self; 78 sc->sc_dev = self;
80 79
81 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 80 pci_aprint_devinfo(pa, "SCSI controller");
82 aprint_naive(": SCSI controller\n"); 
83 aprint_normal(": %s (rev 0x%02x)\n", devinfo, 
84 PCI_REVISION(pa->pa_class)); 
85 81
86 if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_IO, 0, 82 if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_IO, 0,
87 &sc->sc_regt, &sc->sc_regh, NULL, NULL)) { 83 &sc->sc_regt, &sc->sc_regh, NULL, NULL)) {
88 aprint_error_dev(self, "could not map IO space\n"); 84 aprint_error_dev(self, "could not map IO space\n");
89 return; 85 return;
90 } 86 }
91  87
92 /* The Domex 536 seems to be driven by polling, 88 /* The Domex 536 seems to be driven by polling,
93 * don't bother mapping an interrupt handler. 89 * don't bother mapping an interrupt handler.
94 */ 90 */
95  91
96 sc->sc_rev = NCR_VARIANT_CXD1180; 92 sc->sc_rev = NCR_VARIANT_CXD1180;
97 sc->sci_r0 = 0; 93 sc->sci_r0 = 0;

cvs diff -r1.1 -r1.2 src/sys/dev/pci/sisfb.c (expand / switch to unified diff)

--- src/sys/dev/pci/sisfb.c 2011/08/27 13:28:37 1.1
+++ src/sys/dev/pci/sisfb.c 2012/01/30 19:41:23 1.2
@@ -14,27 +14,27 @@ @@ -14,27 +14,27 @@
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */ 17 */
18 18
19/* 19/*
20 * Minimalistic driver for the SIS315 Pro frame buffer found on the 20 * Minimalistic driver for the SIS315 Pro frame buffer found on the
21 * Lemote Fuloong 2F systems. 21 * Lemote Fuloong 2F systems.
22 * Does not support accelaration, mode change, secondary output, or 22 * Does not support accelaration, mode change, secondary output, or
23 * anything fancy. 23 * anything fancy.
24 */ 24 */
25 25
26#include <sys/cdefs.h> 26#include <sys/cdefs.h>
27__KERNEL_RCSID(0, "$NetBSD: sisfb.c,v 1.1 2011/08/27 13:28:37 bouyer Exp $"); 27__KERNEL_RCSID(0, "$NetBSD: sisfb.c,v 1.2 2012/01/30 19:41:23 drochner Exp $");
28 28
29#include <sys/param.h> 29#include <sys/param.h>
30#include <sys/systm.h> 30#include <sys/systm.h>
31#include <sys/device.h> 31#include <sys/device.h>
32#include <sys/bus.h> 32#include <sys/bus.h>
33 33
34#include <uvm/uvm_extern.h> 34#include <uvm/uvm_extern.h>
35 35
36#include <dev/pci/pcireg.h> 36#include <dev/pci/pcireg.h>
37#include <dev/pci/pcivar.h> 37#include <dev/pci/pcivar.h>
38#include <dev/pci/pcidevs.h> 38#include <dev/pci/pcidevs.h>
39#include <dev/pci/pciio.h> 39#include <dev/pci/pciio.h>
40 40
@@ -212,44 +212,42 @@ sisfb_match(device_t parent, cfdata_t ma @@ -212,44 +212,42 @@ sisfb_match(device_t parent, cfdata_t ma
212 return 100; 212 return 100;
213 return (0); 213 return (0);
214} 214}
215 215
216void 216void
217sisfb_attach(device_t parent, device_t self, void *aux) 217sisfb_attach(device_t parent, device_t self, void *aux)
218{ 218{
219 struct sisfb_softc *sc = device_private(self); 219 struct sisfb_softc *sc = device_private(self);
220 struct pci_attach_args *pa = (struct pci_attach_args *)aux; 220 struct pci_attach_args *pa = (struct pci_attach_args *)aux;
221 struct rasops_info *ri; 221 struct rasops_info *ri;
222 struct wsemuldisplaydev_attach_args waa; 222 struct wsemuldisplaydev_attach_args waa;
223 bus_size_t fbsize, mmiosize, iosize; 223 bus_size_t fbsize, mmiosize, iosize;
224 struct sisfb *fb; 224 struct sisfb *fb;
225 char devinfo[256]; 
226 int console; 225 int console;
227 unsigned long defattr; 226 unsigned long defattr;
228 227
229 sc->sc_dev = self; 228 sc->sc_dev = self;
230 console = sisfbcn.vcs.scr_ri.ri_hw != NULL; 229 console = sisfbcn.vcs.scr_ri.ri_hw != NULL;
231 230
232 if (console) 231 if (console)
233 fb = &sisfbcn; 232 fb = &sisfbcn;
234 else { 233 else {
235 fb = &sc->sc_fb_store; 234 fb = &sc->sc_fb_store;
236 } 235 }
237 236
238 sc->sc_fb = fb; 237 sc->sc_fb = fb;
239 fb->sc = sc; 238 fb->sc = sc;
240 239
241 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 240 pci_aprint_devinfo(pa, NULL);
242 aprint_normal(": %s\n", devinfo); 
243 241
244 if (!console) { 242 if (!console) {
245 fb->fbt = pa->pa_memt; 243 fb->fbt = pa->pa_memt;
246 fb->mmiot = pa->pa_memt; 244 fb->mmiot = pa->pa_memt;
247 fb->iot = pa->pa_iot; 245 fb->iot = pa->pa_iot;
248 if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_MEM, 246 if (pci_mapreg_map(pa, PCI_MAPREG_START, PCI_MAPREG_TYPE_MEM,
249 BUS_SPACE_MAP_LINEAR, &fb->fbt, &fb->fbh, NULL, &fbsize) != 0) { 247 BUS_SPACE_MAP_LINEAR, &fb->fbt, &fb->fbh, NULL, &fbsize) != 0) {
250 aprint_error_dev(self, ": can't map frame buffer\n"); 248 aprint_error_dev(self, ": can't map frame buffer\n");
251 return; 249 return;
252 } 250 }
253 251
254 if (pci_mapreg_map(pa, PCI_MAPREG_START + 4, PCI_MAPREG_TYPE_MEM, 252 if (pci_mapreg_map(pa, PCI_MAPREG_START + 4, PCI_MAPREG_TYPE_MEM,
255 0, &fb->mmiot, &fb->mmioh, NULL, &mmiosize) != 0) { 253 0, &fb->mmiot, &fb->mmioh, NULL, &mmiosize) != 0) {

cvs diff -r1.21 -r1.22 src/sys/dev/pci/nfsmb.c (expand / switch to unified diff)

--- src/sys/dev/pci/nfsmb.c 2010/05/08 07:41:44 1.21
+++ src/sys/dev/pci/nfsmb.c 2012/01/30 19:41:22 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: nfsmb.c,v 1.21 2010/05/08 07:41:44 pgoyette Exp $ */ 1/* $NetBSD: nfsmb.c,v 1.22 2012/01/30 19:41:22 drochner Exp $ */
2/* 2/*
3 * Copyright (c) 2007 KIYOHARA Takashi 3 * Copyright (c) 2007 KIYOHARA Takashi
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE. 25 * POSSIBILITY OF SUCH DAMAGE.
26 * 26 *
27 */ 27 */
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: nfsmb.c,v 1.21 2010/05/08 07:41:44 pgoyette Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: nfsmb.c,v 1.22 2012/01/30 19:41:22 drochner Exp $");
30 30
31#include <sys/param.h> 31#include <sys/param.h>
32#include <sys/device.h> 32#include <sys/device.h>
33#include <sys/errno.h> 33#include <sys/errno.h>
34#include <sys/kernel.h> 34#include <sys/kernel.h>
35#include <sys/rwlock.h> 35#include <sys/rwlock.h>
36#include <sys/proc.h> 36#include <sys/proc.h>
37 37
38#include <sys/bus.h> 38#include <sys/bus.h>
39 39
40#include <dev/i2c/i2cvar.h> 40#include <dev/i2c/i2cvar.h>
41 41
42#include <dev/pci/pcivar.h> 42#include <dev/pci/pcivar.h>
@@ -131,32 +131,28 @@ nfsmbc_match(device_t parent, cfdata_t m @@ -131,32 +131,28 @@ nfsmbc_match(device_t parent, cfdata_t m
131 } 131 }
132 132
133 return 0; 133 return 0;
134} 134}
135 135
136static void 136static void
137nfsmbc_attach(device_t parent, device_t self, void *aux) 137nfsmbc_attach(device_t parent, device_t self, void *aux)
138{ 138{
139 struct nfsmbc_softc *sc = device_private(self); 139 struct nfsmbc_softc *sc = device_private(self);
140 struct pci_attach_args *pa = aux; 140 struct pci_attach_args *pa = aux;
141 struct nfsmbc_attach_args nfsmbca; 141 struct nfsmbc_attach_args nfsmbca;
142 pcireg_t reg; 142 pcireg_t reg;
143 int baseregs[2]; 143 int baseregs[2];
144 char devinfo[256]; 
145 144
146 aprint_naive("\n"); 145 pci_aprint_devinfo(pa, NULL);
147 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
148 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
149 PCI_REVISION(pa->pa_class)); 
150 146
151 sc->sc_dev = self; 147 sc->sc_dev = self;
152 sc->sc_pc = pa->pa_pc; 148 sc->sc_pc = pa->pa_pc;
153 sc->sc_tag = pa->pa_tag; 149 sc->sc_tag = pa->pa_tag;
154 sc->sc_pa = pa; 150 sc->sc_pa = pa;
155 sc->sc_iot = pa->pa_iot; 151 sc->sc_iot = pa->pa_iot;
156 152
157 nfsmbca.nfsmb_iot = sc->sc_iot; 153 nfsmbca.nfsmb_iot = sc->sc_iot;
158 154
159 switch (PCI_PRODUCT(pa->pa_id)) { 155 switch (PCI_PRODUCT(pa->pa_id)) {
160 case PCI_PRODUCT_NVIDIA_NFORCE2_SMBUS: 156 case PCI_PRODUCT_NVIDIA_NFORCE2_SMBUS:
161 case PCI_PRODUCT_NVIDIA_NFORCE2_400_SMBUS: 157 case PCI_PRODUCT_NVIDIA_NFORCE2_400_SMBUS:
162 case PCI_PRODUCT_NVIDIA_NFORCE3_SMBUS: 158 case PCI_PRODUCT_NVIDIA_NFORCE3_SMBUS:

cvs diff -r1.47 -r1.48 src/sys/dev/pci/ohci_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/ohci_pci.c 2011/04/04 22:48:15 1.47
+++ src/sys/dev/pci/ohci_pci.c 2012/01/30 19:41:22 1.48
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ohci_pci.c,v 1.47 2011/04/04 22:48:15 dyoung Exp $ */ 1/* $NetBSD: ohci_pci.c,v 1.48 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net) at 8 * by Lennart Augustsson (lennart@augustsson.net) at
9 * Carlstedt Research & Technology. 9 * Carlstedt Research & Technology.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.47 2011/04/04 22:48:15 dyoung Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.48 2012/01/30 19:41:22 drochner Exp $");
35 35
36#include "ehci.h" 36#include "ehci.h"
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/kernel.h> 40#include <sys/kernel.h>
41#include <sys/device.h> 41#include <sys/device.h>
42#include <sys/proc.h> 42#include <sys/proc.h>
43#include <sys/queue.h> 43#include <sys/queue.h>
44 44
45#include <sys/bus.h> 45#include <sys/bus.h>
46 46
47#include <dev/pci/pcivar.h> 47#include <dev/pci/pcivar.h>
@@ -78,37 +78,33 @@ ohci_pci_match(device_t parent, cfdata_t @@ -78,37 +78,33 @@ ohci_pci_match(device_t parent, cfdata_t
78 return 0; 78 return 0;
79} 79}
80 80
81static void 81static void
82ohci_pci_attach(device_t parent, device_t self, void *aux) 82ohci_pci_attach(device_t parent, device_t self, void *aux)
83{ 83{
84 struct ohci_pci_softc *sc = device_private(self); 84 struct ohci_pci_softc *sc = device_private(self);
85 struct pci_attach_args *pa = (struct pci_attach_args *)aux; 85 struct pci_attach_args *pa = (struct pci_attach_args *)aux;
86 pci_chipset_tag_t pc = pa->pa_pc; 86 pci_chipset_tag_t pc = pa->pa_pc;
87 pcitag_t tag = pa->pa_tag; 87 pcitag_t tag = pa->pa_tag;
88 char const *intrstr; 88 char const *intrstr;
89 pci_intr_handle_t ih; 89 pci_intr_handle_t ih;
90 pcireg_t csr; 90 pcireg_t csr;
91 char devinfo[256]; 
92 usbd_status r; 91 usbd_status r;
93 const char *vendor; 92 const char *vendor;
94 93
95 sc->sc.sc_dev = self; 94 sc->sc.sc_dev = self;
96 sc->sc.sc_bus.hci_private = sc; 95 sc->sc.sc_bus.hci_private = sc;
97 96
98 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 97 pci_aprint_devinfo(pa, "USB Controller");
99 aprint_normal(": %s (rev. 0x%02x)\n", 
100 devinfo, PCI_REVISION(pa->pa_class)); 
101 aprint_naive(": USB Controller\n"); 
102 98
103 /* Map I/O registers */ 99 /* Map I/O registers */
104 if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0, 100 if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
105 &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) { 101 &sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
106 sc->sc.sc_size = 0; 102 sc->sc.sc_size = 0;
107 aprint_error_dev(self, "can't map mem space\n"); 103 aprint_error_dev(self, "can't map mem space\n");
108 return; 104 return;
109 } 105 }
110 106
111 /* Disable interrupts, so we don't get any spurious ones. */ 107 /* Disable interrupts, so we don't get any spurious ones. */
112 bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_INTERRUPT_DISABLE, 108 bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_INTERRUPT_DISABLE,
113 OHCI_ALL_INTRS); 109 OHCI_ALL_INTRS);
114 110

cvs diff -r1.203 -r1.204 src/sys/dev/pci/pccbb.c (expand / switch to unified diff)

--- src/sys/dev/pci/pccbb.c 2011/08/01 11:20:26 1.203
+++ src/sys/dev/pci/pccbb.c 2012/01/30 19:41:22 1.204
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pccbb.c,v 1.203 2011/08/01 11:20:26 drochner Exp $ */ 1/* $NetBSD: pccbb.c,v 1.204 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998, 1999 and 2000 4 * Copyright (c) 1998, 1999 and 2000
5 * HAYAKAWA Koichi. All rights reserved. 5 * HAYAKAWA Koichi. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.203 2011/08/01 11:20:26 drochner Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.204 2012/01/30 19:41:22 drochner Exp $");
30 30
31/* 31/*
32#define CBB_DEBUG 32#define CBB_DEBUG
33#define SHOW_REGS 33#define SHOW_REGS
34*/ 34*/
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/errno.h> 39#include <sys/errno.h>
40#include <sys/ioctl.h> 40#include <sys/ioctl.h>
41#include <sys/reboot.h> /* for bootverbose */ 41#include <sys/reboot.h> /* for bootverbose */
42#include <sys/syslog.h> 42#include <sys/syslog.h>
@@ -372,50 +372,44 @@ pccbbchilddet(device_t self, device_t ch @@ -372,50 +372,44 @@ pccbbchilddet(device_t self, device_t ch
372 if (sc->sc_csc == device_private(child)) 372 if (sc->sc_csc == device_private(child))
373 sc->sc_csc = NULL; 373 sc->sc_csc = NULL;
374 splx(s); 374 splx(s);
375} 375}
376 376
377void 377void
378pccbbattach(device_t parent, device_t self, void *aux) 378pccbbattach(device_t parent, device_t self, void *aux)
379{ 379{
380 struct pccbb_softc *sc = device_private(self); 380 struct pccbb_softc *sc = device_private(self);
381 struct pci_attach_args *pa = aux; 381 struct pci_attach_args *pa = aux;
382 pci_chipset_tag_t pc = pa->pa_pc; 382 pci_chipset_tag_t pc = pa->pa_pc;
383 pcireg_t busreg, reg, sock_base; 383 pcireg_t busreg, reg, sock_base;
384 bus_addr_t sockbase; 384 bus_addr_t sockbase;
385 char devinfo[256]; 
386 int flags; 385 int flags;
387 386
388#ifdef __HAVE_PCCBB_ATTACH_HOOK 387#ifdef __HAVE_PCCBB_ATTACH_HOOK
389 pccbb_attach_hook(parent, self, pa); 388 pccbb_attach_hook(parent, self, pa);
390#endif 389#endif
391 390
392 sc->sc_dev = self; 391 sc->sc_dev = self;
393 392
394 mutex_init(&sc->sc_pwr_mtx, MUTEX_DEFAULT, IPL_BIO); 393 mutex_init(&sc->sc_pwr_mtx, MUTEX_DEFAULT, IPL_BIO);
395 cv_init(&sc->sc_pwr_cv, "pccpwr"); 394 cv_init(&sc->sc_pwr_cv, "pccpwr");
396 395
397 callout_init(&sc->sc_insert_ch, 0); 396 callout_init(&sc->sc_insert_ch, 0);
398 callout_setfunc(&sc->sc_insert_ch, pci113x_insert, sc); 397 callout_setfunc(&sc->sc_insert_ch, pci113x_insert, sc);
399 398
400 sc->sc_chipset = cb_chipset(pa->pa_id, &flags); 399 sc->sc_chipset = cb_chipset(pa->pa_id, &flags);
401 400
402 aprint_naive("\n"); 401 pci_aprint_devinfo(pa, NULL);
403 402 DPRINTF(("(chipflags %x)", flags));
404 pci_devinfo(pa->pa_id, 0, 0, devinfo, sizeof(devinfo)); 
405 aprint_normal(": %s (rev. 0x%02x)", devinfo, 
406 PCI_REVISION(pa->pa_class)); 
407 DPRINTF((" (chipflags %x)", flags)); 
408 aprint_normal("\n"); 
409 403
410 TAILQ_INIT(&sc->sc_memwindow); 404 TAILQ_INIT(&sc->sc_memwindow);
411 TAILQ_INIT(&sc->sc_iowindow); 405 TAILQ_INIT(&sc->sc_iowindow);
412 406
413 sc->sc_rbus_iot = rbus_pccbb_parent_io(pa); 407 sc->sc_rbus_iot = rbus_pccbb_parent_io(pa);
414 sc->sc_rbus_memt = rbus_pccbb_parent_mem(pa); 408 sc->sc_rbus_memt = rbus_pccbb_parent_mem(pa);
415 409
416#if 0 410#if 0
417 printf("pa->pa_memt: %08x vs rbus_mem->rb_bt: %08x\n", 411 printf("pa->pa_memt: %08x vs rbus_mem->rb_bt: %08x\n",
418 pa->pa_memt, sc->sc_rbus_memt->rb_bt); 412 pa->pa_memt, sc->sc_rbus_memt->rb_bt);
419#endif 413#endif
420 414
421 sc->sc_flags &= ~CBB_MEMHMAPPED; 415 sc->sc_flags &= ~CBB_MEMHMAPPED;

cvs diff -r1.45 -r1.46 src/sys/dev/pci/pcscp.c (expand / switch to unified diff)

--- src/sys/dev/pci/pcscp.c 2010/11/13 13:52:08 1.45
+++ src/sys/dev/pci/pcscp.c 2012/01/30 19:41:22 1.46
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pcscp.c,v 1.45 2010/11/13 13:52:08 uebayasi Exp $ */ 1/* $NetBSD: pcscp.c,v 1.46 2012/01/30 19:41:22 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center; Izumi Tsutsui. 9 * NASA Ames Research Center; Izumi Tsutsui.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33/* 33/*
34 * pcscp.c: device dependent code for AMD Am53c974 (PCscsi-PCI) 34 * pcscp.c: device dependent code for AMD Am53c974 (PCscsi-PCI)
35 * written by Izumi Tsutsui <tsutsui@NetBSD.org> 35 * written by Izumi Tsutsui <tsutsui@NetBSD.org>
36 * 36 *
37 * Technical manual available at 37 * Technical manual available at
38 * http://www.amd.com/files/connectivitysolutions/networking/archivednetworking/19113.pdf 38 * http://www.amd.com/files/connectivitysolutions/networking/archivednetworking/19113.pdf
39 */ 39 */
40 40
41#include <sys/cdefs.h> 41#include <sys/cdefs.h>
42__KERNEL_RCSID(0, "$NetBSD: pcscp.c,v 1.45 2010/11/13 13:52:08 uebayasi Exp $"); 42__KERNEL_RCSID(0, "$NetBSD: pcscp.c,v 1.46 2012/01/30 19:41:22 drochner Exp $");
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/systm.h> 45#include <sys/systm.h>
46#include <sys/device.h> 46#include <sys/device.h>
47#include <sys/buf.h> 47#include <sys/buf.h>
48 48
49#include <sys/bus.h> 49#include <sys/bus.h>
50#include <sys/intr.h> 50#include <sys/intr.h>
51 51
52#include <dev/scsipi/scsipi_all.h> 52#include <dev/scsipi/scsipi_all.h>
53#include <dev/scsipi/scsi_all.h> 53#include <dev/scsipi/scsi_all.h>
54#include <dev/scsipi/scsiconf.h> 54#include <dev/scsipi/scsiconf.h>
55 55
@@ -151,31 +151,29 @@ pcscp_match(device_t parent, cfdata_t cf @@ -151,31 +151,29 @@ pcscp_match(device_t parent, cfdata_t cf
151static void 151static void
152pcscp_attach(device_t parent, device_t self, void *aux) 152pcscp_attach(device_t parent, device_t self, void *aux)
153{ 153{
154 struct pcscp_softc *esc = device_private(self); 154 struct pcscp_softc *esc = device_private(self);
155 struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x; 155 struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x;
156 struct pci_attach_args *pa = aux; 156 struct pci_attach_args *pa = aux;
157 bus_space_tag_t iot; 157 bus_space_tag_t iot;
158 bus_space_handle_t ioh; 158 bus_space_handle_t ioh;
159 pci_intr_handle_t ih; 159 pci_intr_handle_t ih;
160 const char *intrstr; 160 const char *intrstr;
161 pcireg_t csr; 161 pcireg_t csr;
162 bus_dma_segment_t seg; 162 bus_dma_segment_t seg;
163 int error, rseg; 163 int error, rseg;
164 char devinfo[256]; 
165 164
166 sc->sc_dev = self; 165 sc->sc_dev = self;
167 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 166 pci_aprint_devinfo(pa, NULL);
168 aprint_normal(": %s\n", devinfo); 
169 aprint_normal("%s", device_xname(sc->sc_dev)); 167 aprint_normal("%s", device_xname(sc->sc_dev));
170 168
171 if (pci_mapreg_map(pa, IO_MAP_REG, PCI_MAPREG_TYPE_IO, 0, 169 if (pci_mapreg_map(pa, IO_MAP_REG, PCI_MAPREG_TYPE_IO, 0,
172 &iot, &ioh, NULL, NULL)) { 170 &iot, &ioh, NULL, NULL)) {
173 aprint_error(": unable to map registers\n"); 171 aprint_error(": unable to map registers\n");
174 return; 172 return;
175 } 173 }
176 174
177 sc->sc_glue = &pcscp_glue; 175 sc->sc_glue = &pcscp_glue;
178 176
179 esc->sc_st = iot; 177 esc->sc_st = iot;
180 esc->sc_sh = ioh; 178 esc->sc_sh = ioh;
181 esc->sc_dmat = pa->pa_dmat; 179 esc->sc_dmat = pa->pa_dmat;

cvs diff -r1.38 -r1.39 src/sys/dev/pci/piixpm.c (expand / switch to unified diff)

--- src/sys/dev/pci/piixpm.c 2012/01/07 15:59:46 1.38
+++ src/sys/dev/pci/piixpm.c 2012/01/30 19:41:22 1.39
@@ -1,38 +1,38 @@ @@ -1,38 +1,38 @@
1/* $NetBSD: piixpm.c,v 1.38 2012/01/07 15:59:46 pgoyette Exp $ */ 1/* $NetBSD: piixpm.c,v 1.39 2012/01/30 19:41:22 drochner Exp $ */
2/* $OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $ */ 2/* $OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org> 5 * Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org>
6 * 6 *
7 * Permission to use, copy, modify, and distribute this software for any 7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above 8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies. 9 * copyright notice and this permission notice appear in all copies.
10 * 10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */ 18 */
19 19
20/* 20/*
21 * Intel PIIX and compatible Power Management controller driver. 21 * Intel PIIX and compatible Power Management controller driver.
22 */ 22 */
23 23
24#include <sys/cdefs.h> 24#include <sys/cdefs.h>
25__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.38 2012/01/07 15:59:46 pgoyette Exp $"); 25__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.39 2012/01/30 19:41:22 drochner Exp $");
26 26
27#include <sys/param.h> 27#include <sys/param.h>
28#include <sys/systm.h> 28#include <sys/systm.h>
29#include <sys/device.h> 29#include <sys/device.h>
30#include <sys/kernel.h> 30#include <sys/kernel.h>
31#include <sys/rwlock.h> 31#include <sys/rwlock.h>
32#include <sys/proc.h> 32#include <sys/proc.h>
33 33
34#include <sys/bus.h> 34#include <sys/bus.h>
35 35
36#include <dev/pci/pcidevs.h> 36#include <dev/pci/pcidevs.h>
37#include <dev/pci/pcireg.h> 37#include <dev/pci/pcireg.h>
38#include <dev/pci/pcivar.h> 38#include <dev/pci/pcivar.h>
@@ -148,39 +148,34 @@ piixpm_match(device_t parent, cfdata_t m @@ -148,39 +148,34 @@ piixpm_match(device_t parent, cfdata_t m
148 148
149 return 0; 149 return 0;
150} 150}
151 151
152static void 152static void
153piixpm_attach(device_t parent, device_t self, void *aux) 153piixpm_attach(device_t parent, device_t self, void *aux)
154{ 154{
155 struct piixpm_softc *sc = device_private(self); 155 struct piixpm_softc *sc = device_private(self);
156 struct pci_attach_args *pa = aux; 156 struct pci_attach_args *pa = aux;
157 struct i2cbus_attach_args iba; 157 struct i2cbus_attach_args iba;
158 pcireg_t base, conf; 158 pcireg_t base, conf;
159 pcireg_t pmmisc; 159 pcireg_t pmmisc;
160 pci_intr_handle_t ih; 160 pci_intr_handle_t ih;
161 char devinfo[256]; 
162 const char *intrstr = NULL; 161 const char *intrstr = NULL;
163 162
164 sc->sc_dev = self; 163 sc->sc_dev = self;
165 sc->sc_id = pa->pa_id; 164 sc->sc_id = pa->pa_id;
166 sc->sc_pc = pa->pa_pc; 165 sc->sc_pc = pa->pa_pc;
167 sc->sc_pcitag = pa->pa_tag; 166 sc->sc_pcitag = pa->pa_tag;
168 167
169 aprint_naive("\n"); 168 pci_aprint_devinfo(pa, NULL);
170 
171 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 
172 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
173 PCI_REVISION(pa->pa_class)); 
174 169
175 if (!pmf_device_register(self, piixpm_suspend, piixpm_resume)) 170 if (!pmf_device_register(self, piixpm_suspend, piixpm_resume))
176 aprint_error_dev(self, "couldn't establish power handler\n"); 171 aprint_error_dev(self, "couldn't establish power handler\n");
177 172
178 /* Read configuration */ 173 /* Read configuration */
179 conf = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_HOSTC); 174 conf = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_HOSTC);
180 DPRINTF(("%s: conf 0x%x\n", device_xname(self), conf)); 175 DPRINTF(("%s: conf 0x%x\n", device_xname(self), conf));
181 176
182 if ((PCI_VENDOR(pa->pa_id) != PCI_VENDOR_INTEL) || 177 if ((PCI_VENDOR(pa->pa_id) != PCI_VENDOR_INTEL) ||
183 (PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_INTEL_82371AB_PMC)) 178 (PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_INTEL_82371AB_PMC))
184 goto nopowermanagement; 179 goto nopowermanagement;
185 180
186 /* check whether I/O access to PM regs is enabled */ 181 /* check whether I/O access to PM regs is enabled */

cvs diff -r1.12 -r1.13 src/sys/dev/pci/radeonfbvar.h (expand / switch to unified diff)

--- src/sys/dev/pci/radeonfbvar.h 2011/12/30 14:32:31 1.12
+++ src/sys/dev/pci/radeonfbvar.h 2012/01/30 19:41:23 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: radeonfbvar.h,v 1.12 2011/12/30 14:32:31 macallan Exp $ */ 1/* $NetBSD: radeonfbvar.h,v 1.13 2012/01/30 19:41:23 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Itronix Inc. 4 * Copyright (c) 2006 Itronix Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Garrett D'Amore for Itronix Inc. 7 * Written by Garrett D'Amore for Itronix Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -204,28 +204,26 @@ struct radeonfb_display { @@ -204,28 +204,26 @@ struct radeonfb_display {
204}; 204};
205 205
206struct radeon_tmds_pll { 206struct radeon_tmds_pll {
207 uint32_t rtp_freq; 207 uint32_t rtp_freq;
208 uint32_t rtp_pll; 208 uint32_t rtp_pll;
209}; 209};
210 210
211struct radeonfb_softc { 211struct radeonfb_softc {
212 device_t sc_dev; 212 device_t sc_dev;
213 uint16_t sc_family; 213 uint16_t sc_family;
214 uint16_t sc_flags; 214 uint16_t sc_flags;
215 pcireg_t sc_id; 215 pcireg_t sc_id;
216 216
217 char sc_devinfo[256]; 
218 
219 bus_space_tag_t sc_regt; 217 bus_space_tag_t sc_regt;
220 bus_space_handle_t sc_regh; 218 bus_space_handle_t sc_regh;
221 bus_size_t sc_regsz; 219 bus_size_t sc_regsz;
222 bus_addr_t sc_regaddr; 220 bus_addr_t sc_regaddr;
223 221
224 bus_space_tag_t sc_memt; 222 bus_space_tag_t sc_memt;
225 bus_space_handle_t sc_memh; 223 bus_space_handle_t sc_memh;
226 bus_size_t sc_memsz; 224 bus_size_t sc_memsz;
227 bus_addr_t sc_memaddr; 225 bus_addr_t sc_memaddr;
228 226
229 bus_space_tag_t sc_iot; 227 bus_space_tag_t sc_iot;
230 bus_space_handle_t sc_ioh; 228 bus_space_handle_t sc_ioh;
231 bus_size_t sc_iosz; 229 bus_size_t sc_iosz;

cvs diff -r1.4 -r1.5 src/sys/dev/pci/sdhc_pci.c (expand / switch to unified diff)

--- src/sys/dev/pci/sdhc_pci.c 2011/02/02 04:18:14 1.4
+++ src/sys/dev/pci/sdhc_pci.c 2012/01/30 19:41:23 1.5
@@ -1,34 +1,34 @@ @@ -1,34 +1,34 @@
1/* $NetBSD: sdhc_pci.c,v 1.4 2011/02/02 04:18:14 jakllsch Exp $ */ 1/* $NetBSD: sdhc_pci.c,v 1.5 2012/01/30 19:41:23 drochner Exp $ */
2/* $OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $ */ 2/* $OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> 5 * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
6 * 6 *
7 * Permission to use, copy, modify, and distribute this software for any 7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above 8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies. 9 * copyright notice and this permission notice appear in all copies.
10 * 10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */ 18 */
19 19
20#include <sys/cdefs.h> 20#include <sys/cdefs.h>
21__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.4 2011/02/02 04:18:14 jakllsch Exp $"); 21__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.5 2012/01/30 19:41:23 drochner Exp $");
22 22
23#include <sys/param.h> 23#include <sys/param.h>
24#include <sys/device.h> 24#include <sys/device.h>
25#include <sys/systm.h> 25#include <sys/systm.h>
26#include <sys/malloc.h> 26#include <sys/malloc.h>
27#include <sys/pmf.h> 27#include <sys/pmf.h>
28 28
29#include <dev/pci/pcivar.h> 29#include <dev/pci/pcivar.h>
30#include <dev/pci/pcidevs.h> 30#include <dev/pci/pcidevs.h>
31 31
32#include <dev/sdmmc/sdhcreg.h> 32#include <dev/sdmmc/sdhcreg.h>
33#include <dev/sdmmc/sdhcvar.h> 33#include <dev/sdmmc/sdhcvar.h>
34#include <dev/sdmmc/sdmmcvar.h> 34#include <dev/sdmmc/sdmmcvar.h>
@@ -166,44 +166,40 @@ sdhc_pci_match(device_t parent, cfdata_t @@ -166,44 +166,40 @@ sdhc_pci_match(device_t parent, cfdata_t
166 return 0; 166 return 0;
167} 167}
168 168
169static void 169static void
170sdhc_pci_attach(device_t parent, device_t self, void *aux) 170sdhc_pci_attach(device_t parent, device_t self, void *aux)
171{ 171{
172 struct sdhc_pci_softc *sc = device_private(self); 172 struct sdhc_pci_softc *sc = device_private(self);
173 struct pci_attach_args *pa = (struct pci_attach_args *)aux; 173 struct pci_attach_args *pa = (struct pci_attach_args *)aux;
174 pci_chipset_tag_t pc = pa->pa_pc; 174 pci_chipset_tag_t pc = pa->pa_pc;
175 pcitag_t tag = pa->pa_tag; 175 pcitag_t tag = pa->pa_tag;
176 pci_intr_handle_t ih; 176 pci_intr_handle_t ih;
177 pcireg_t csr; 177 pcireg_t csr;
178 pcireg_t slotinfo; 178 pcireg_t slotinfo;
179 char devinfo[256]; 
180 char const *intrstr; 179 char const *intrstr;
181 int nslots; 180 int nslots;
182 int reg; 181 int reg;
183 int cnt; 182 int cnt;
184 bus_space_tag_t iot; 183 bus_space_tag_t iot;
185 bus_space_handle_t ioh; 184 bus_space_handle_t ioh;
186 bus_size_t size; 185 bus_size_t size;
187 uint32_t flags; 186 uint32_t flags;
188 187
189 sc->sc.sc_dev = self; 188 sc->sc.sc_dev = self;
190 sc->sc.sc_dmat = pa->pa_dmat; 189 sc->sc.sc_dmat = pa->pa_dmat;
191 sc->sc.sc_host = NULL; 190 sc->sc.sc_host = NULL;
192 191
193 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 192 pci_aprint_devinfo(pa, NULL);
194 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 
195 PCI_REVISION(pa->pa_class)); 
196 aprint_naive("\n"); 
197 193
198 /* Some controllers needs special treatment. */ 194 /* Some controllers needs special treatment. */
199 flags = sdhc_pci_lookup_quirk_flags(pa); 195 flags = sdhc_pci_lookup_quirk_flags(pa);
200 if (ISSET(flags, SDHC_PCI_QUIRK_TI_HACK)) 196 if (ISSET(flags, SDHC_PCI_QUIRK_TI_HACK))
201 sdhc_pci_quirk_ti_hack(pa); 197 sdhc_pci_quirk_ti_hack(pa);
202 if (ISSET(flags, SDHC_PCI_QUIRK_FORCE_DMA)) 198 if (ISSET(flags, SDHC_PCI_QUIRK_FORCE_DMA))
203 SET(sc->sc.sc_flags, SDHC_FLAG_FORCE_DMA); 199 SET(sc->sc.sc_flags, SDHC_FLAG_FORCE_DMA);
204 if (ISSET(flags, SDHC_PCI_QUIRK_NO_PWR0)) 200 if (ISSET(flags, SDHC_PCI_QUIRK_NO_PWR0))
205 SET(sc->sc.sc_flags, SDHC_FLAG_NO_PWR0); 201 SET(sc->sc.sc_flags, SDHC_FLAG_NO_PWR0);
206 202
207 /* 203 /*
208 * Map and attach all hosts supported by the host controller. 204 * Map and attach all hosts supported by the host controller.
209 */ 205 */

cvs diff -r1.8 -r1.9 src/sys/dev/pci/voyager.c (expand / switch to unified diff)

--- src/sys/dev/pci/voyager.c 2011/12/13 14:41:55 1.8
+++ src/sys/dev/pci/voyager.c 2012/01/30 19:41:23 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: voyager.c,v 1.8 2011/12/13 14:41:55 macallan Exp $ */ 1/* $NetBSD: voyager.c,v 1.9 2012/01/30 19:41:23 drochner Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2009, 2011 Michael Lorenz 4 * Copyright (c) 2009, 2011 Michael Lorenz
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27  27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: voyager.c,v 1.8 2011/12/13 14:41:55 macallan Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: voyager.c,v 1.9 2012/01/30 19:41:23 drochner Exp $");
30 30
31#include <sys/param.h> 31#include <sys/param.h>
32#include <sys/systm.h> 32#include <sys/systm.h>
33#include <sys/kernel.h> 33#include <sys/kernel.h>
34#include <sys/device.h> 34#include <sys/device.h>
35#include <sys/malloc.h> 35#include <sys/malloc.h>
36#include <sys/lwp.h> 36#include <sys/lwp.h>
37#include <sys/kauth.h> 37#include <sys/kauth.h>
38 38
39#include <dev/pci/pcivar.h> 39#include <dev/pci/pcivar.h>
40#include <dev/pci/pcireg.h> 40#include <dev/pci/pcireg.h>
41#include <dev/pci/pcidevs.h> 41#include <dev/pci/pcidevs.h>
42#include <dev/pci/pciio.h> 42#include <dev/pci/pciio.h>
@@ -139,41 +139,39 @@ voyager_match(device_t parent, cfdata_t  @@ -139,41 +139,39 @@ voyager_match(device_t parent, cfdata_t
139 139
140 /* only chip tested on so far - may need a list */ 140 /* only chip tested on so far - may need a list */
141 if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SILMOTION_SM502) 141 if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SILMOTION_SM502)
142 return 100; 142 return 100;
143 return (0); 143 return (0);
144} 144}
145 145
146static void 146static void
147voyager_attach(device_t parent, device_t self, void *aux) 147voyager_attach(device_t parent, device_t self, void *aux)
148{ 148{
149 struct voyager_softc *sc = device_private(self); 149 struct voyager_softc *sc = device_private(self);
150 struct pci_attach_args *pa = aux; 150 struct pci_attach_args *pa = aux;
151 pci_intr_handle_t ih; 151 pci_intr_handle_t ih;
152 char devinfo[256]; 
153 struct voyager_attach_args vaa; 152 struct voyager_attach_args vaa;
154 struct i2cbus_attach_args iba; 153 struct i2cbus_attach_args iba;
155 uint32_t reg; 154 uint32_t reg;
156 const char *intrstr; 155 const char *intrstr;
157 int i; 156 int i;
158 157
159 sc->sc_pc = pa->pa_pc; 158 sc->sc_pc = pa->pa_pc;
160 sc->sc_pcitag = pa->pa_tag; 159 sc->sc_pcitag = pa->pa_tag;
161 sc->sc_memt = pa->pa_memt; 160 sc->sc_memt = pa->pa_memt;
162 sc->sc_iot = pa->pa_iot; 161 sc->sc_iot = pa->pa_iot;
163 sc->sc_dev = self; 162 sc->sc_dev = self;
164 163
165 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 164 pci_aprint_devinfo(pa, NULL);
166 aprint_normal(": %s\n", devinfo); 
167 165
168 if (pci_mapreg_map(pa, 0x14, PCI_MAPREG_TYPE_MEM, 0, 166 if (pci_mapreg_map(pa, 0x14, PCI_MAPREG_TYPE_MEM, 0,
169 &sc->sc_memt, &sc->sc_regh, &sc->sc_reg, &sc->sc_regsize)) { 167 &sc->sc_memt, &sc->sc_regh, &sc->sc_reg, &sc->sc_regsize)) {
170 aprint_error("%s: failed to map registers.\n", 168 aprint_error("%s: failed to map registers.\n",
171 device_xname(sc->sc_dev)); 169 device_xname(sc->sc_dev));
172 } 170 }
173 171
174 if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_MEM, 172 if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_MEM,
175 BUS_SPACE_MAP_LINEAR, 173 BUS_SPACE_MAP_LINEAR,
176 &sc->sc_memt, &sc->sc_fbh, &sc->sc_fb, &sc->sc_fbsize)) { 174 &sc->sc_memt, &sc->sc_fbh, &sc->sc_fb, &sc->sc_fbsize)) {
177 aprint_error("%s: failed to map the frame buffer.\n", 175 aprint_error("%s: failed to map the frame buffer.\n",
178 device_xname(sc->sc_dev)); 176 device_xname(sc->sc_dev));
179 } 177 }