Deleted Added
full compact
fwohci_pci.c (108527) fwohci_pci.c (108530)
1/*
2 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the acknowledgement as bellow:
15 *
16 * This product includes software developed by K. Kobayashi and H. SHimokawa
17 *
18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 *
1/*
2 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the acknowledgement as bellow:
15 *
16 * This product includes software developed by K. Kobayashi and H. SHimokawa
17 *
18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 *
33 * $FreeBSD: head/sys/dev/firewire/fwohci_pci.c 108527 2003-01-01 04:23:54Z simokawa $
33 * $FreeBSD: head/sys/dev/firewire/fwohci_pci.c 108530 2003-01-01 08:25:32Z simokawa $
34 */
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/kernel.h>
39#include <sys/module.h>
40#include <sys/bus.h>
41#include <sys/queue.h>
42#include <machine/bus.h>
43#include <sys/rman.h>
44#include <machine/resource.h>
45
46#include <pci/pcivar.h>
47#include <pci/pcireg.h>
48
49#include <dev/firewire/firewire.h>
50#include <dev/firewire/firewirebusreg.h>
51#include <dev/firewire/firewirereg.h>
52
53#include <dev/firewire/fwohcireg.h>
54#include <dev/firewire/fwohcivar.h>
55
56static int fwohci_pci_attach(device_t self);
57static int fwohci_pci_detach(device_t self);
58
59/*
60 * The probe routine.
61 */
62static int
63fwohci_pci_probe( device_t dev )
64{
65#if 1
66 u_int32_t id;
67
68 id = (pci_get_vendor(dev) << 16) | pci_get_device(dev);
69 if (id == (FW_VENDORID_NEC | FW_DEVICE_UPD861)) {
70 device_set_desc(dev, "NEC uPD72861");
71 return 0;
72 }
73 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB22)) {
74 device_set_desc(dev, "Texas Instruments TSB12LV22");
75 return 0;
76 }
77 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB23)) {
78 device_set_desc(dev, "Texas Instruments TSB12LV23");
79 return 0;
80 }
81 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB26)) {
82 device_set_desc(dev, "Texas Instruments TSB12LV26");
83 return 0;
84 }
85 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB43)) {
86 device_set_desc(dev, "Texas Instruments TSB43AA22");
87 return 0;
88 }
89 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB43A)) {
90 device_set_desc(dev, "Texas Instruments TSB43AB22/A");
91 return 0;
92 }
93 if (id == (FW_VENDORID_TI | FW_DEVICE_TIPCI4450)) {
94 device_set_desc(dev, "Texas Instruments PCI4450");
95 return 0;
96 }
97 if (id == (FW_VENDORID_TI | FW_DEVICE_TIPCI4410A)) {
98 device_set_desc(dev, "Texas Instruments PCI4410A");
99 return 0;
100 }
101 if (id == (FW_VENDORID_SONY | FW_DEVICE_CX3022)) {
102 device_set_desc(dev, "SONY CX3022");
103 return 0;
104 }
105 if (id == (FW_VENDORID_VIA | FW_DEVICE_VT6306)) {
106 device_set_desc(dev, "VIA VT6306");
107 return 0;
108 }
109 if (id == (FW_VENDORID_RICOH | FW_DEVICE_R5C552)) {
110 device_set_desc(dev, "Ricoh R5C552");
111 return 0;
112 }
113 if (id == (FW_VENDORID_APPLE | FW_DEVICE_PANGEA)) {
114 device_set_desc(dev, "Apple Pangea");
115 return 0;
116 }
117 if (id == (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH)) {
118 device_set_desc(dev, "Apple UniNorth");
119 return 0;
120 }
121 if (id == (FW_VENDORID_LUCENT | FW_DEVICE_FW322)) {
122 device_set_desc(dev, "Lucent FW322/323");
123 return 0;
124 }
125#endif
126 if (pci_get_class(dev) == PCIC_SERIALBUS
127 && pci_get_subclass(dev) == PCIS_SERIALBUS_FW
128 && pci_get_progif(dev) == PCI_INTERFACE_OHCI) {
129 device_printf(dev, "vendor=%x, dev=%x\n", pci_get_vendor(dev),
130 pci_get_device(dev));
131 device_set_desc(dev, "1394 Open Host Controller Interface");
132 return 0;
133 }
134
135 return ENXIO;
136}
137
138#if __FreeBSD_version < 500000
139static void
140fwohci_dummy_intr(void *arg)
141{
142 /* XXX do nothing */
143}
144#endif
145
146static int
147fwohci_pci_attach(device_t self)
148{
149 fwohci_softc_t *sc = device_get_softc(self);
150 int err;
151 int rid;
152 int latency, cache_line;
153 u_int16_t cmd;
154#if __FreeBSD_version < 500000
155 int intr;
156 /* For the moment, put in a message stating what is wrong */
157 intr = pci_read_config(self, PCIR_INTLINE, 1);
158 if (intr == 0 || intr == 255) {
159 device_printf(self, "Invalid irq %d\n", intr);
160#ifdef __i386__
161 device_printf(self, "Please switch PNP-OS to 'No' in BIOS\n");
162#endif
163#if 0
164 return ENXIO;
165#endif
166 }
167#endif
168
169 cmd = pci_read_config(self, PCIR_COMMAND, 2);
170 cmd |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN;
171 pci_write_config(self, PCIR_COMMAND, cmd, 2);
172
173 latency = pci_read_config(self, PCIR_LATTIMER, 1);
174#define DEF_LATENCY 250 /* Derived from Max Bulk Transfer size 512 Bytes*/
175 if( latency < DEF_LATENCY ) {
176 latency = DEF_LATENCY;
177 device_printf(self, "PCI bus latency was changing to");
178 pci_write_config(self, PCIR_LATTIMER,latency, 1);
179 } else
180 {
181 device_printf(self, "PCI bus latency is");
182 }
183 printf(" %d.\n", (int) latency);
184 cache_line = pci_read_config(self, PCIR_CACHELNSZ, 1);
185#if 0
186#define DEF_CACHE_LINE 0xc
187 cache_line = DEF_CACHE_LINE;
188 pci_write_config(self, PCIR_CACHELNSZ, cache_line, 1);
189#endif
190 if (bootverbose)
191 device_printf(self, "cache size %d.\n", (int) cache_line);
192/**/
193 rid = PCI_CBMEM;
194 sc->bsr = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,
195 0, ~0, 1, RF_ACTIVE);
196 if (!sc->bsr) {
197 device_printf(self, "Could not map memory\n");
198 return ENXIO;
199 }
200
201 sc->bst = rman_get_bustag(sc->bsr);
202 sc->bsh = rman_get_bushandle(sc->bsr);
203
204 rid = 0;
205 sc->irq_res = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0, 1,
206 RF_SHAREABLE | RF_ACTIVE);
207 if (sc->irq_res == NULL) {
208 device_printf(self, "Could not allocate irq\n");
209 fwohci_pci_detach(self);
210 return ENXIO;
211 }
212
213 sc->fc.bdev = device_add_child(self, "firewire", -1);
214 if (!sc->fc.bdev) {
215 device_printf(self, "Could not add firewire device\n");
216 fwohci_pci_detach(self);
217 return ENOMEM;
218 }
219 device_set_ivars(sc->fc.bdev, sc);
220
221 err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_NET,
222 (driver_intr_t *) fwohci_intr, sc, &sc->ih);
223#if __FreeBSD_version < 500000
224 /* XXX splcam() should mask this irq for sbp.c*/
225 err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_CAM,
226 (driver_intr_t *) fwohci_dummy_intr, sc, &sc->ih_cam);
227#endif
228 if (err) {
229 device_printf(self, "Could not setup irq, %d\n", err);
230 fwohci_pci_detach(self);
231 return ENXIO;
232 }
233
234 err = fwohci_init(sc, self);
235
236 if (!err)
237 err = device_probe_and_attach(sc->fc.bdev);
238
239 if (err) {
240 device_printf(self, "FireWire init failed\n");
241 fwohci_pci_detach(self);
242 return EIO;
243 }
244
245 return 0;
246}
247
248static int
249fwohci_pci_detach(device_t self)
250{
251 fwohci_softc_t *sc = device_get_softc(self);
252 int s;
253
254
255 s = splfw();
34 */
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/kernel.h>
39#include <sys/module.h>
40#include <sys/bus.h>
41#include <sys/queue.h>
42#include <machine/bus.h>
43#include <sys/rman.h>
44#include <machine/resource.h>
45
46#include <pci/pcivar.h>
47#include <pci/pcireg.h>
48
49#include <dev/firewire/firewire.h>
50#include <dev/firewire/firewirebusreg.h>
51#include <dev/firewire/firewirereg.h>
52
53#include <dev/firewire/fwohcireg.h>
54#include <dev/firewire/fwohcivar.h>
55
56static int fwohci_pci_attach(device_t self);
57static int fwohci_pci_detach(device_t self);
58
59/*
60 * The probe routine.
61 */
62static int
63fwohci_pci_probe( device_t dev )
64{
65#if 1
66 u_int32_t id;
67
68 id = (pci_get_vendor(dev) << 16) | pci_get_device(dev);
69 if (id == (FW_VENDORID_NEC | FW_DEVICE_UPD861)) {
70 device_set_desc(dev, "NEC uPD72861");
71 return 0;
72 }
73 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB22)) {
74 device_set_desc(dev, "Texas Instruments TSB12LV22");
75 return 0;
76 }
77 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB23)) {
78 device_set_desc(dev, "Texas Instruments TSB12LV23");
79 return 0;
80 }
81 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB26)) {
82 device_set_desc(dev, "Texas Instruments TSB12LV26");
83 return 0;
84 }
85 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB43)) {
86 device_set_desc(dev, "Texas Instruments TSB43AA22");
87 return 0;
88 }
89 if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB43A)) {
90 device_set_desc(dev, "Texas Instruments TSB43AB22/A");
91 return 0;
92 }
93 if (id == (FW_VENDORID_TI | FW_DEVICE_TIPCI4450)) {
94 device_set_desc(dev, "Texas Instruments PCI4450");
95 return 0;
96 }
97 if (id == (FW_VENDORID_TI | FW_DEVICE_TIPCI4410A)) {
98 device_set_desc(dev, "Texas Instruments PCI4410A");
99 return 0;
100 }
101 if (id == (FW_VENDORID_SONY | FW_DEVICE_CX3022)) {
102 device_set_desc(dev, "SONY CX3022");
103 return 0;
104 }
105 if (id == (FW_VENDORID_VIA | FW_DEVICE_VT6306)) {
106 device_set_desc(dev, "VIA VT6306");
107 return 0;
108 }
109 if (id == (FW_VENDORID_RICOH | FW_DEVICE_R5C552)) {
110 device_set_desc(dev, "Ricoh R5C552");
111 return 0;
112 }
113 if (id == (FW_VENDORID_APPLE | FW_DEVICE_PANGEA)) {
114 device_set_desc(dev, "Apple Pangea");
115 return 0;
116 }
117 if (id == (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH)) {
118 device_set_desc(dev, "Apple UniNorth");
119 return 0;
120 }
121 if (id == (FW_VENDORID_LUCENT | FW_DEVICE_FW322)) {
122 device_set_desc(dev, "Lucent FW322/323");
123 return 0;
124 }
125#endif
126 if (pci_get_class(dev) == PCIC_SERIALBUS
127 && pci_get_subclass(dev) == PCIS_SERIALBUS_FW
128 && pci_get_progif(dev) == PCI_INTERFACE_OHCI) {
129 device_printf(dev, "vendor=%x, dev=%x\n", pci_get_vendor(dev),
130 pci_get_device(dev));
131 device_set_desc(dev, "1394 Open Host Controller Interface");
132 return 0;
133 }
134
135 return ENXIO;
136}
137
138#if __FreeBSD_version < 500000
139static void
140fwohci_dummy_intr(void *arg)
141{
142 /* XXX do nothing */
143}
144#endif
145
146static int
147fwohci_pci_attach(device_t self)
148{
149 fwohci_softc_t *sc = device_get_softc(self);
150 int err;
151 int rid;
152 int latency, cache_line;
153 u_int16_t cmd;
154#if __FreeBSD_version < 500000
155 int intr;
156 /* For the moment, put in a message stating what is wrong */
157 intr = pci_read_config(self, PCIR_INTLINE, 1);
158 if (intr == 0 || intr == 255) {
159 device_printf(self, "Invalid irq %d\n", intr);
160#ifdef __i386__
161 device_printf(self, "Please switch PNP-OS to 'No' in BIOS\n");
162#endif
163#if 0
164 return ENXIO;
165#endif
166 }
167#endif
168
169 cmd = pci_read_config(self, PCIR_COMMAND, 2);
170 cmd |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN;
171 pci_write_config(self, PCIR_COMMAND, cmd, 2);
172
173 latency = pci_read_config(self, PCIR_LATTIMER, 1);
174#define DEF_LATENCY 250 /* Derived from Max Bulk Transfer size 512 Bytes*/
175 if( latency < DEF_LATENCY ) {
176 latency = DEF_LATENCY;
177 device_printf(self, "PCI bus latency was changing to");
178 pci_write_config(self, PCIR_LATTIMER,latency, 1);
179 } else
180 {
181 device_printf(self, "PCI bus latency is");
182 }
183 printf(" %d.\n", (int) latency);
184 cache_line = pci_read_config(self, PCIR_CACHELNSZ, 1);
185#if 0
186#define DEF_CACHE_LINE 0xc
187 cache_line = DEF_CACHE_LINE;
188 pci_write_config(self, PCIR_CACHELNSZ, cache_line, 1);
189#endif
190 if (bootverbose)
191 device_printf(self, "cache size %d.\n", (int) cache_line);
192/**/
193 rid = PCI_CBMEM;
194 sc->bsr = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,
195 0, ~0, 1, RF_ACTIVE);
196 if (!sc->bsr) {
197 device_printf(self, "Could not map memory\n");
198 return ENXIO;
199 }
200
201 sc->bst = rman_get_bustag(sc->bsr);
202 sc->bsh = rman_get_bushandle(sc->bsr);
203
204 rid = 0;
205 sc->irq_res = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0, 1,
206 RF_SHAREABLE | RF_ACTIVE);
207 if (sc->irq_res == NULL) {
208 device_printf(self, "Could not allocate irq\n");
209 fwohci_pci_detach(self);
210 return ENXIO;
211 }
212
213 sc->fc.bdev = device_add_child(self, "firewire", -1);
214 if (!sc->fc.bdev) {
215 device_printf(self, "Could not add firewire device\n");
216 fwohci_pci_detach(self);
217 return ENOMEM;
218 }
219 device_set_ivars(sc->fc.bdev, sc);
220
221 err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_NET,
222 (driver_intr_t *) fwohci_intr, sc, &sc->ih);
223#if __FreeBSD_version < 500000
224 /* XXX splcam() should mask this irq for sbp.c*/
225 err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_CAM,
226 (driver_intr_t *) fwohci_dummy_intr, sc, &sc->ih_cam);
227#endif
228 if (err) {
229 device_printf(self, "Could not setup irq, %d\n", err);
230 fwohci_pci_detach(self);
231 return ENXIO;
232 }
233
234 err = fwohci_init(sc, self);
235
236 if (!err)
237 err = device_probe_and_attach(sc->fc.bdev);
238
239 if (err) {
240 device_printf(self, "FireWire init failed\n");
241 fwohci_pci_detach(self);
242 return EIO;
243 }
244
245 return 0;
246}
247
248static int
249fwohci_pci_detach(device_t self)
250{
251 fwohci_softc_t *sc = device_get_softc(self);
252 int s;
253
254
255 s = splfw();
256
257 fwohci_shutdown(self);
256 bus_generic_detach(self);
257
258 /* disable interrupts that might have been switched on */
259 if (sc->bst && sc->bsh)
260 bus_space_write_4(sc->bst, sc->bsh,
261 FWOHCI_INTMASKCLR, OHCI_INT_EN);
262
263 if (sc->irq_res) {
264 int err = bus_teardown_intr(self, sc->irq_res, sc->ih);
265 if (err)
266 /* XXX or should we panic? */
267 device_printf(self, "Could not tear down irq, %d\n",
268 err);
269#if __FreeBSD_version < 500000
270 err = bus_teardown_intr(self, sc->irq_res, sc->ih_cam);
271#endif
272 sc->ih = NULL;
273 }
274
275 if (sc->fc.bdev) {
276 device_delete_child(self, sc->fc.bdev);
277 sc->fc.bdev = NULL;
278 }
279
280 if (sc->irq_res) {
281 bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res);
282 sc->irq_res = NULL;
283 }
284
285 if (sc->bsr) {
286 bus_release_resource(self, SYS_RES_MEMORY,PCI_CBMEM,sc->bsr);
287 sc->bsr = NULL;
288 sc->bst = 0;
289 sc->bsh = 0;
290 }
291
292 fwohci_detach(sc, self);
293 splx(s);
294
295 return 0;
296}
297
298static int
299fwohci_pci_suspend(device_t dev)
300{
301 device_printf(dev, "fwoch_pci_suspend\n");
302 return 0;
303}
304
305static int
306fwohci_pci_resume(device_t dev)
307{
258 bus_generic_detach(self);
259
260 /* disable interrupts that might have been switched on */
261 if (sc->bst && sc->bsh)
262 bus_space_write_4(sc->bst, sc->bsh,
263 FWOHCI_INTMASKCLR, OHCI_INT_EN);
264
265 if (sc->irq_res) {
266 int err = bus_teardown_intr(self, sc->irq_res, sc->ih);
267 if (err)
268 /* XXX or should we panic? */
269 device_printf(self, "Could not tear down irq, %d\n",
270 err);
271#if __FreeBSD_version < 500000
272 err = bus_teardown_intr(self, sc->irq_res, sc->ih_cam);
273#endif
274 sc->ih = NULL;
275 }
276
277 if (sc->fc.bdev) {
278 device_delete_child(self, sc->fc.bdev);
279 sc->fc.bdev = NULL;
280 }
281
282 if (sc->irq_res) {
283 bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res);
284 sc->irq_res = NULL;
285 }
286
287 if (sc->bsr) {
288 bus_release_resource(self, SYS_RES_MEMORY,PCI_CBMEM,sc->bsr);
289 sc->bsr = NULL;
290 sc->bst = 0;
291 sc->bsh = 0;
292 }
293
294 fwohci_detach(sc, self);
295 splx(s);
296
297 return 0;
298}
299
300static int
301fwohci_pci_suspend(device_t dev)
302{
303 device_printf(dev, "fwoch_pci_suspend\n");
304 return 0;
305}
306
307static int
308fwohci_pci_resume(device_t dev)
309{
310 fwohci_softc_t *sc = device_get_softc(dev);
311
308 device_printf(dev, "fwoch_pci_resume\n");
312 device_printf(dev, "fwoch_pci_resume\n");
313 fwohci_reset(sc, dev);
309 return 0;
310}
311
312static device_method_t fwohci_methods[] = {
313 /* Device interface */
314 DEVMETHOD(device_probe, fwohci_pci_probe),
315 DEVMETHOD(device_attach, fwohci_pci_attach),
316 DEVMETHOD(device_detach, fwohci_pci_detach),
317 DEVMETHOD(device_shutdown, bus_generic_shutdown),
318 DEVMETHOD(device_suspend, fwohci_pci_suspend),
319 DEVMETHOD(device_resume, fwohci_pci_resume),
320
321 /* Bus interface */
322 DEVMETHOD(bus_print_child, bus_generic_print_child),
323
324 { 0, 0 }
325};
326
327static driver_t fwohci_driver = {
328 "fwohci",
329 fwohci_methods,
330 sizeof(fwohci_softc_t),
331};
332
333static devclass_t fwohci_devclass;
334
335DRIVER_MODULE(fwohci, pci, fwohci_driver, fwohci_devclass, 0, 0);
336DRIVER_MODULE(fwohci, cardbus, fwohci_driver, fwohci_devclass, 0, 0);
314 return 0;
315}
316
317static device_method_t fwohci_methods[] = {
318 /* Device interface */
319 DEVMETHOD(device_probe, fwohci_pci_probe),
320 DEVMETHOD(device_attach, fwohci_pci_attach),
321 DEVMETHOD(device_detach, fwohci_pci_detach),
322 DEVMETHOD(device_shutdown, bus_generic_shutdown),
323 DEVMETHOD(device_suspend, fwohci_pci_suspend),
324 DEVMETHOD(device_resume, fwohci_pci_resume),
325
326 /* Bus interface */
327 DEVMETHOD(bus_print_child, bus_generic_print_child),
328
329 { 0, 0 }
330};
331
332static driver_t fwohci_driver = {
333 "fwohci",
334 fwohci_methods,
335 sizeof(fwohci_softc_t),
336};
337
338static devclass_t fwohci_devclass;
339
340DRIVER_MODULE(fwohci, pci, fwohci_driver, fwohci_devclass, 0, 0);
341DRIVER_MODULE(fwohci, cardbus, fwohci_driver, fwohci_devclass, 0, 0);