Deleted Added
sdiff udiff text old ( 266545 ) new ( 266546 )
full compact
1/*-
2 * Copyright (c) 2007-2009 Damien Bergamini <damien.bergamini@free.fr>
3 * Copyright (c) 2008 Benjamin Close <benjsc@FreeBSD.org>
4 * Copyright (c) 2008 Sam Leffler, Errno Consulting
5 * Copyright (c) 2011 Intel Corporation
6 * Copyright (c) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
7 * Copyright (c) 2013 Adrian Chadd <adrian@FreeBSD.org>
8 *

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

20 */
21
22/*
23 * Driver for Intel WiFi Link 4965 and 1000/5000/6000 Series 802.11 network
24 * adapters.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/iwn/if_iwn.c 266545 2014-05-22 15:00:32Z trasz $");
29
30#include "opt_wlan.h"
31#include "opt_iwn.h"
32
33#include <sys/param.h>
34#include <sys/sockio.h>
35#include <sys/sysctl.h>
36#include <sys/mbuf.h>

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

327static void iwn_apm_stop(struct iwn_softc *);
328static int iwn4965_nic_config(struct iwn_softc *);
329static int iwn5000_nic_config(struct iwn_softc *);
330static int iwn_hw_prepare(struct iwn_softc *);
331static int iwn_hw_init(struct iwn_softc *);
332static void iwn_hw_stop(struct iwn_softc *);
333static void iwn_radio_on(void *, int);
334static void iwn_radio_off(void *, int);
335static void iwn_init_locked(struct iwn_softc *);
336static void iwn_init(void *);
337static void iwn_stop_locked(struct iwn_softc *);
338static void iwn_stop(struct iwn_softc *);
339static void iwn_scan_start(struct ieee80211com *);
340static void iwn_scan_end(struct ieee80211com *);
341static void iwn_set_channel(struct ieee80211com *);
342static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned long);

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

666
667 iwn_radiotap_attach(sc);
668
669 callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0);
670 callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0);
671 TASK_INIT(&sc->sc_reinit_task, 0, iwn_hw_reset, sc);
672 TASK_INIT(&sc->sc_radioon_task, 0, iwn_radio_on, sc);
673 TASK_INIT(&sc->sc_radiooff_task, 0, iwn_radio_off, sc);
674
675 iwn_sysctlattach(sc);
676
677 /*
678 * Hook our interrupt after all initialization is complete.
679 */
680 error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
681 NULL, iwn_intr, sc, &sc->sc_ih);
682 if (error != 0) {

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

1329 if (ifp != NULL) {
1330 ic = ifp->if_l2com;
1331
1332 ieee80211_draintask(ic, &sc->sc_reinit_task);
1333 ieee80211_draintask(ic, &sc->sc_radioon_task);
1334 ieee80211_draintask(ic, &sc->sc_radiooff_task);
1335
1336 iwn_stop(sc);
1337 callout_drain(&sc->watchdog_to);
1338 callout_drain(&sc->calib_to);
1339 ieee80211_ifdetach(ic);
1340 }
1341
1342 /* Uninstall interrupt handler. */
1343 if (sc->irq != NULL) {
1344 bus_teardown_intr(dev, sc->irq, sc->sc_ih);

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

3939 if (r1 & (IWN_INT_SW_ERR | IWN_INT_HW_ERR)) {
3940 device_printf(sc->sc_dev, "%s: fatal firmware error\n",
3941 __func__);
3942#ifdef IWN_DEBUG
3943 iwn_debug_register(sc);
3944#endif
3945 /* Dump firmware error log and stop. */
3946 iwn_fatal_intr(sc);
3947 ifp->if_flags &= ~IFF_UP;
3948 iwn_stop_locked(sc);
3949 goto done;
3950 }
3951 if ((r1 & (IWN_INT_FH_RX | IWN_INT_SW_RX | IWN_INT_RX_PERIODIC)) ||
3952 (r2 & IWN_FH_INT_RX)) {
3953 if (sc->sc_flags & IWN_FLAG_USE_ICT) {
3954 if (r1 & (IWN_INT_FH_RX | IWN_INT_SW_RX))
3955 IWN_WRITE(sc, IWN_FH_INT, IWN_FH_INT_RX);
3956 IWN_WRITE_1(sc, IWN_INT_PERIODIC,

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

8407 /* Enable interrupts to get RF toggle notification. */
8408 IWN_LOCK(sc);
8409 IWN_WRITE(sc, IWN_INT, 0xffffffff);
8410 IWN_WRITE(sc, IWN_INT_MASK, sc->int_mask);
8411 IWN_UNLOCK(sc);
8412}
8413
8414static void
8415iwn_init_locked(struct iwn_softc *sc)
8416{
8417 struct ifnet *ifp = sc->sc_ifp;
8418 int error;
8419
8420 DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
8421
8422 IWN_LOCK_ASSERT(sc);

--- 290 unchanged lines hidden ---