Deleted Added
full compact
if_dc.c (150174) if_dc.c (150213)
1/*-
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ee.columbia.edu>. 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

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

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
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
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ee.columbia.edu>. 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

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

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
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
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/dc/if_dc.c 150174 2005-09-15 17:51:39Z keramida $");
34__FBSDID("$FreeBSD: head/sys/dev/dc/if_dc.c 150213 2005-09-16 11:11:51Z ru $");
35
36/*
37 * DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143
38 * series chips and several workalikes including the following:
39 *
40 * Macronix 98713/98715/98725/98727/98732 PMAC (www.macronix.com)
41 * Macronix/Lite-On 82c115 PNIC II (www.macronix.com)
42 * Lite-On 82c168/82c169 PNIC (www.litecom.com)

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

2305
2306 /* Hook interrupt last to avoid having to lock softc */
2307 error = bus_setup_intr(dev, sc->dc_irq, INTR_TYPE_NET | INTR_MPSAFE,
2308 dc_intr, sc, &sc->dc_intrhand);
2309
2310 if (error) {
2311 device_printf(dev, "couldn't set up irq\n");
2312 ether_ifdetach(ifp);
35
36/*
37 * DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143
38 * series chips and several workalikes including the following:
39 *
40 * Macronix 98713/98715/98725/98727/98732 PMAC (www.macronix.com)
41 * Macronix/Lite-On 82c115 PNIC II (www.macronix.com)
42 * Lite-On 82c168/82c169 PNIC (www.litecom.com)

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

2305
2306 /* Hook interrupt last to avoid having to lock softc */
2307 error = bus_setup_intr(dev, sc->dc_irq, INTR_TYPE_NET | INTR_MPSAFE,
2308 dc_intr, sc, &sc->dc_intrhand);
2309
2310 if (error) {
2311 device_printf(dev, "couldn't set up irq\n");
2312 ether_ifdetach(ifp);
2313 if_free(ifp);
2314 goto fail;
2315 }
2316
2317fail:
2318 if (error)
2319 dc_detach(dev);
2320 return (error);
2321}

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

2342
2343 /* These should only be active if attach succeeded */
2344 if (device_is_attached(dev)) {
2345 DC_LOCK(sc);
2346 dc_stop(sc);
2347 DC_UNLOCK(sc);
2348 callout_drain(&sc->dc_stat_ch);
2349 ether_ifdetach(ifp);
2313 goto fail;
2314 }
2315
2316fail:
2317 if (error)
2318 dc_detach(dev);
2319 return (error);
2320}

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

2341
2342 /* These should only be active if attach succeeded */
2343 if (device_is_attached(dev)) {
2344 DC_LOCK(sc);
2345 dc_stop(sc);
2346 DC_UNLOCK(sc);
2347 callout_drain(&sc->dc_stat_ch);
2348 ether_ifdetach(ifp);
2350 if_free(ifp);
2351 }
2349 }
2350 if (ifp)
2351 if_free(ifp);
2352 if (sc->dc_miibus)
2353 device_delete_child(dev, sc->dc_miibus);
2354 bus_generic_detach(dev);
2355
2356 if (sc->dc_intrhand)
2357 bus_teardown_intr(dev, sc->dc_irq, sc->dc_intrhand);
2358 if (sc->dc_irq)
2359 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->dc_irq);

--- 1486 unchanged lines hidden ---
2352 if (sc->dc_miibus)
2353 device_delete_child(dev, sc->dc_miibus);
2354 bus_generic_detach(dev);
2355
2356 if (sc->dc_intrhand)
2357 bus_teardown_intr(dev, sc->dc_irq, sc->dc_intrhand);
2358 if (sc->dc_irq)
2359 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->dc_irq);

--- 1486 unchanged lines hidden ---