Sun Jul 6 08:01:15 2008 UTC ()
ryo shimizu: gscsehci doesn't work.

Correctly initialize softc. Fix from PR port-i386/39109.


(cegger)
diff -r1.3 -r1.4 src/sys/arch/i386/pci/gcscehci.c

cvs diff -r1.3 -r1.4 src/sys/arch/i386/pci/gcscehci.c (expand / switch to unified diff)

--- src/sys/arch/i386/pci/gcscehci.c 2008/04/28 20:23:25 1.3
+++ src/sys/arch/i386/pci/gcscehci.c 2008/07/06 08:01:15 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gcscehci.c,v 1.3 2008/04/28 20:23:25 martin Exp $ */ 1/* $NetBSD: gcscehci.c,v 1.4 2008/07/06 08:01:15 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002, 2007 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001, 2002, 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 Lennart Augustsson (lennart@augustsson.net) 8 * by Lennart Augustsson (lennart@augustsson.net)
9 * and Jared D. McNeill (jmcneill@invisible.ca) 9 * and Jared D. McNeill (jmcneill@invisible.ca)
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: gcscehci.c,v 1.3 2008/04/28 20:23:25 martin Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: gcscehci.c,v 1.4 2008/07/06 08:01:15 cegger 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/proc.h> 40#include <sys/proc.h>
41#include <sys/queue.h> 41#include <sys/queue.h>
42 42
43#include <machine/bus.h> 43#include <machine/bus.h>
44#include <machine/cpufunc.h> 44#include <machine/cpufunc.h>
45 45
46#include <dev/pci/pcidevs.h> 46#include <dev/pci/pcidevs.h>
47#include <dev/pci/pcivar.h> 47#include <dev/pci/pcivar.h>
@@ -95,27 +95,27 @@ gcscehci_attach(struct device *parent, s @@ -95,27 +95,27 @@ gcscehci_attach(struct device *parent, s
95 pci_chipset_tag_t pc = pa->pa_pc; 95 pci_chipset_tag_t pc = pa->pa_pc;
96 pcitag_t tag = pa->pa_tag; 96 pcitag_t tag = pa->pa_tag;
97 char const *intrstr; 97 char const *intrstr;
98 pci_intr_handle_t ih; 98 pci_intr_handle_t ih;
99 const char *vendor; 99 const char *vendor;
100 const char *devname = device_xname(self); 100 const char *devname = device_xname(self);
101 char devinfo[256]; 101 char devinfo[256];
102 usbd_status r; 102 usbd_status r;
103 bus_addr_t ehcibase; 103 bus_addr_t ehcibase;
104 int ncomp; 104 int ncomp;
105 struct usb_pci *up; 105 struct usb_pci *up;
106 106
107 sc->sc.sc_dev = self; 107 sc->sc.sc_dev = self;
108 sc->sc.sc_bus.hci_private = self; 108 sc->sc.sc_bus.hci_private = sc;
109 109
110 aprint_naive(": USB controller\n"); 110 aprint_naive(": USB controller\n");
111 111
112 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 112 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
113 aprint_normal(": %s (rev. 0x%02x)\n", devinfo, 113 aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
114 PCI_REVISION(pa->pa_class)); 114 PCI_REVISION(pa->pa_class));
115 115
116 /* Map I/O registers */ 116 /* Map I/O registers */
117 ehcibase = rdmsr(GCSCUSB_MSR_EHCB) & 0xffffff00; 117 ehcibase = rdmsr(GCSCUSB_MSR_EHCB) & 0xffffff00;
118 sc->sc.iot = pa->pa_memt; 118 sc->sc.iot = pa->pa_memt;
119 sc->sc.sc_size = 256; 119 sc->sc.sc_size = 256;
120 if (bus_space_map(sc->sc.iot, ehcibase, 256, 0, &sc->sc.ioh)) { 120 if (bus_space_map(sc->sc.iot, ehcibase, 256, 0, &sc->sc.ioh)) {
121 aprint_error("%s: can't map memory space\n", devname); 121 aprint_error("%s: can't map memory space\n", devname);