if_ipw.c (146849) | if_ipw.c (147256) |
---|---|
1/* $FreeBSD: head/sys/dev/ipw/if_ipw.c 146849 2005-06-01 01:54:00Z avatar $ */ | 1/* $FreeBSD: head/sys/dev/ipw/if_ipw.c 147256 2005-06-10 16:49:24Z brooks $ */ |
2 3/*- 4 * Copyright (c) 2004, 2005 5 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 13 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 2 3/*- 4 * Copyright (c) 2004, 2005 5 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 13 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/ipw/if_ipw.c 146849 2005-06-01 01:54:00Z avatar $"); | 31__FBSDID("$FreeBSD: head/sys/dev/ipw/if_ipw.c 147256 2005-06-10 16:49:24Z brooks $"); |
32 33/*- 34 * Intel(R) PRO/Wireless 2100 MiniPCI driver 35 * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm 36 */ 37 38#include <sys/param.h> 39#include <sys/sysctl.h> --- 169 unchanged lines hidden (view full) --- 209 210/* Base Address Register */ 211#define IPW_PCI_BAR0 0x10 212 213static int 214ipw_attach(device_t dev) 215{ 216 struct ipw_softc *sc = device_get_softc(dev); | 32 33/*- 34 * Intel(R) PRO/Wireless 2100 MiniPCI driver 35 * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm 36 */ 37 38#include <sys/param.h> 39#include <sys/sysctl.h> --- 169 unchanged lines hidden (view full) --- 209 210/* Base Address Register */ 211#define IPW_PCI_BAR0 0x10 212 213static int 214ipw_attach(device_t dev) 215{ 216 struct ipw_softc *sc = device_get_softc(dev); |
217 struct ifnet *ifp = &sc->sc_arp.ac_if; | 217 struct ifnet *ifp; |
218 struct ieee80211com *ic = &sc->sc_ic; 219 uint16_t val; 220 int error, i; 221 222 sc->sc_dev = dev; 223 224 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, 225 MTX_DEF | MTX_RECURSE); --- 32 unchanged lines hidden (view full) --- 258 device_printf(dev, "could not reset adapter\n"); 259 goto fail; 260 } 261 262 if (ipw_dma_alloc(sc) != 0) { 263 device_printf(dev, "could not allocate DMA resources\n"); 264 goto fail; 265 } | 218 struct ieee80211com *ic = &sc->sc_ic; 219 uint16_t val; 220 int error, i; 221 222 sc->sc_dev = dev; 223 224 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, 225 MTX_DEF | MTX_RECURSE); --- 32 unchanged lines hidden (view full) --- 258 device_printf(dev, "could not reset adapter\n"); 259 goto fail; 260 } 261 262 if (ipw_dma_alloc(sc) != 0) { 263 device_printf(dev, "could not allocate DMA resources\n"); 264 goto fail; 265 } |
266 | 266 ifp = sc->sc_ifp = if_alloc(IFT_ETHER); 267 if (ifp == NULL) { 268 device_printf(dev, "can not if_alloc()\n"); 269 goto fail; 270 } |
267 ifp->if_softc = sc; 268 if_initname(ifp, device_get_name(dev), device_get_unit(dev)); 269 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; 270 ifp->if_init = ipw_init; 271 ifp->if_ioctl = ipw_ioctl; 272 ifp->if_start = ipw_start; 273 ifp->if_watchdog = ipw_watchdog; 274 IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); --- 107 unchanged lines hidden (view full) --- 382 383 IPW_LOCK(sc); 384 385 ipw_stop(sc); 386 ipw_free_firmware(sc); 387 388 IPW_UNLOCK(sc); 389 | 271 ifp->if_softc = sc; 272 if_initname(ifp, device_get_name(dev), device_get_unit(dev)); 273 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; 274 ifp->if_init = ipw_init; 275 ifp->if_ioctl = ipw_ioctl; 276 ifp->if_start = ipw_start; 277 ifp->if_watchdog = ipw_watchdog; 278 IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); --- 107 unchanged lines hidden (view full) --- 386 387 IPW_LOCK(sc); 388 389 ipw_stop(sc); 390 ipw_free_firmware(sc); 391 392 IPW_UNLOCK(sc); 393 |
390 bpfdetach(ifp); | 394 if (ifp != NULL) 395 bpfdetach(ifp); |
391 ieee80211_ifdetach(ic); | 396 ieee80211_ifdetach(ic); |
397 if (ifp != NULL) 398 if_free(ifp); |
|
392 393 ipw_release(sc); 394 395 if (sc->irq != NULL) { 396 bus_teardown_intr(dev, sc->irq, sc->sc_ih); 397 bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq); 398 } 399 --- 1803 unchanged lines hidden --- | 399 400 ipw_release(sc); 401 402 if (sc->irq != NULL) { 403 bus_teardown_intr(dev, sc->irq, sc->sc_ih); 404 bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq); 405 } 406 --- 1803 unchanged lines hidden --- |