Deleted Added
full compact
fwohci_pci.c (117732) fwohci_pci.c (118416)
1/*
2 * Copyright (c) 2003 Hidetoshi Shimokawa
3 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
1/*
2 * Copyright (c) 2003 Hidetoshi Shimokawa
3 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 * $FreeBSD: head/sys/dev/firewire/fwohci_pci.c 117732 2003-07-18 14:31:16Z simokawa $
34 * $FreeBSD: head/sys/dev/firewire/fwohci_pci.c 118416 2003-08-04 05:43:02Z simokawa $
35 */
36
37#define BOUNCE_BUFFER_TEST 0
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>
42#include <sys/module.h>

--- 298 unchanged lines hidden (view full) ---

341fwohci_pci_detach(device_t self)
342{
343 fwohci_softc_t *sc = device_get_softc(self);
344 int s;
345
346
347 s = splfw();
348
35 */
36
37#define BOUNCE_BUFFER_TEST 0
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>
42#include <sys/module.h>

--- 298 unchanged lines hidden (view full) ---

341fwohci_pci_detach(device_t self)
342{
343 fwohci_softc_t *sc = device_get_softc(self);
344 int s;
345
346
347 s = splfw();
348
349 fwohci_stop(sc, self);
349 if (sc->bsr)
350 fwohci_stop(sc, self);
351
350 bus_generic_detach(self);
352 bus_generic_detach(self);
353 if (sc->fc.bdev) {
354 device_delete_child(self, sc->fc.bdev);
355 sc->fc.bdev = NULL;
356 }
351
352 /* disable interrupts that might have been switched on */
353 if (sc->bst && sc->bsh)
354 bus_space_write_4(sc->bst, sc->bsh,
355 FWOHCI_INTMASKCLR, OHCI_INT_EN);
356
357 if (sc->irq_res) {
358 int err = bus_teardown_intr(self, sc->irq_res, sc->ih);
359 if (err)
360 /* XXX or should we panic? */
361 device_printf(self, "Could not tear down irq, %d\n",
362 err);
363#if __FreeBSD_version < 500000
364 err = bus_teardown_intr(self, sc->irq_res, sc->ih_cam);
365#endif
366 sc->ih = NULL;
367 }
368
357
358 /* disable interrupts that might have been switched on */
359 if (sc->bst && sc->bsh)
360 bus_space_write_4(sc->bst, sc->bsh,
361 FWOHCI_INTMASKCLR, OHCI_INT_EN);
362
363 if (sc->irq_res) {
364 int err = bus_teardown_intr(self, sc->irq_res, sc->ih);
365 if (err)
366 /* XXX or should we panic? */
367 device_printf(self, "Could not tear down irq, %d\n",
368 err);
369#if __FreeBSD_version < 500000
370 err = bus_teardown_intr(self, sc->irq_res, sc->ih_cam);
371#endif
372 sc->ih = NULL;
373 }
374
369 if (sc->fc.bdev) {
370 device_delete_child(self, sc->fc.bdev);
371 sc->fc.bdev = NULL;
372 }
373
374 if (sc->irq_res) {
375 bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res);
376 sc->irq_res = NULL;
377 }
378
379 if (sc->bsr) {
380 bus_release_resource(self, SYS_RES_MEMORY,PCI_CBMEM,sc->bsr);
381 sc->bsr = NULL;

--- 74 unchanged lines hidden ---
375 if (sc->irq_res) {
376 bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res);
377 sc->irq_res = NULL;
378 }
379
380 if (sc->bsr) {
381 bus_release_resource(self, SYS_RES_MEMORY,PCI_CBMEM,sc->bsr);
382 sc->bsr = NULL;

--- 74 unchanged lines hidden ---