if_ep.c (147715) | if_ep.c (147717) |
---|---|
1/*- 2 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 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 --- 15 unchanged lines hidden (view full) --- 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 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 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 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 --- 15 unchanged lines hidden (view full) --- 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 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 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep.c 147715 2005-07-01 04:23:32Z imp $"); | 32__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep.c 147717 2005-07-01 05:31:23Z imp $"); |
33 34/* 35 * Modified from the FreeBSD 1.1.5.1 version by: 36 * Andres Vega Garcia 37 * INRIA - Sophia Antipolis, France 38 * avega@sophia.inria.fr 39 */ 40 --- 242 unchanged lines hidden (view full) --- 283 device_printf(sc->dev, "Unable to get MAC address!\n"); 284 EP_LOCK_DESTORY(sc); 285 return (ENXIO); 286 } 287 } 288 ep_setup_station(sc, sc->eaddr); 289 ifp = sc->ifp = if_alloc(IFT_ETHER); 290 if (ifp == NULL) { | 33 34/* 35 * Modified from the FreeBSD 1.1.5.1 version by: 36 * Andres Vega Garcia 37 * INRIA - Sophia Antipolis, France 38 * avega@sophia.inria.fr 39 */ 40 --- 242 unchanged lines hidden (view full) --- 283 device_printf(sc->dev, "Unable to get MAC address!\n"); 284 EP_LOCK_DESTORY(sc); 285 return (ENXIO); 286 } 287 } 288 ep_setup_station(sc, sc->eaddr); 289 ifp = sc->ifp = if_alloc(IFT_ETHER); 290 if (ifp == NULL) { |
291 device_printf(sc->dev, "can not if_alloc()\n"); | 291 device_printf(sc->dev, "if_alloc() failed\n"); |
292 EP_LOCK_DESTORY(sc); 293 return (ENOSPC); 294 } 295 296 ifp->if_softc = sc; 297 if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); 298 ifp->if_mtu = ETHERMTU; 299 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; --- 45 unchanged lines hidden (view full) --- 345{ 346 struct ep_softc *sc; 347 struct ifnet *ifp; 348 349 sc = device_get_softc(dev); 350 EP_ASSERT_UNLOCKED(sc); 351 ifp = sc->ifp; 352 | 292 EP_LOCK_DESTORY(sc); 293 return (ENOSPC); 294 } 295 296 ifp->if_softc = sc; 297 if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); 298 ifp->if_mtu = ETHERMTU; 299 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; --- 45 unchanged lines hidden (view full) --- 345{ 346 struct ep_softc *sc; 347 struct ifnet *ifp; 348 349 sc = device_get_softc(dev); 350 EP_ASSERT_UNLOCKED(sc); 351 ifp = sc->ifp; 352 |
353 if (sc->gone) { 354 device_printf(dev, "already unloaded\n"); | 353 if (sc->gone) |
355 return (0); | 354 return (0); |
356 } | |
357 if (bus_child_present(dev)) 358 epstop(sc); 359 360 ifp->if_flags &= ~IFF_RUNNING; 361 ether_ifdetach(ifp); 362 if_free(ifp); 363 364 sc->gone = 1; --- 622 unchanged lines hidden --- | 355 if (bus_child_present(dev)) 356 epstop(sc); 357 358 ifp->if_flags &= ~IFF_RUNNING; 359 ether_ifdetach(ifp); 360 if_free(ifp); 361 362 sc->gone = 1; --- 622 unchanged lines hidden --- |