Deleted Added
full compact
if_iwn.c (190579) if_iwn.c (191746)
1/*-
2 * Copyright (c) 2007
3 * Damien Bergamini <damien.bergamini@free.fr>
4 * Copyright (c) 2008
5 * Benjamin Close <benjsc@FreeBSD.org>
6 * Copyright (c) 2008 Sam Leffler, Errno Consulting
7 *
8 * Permission to use, copy, modify, and distribute this software for any

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

18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 */
20
21/*
22 * Driver for Intel Wireless WiFi Link 4965AGN 802.11 network adapters.
23 */
24
25#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007
3 * Damien Bergamini <damien.bergamini@free.fr>
4 * Copyright (c) 2008
5 * Benjamin Close <benjsc@FreeBSD.org>
6 * Copyright (c) 2008 Sam Leffler, Errno Consulting
7 *
8 * Permission to use, copy, modify, and distribute this software for any

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

18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 */
20
21/*
22 * Driver for Intel Wireless WiFi Link 4965AGN 802.11 network adapters.
23 */
24
25#include <sys/cdefs.h>
26__FBSDID("$FreeBSD: head/sys/dev/iwn/if_iwn.c 190579 2009-03-30 21:53:27Z sam $");
26__FBSDID("$FreeBSD: head/sys/dev/iwn/if_iwn.c 191746 2009-05-02 15:14:18Z thompsa $");
27
28#include <sys/param.h>
29#include <sys/sockio.h>
30#include <sys/sysctl.h>
31#include <sys/mbuf.h>
32#include <sys/kernel.h>
33#include <sys/socket.h>
34#include <sys/systm.h>

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

124static void iwn_timer_timeout(void *);
125static void iwn_calib_reset(struct iwn_softc *);
126void iwn_ampdu_rx_start(struct iwn_softc *, struct iwn_rx_desc *);
127void iwn_rx_intr(struct iwn_softc *, struct iwn_rx_desc *,
128 struct iwn_rx_data *);
129void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *);
130void iwn_tx_intr(struct iwn_softc *, struct iwn_rx_desc *);
131void iwn_cmd_intr(struct iwn_softc *, struct iwn_rx_desc *);
27
28#include <sys/param.h>
29#include <sys/sockio.h>
30#include <sys/sysctl.h>
31#include <sys/mbuf.h>
32#include <sys/kernel.h>
33#include <sys/socket.h>
34#include <sys/systm.h>

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

124static void iwn_timer_timeout(void *);
125static void iwn_calib_reset(struct iwn_softc *);
126void iwn_ampdu_rx_start(struct iwn_softc *, struct iwn_rx_desc *);
127void iwn_rx_intr(struct iwn_softc *, struct iwn_rx_desc *,
128 struct iwn_rx_data *);
129void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *);
130void iwn_tx_intr(struct iwn_softc *, struct iwn_rx_desc *);
131void iwn_cmd_intr(struct iwn_softc *, struct iwn_rx_desc *);
132static void iwn_bmiss(void *, int);
133void iwn_notif_intr(struct iwn_softc *);
134void iwn_intr(void *);
135void iwn_read_eeprom(struct iwn_softc *,
136 uint8_t macaddr[IEEE80211_ADDR_LEN]);
137static void iwn_read_eeprom_channels(struct iwn_softc *);
138void iwn_print_power_group(struct iwn_softc *, int);
139uint8_t iwn_plcp_signal(int);
140int iwn_tx_data(struct iwn_softc *, struct mbuf *,

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

161int iwn_get_noise(const struct iwn_rx_general_stats *);
162int iwn_get_temperature(struct iwn_softc *);
163int iwn_init_sensitivity(struct iwn_softc *);
164void iwn_compute_differential_gain(struct iwn_softc *,
165 const struct iwn_rx_general_stats *);
166void iwn_tune_sensitivity(struct iwn_softc *,
167 const struct iwn_rx_stats *);
168int iwn_send_sensitivity(struct iwn_softc *);
132void iwn_notif_intr(struct iwn_softc *);
133void iwn_intr(void *);
134void iwn_read_eeprom(struct iwn_softc *,
135 uint8_t macaddr[IEEE80211_ADDR_LEN]);
136static void iwn_read_eeprom_channels(struct iwn_softc *);
137void iwn_print_power_group(struct iwn_softc *, int);
138uint8_t iwn_plcp_signal(int);
139int iwn_tx_data(struct iwn_softc *, struct mbuf *,

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

160int iwn_get_noise(const struct iwn_rx_general_stats *);
161int iwn_get_temperature(struct iwn_softc *);
162int iwn_init_sensitivity(struct iwn_softc *);
163void iwn_compute_differential_gain(struct iwn_softc *,
164 const struct iwn_rx_general_stats *);
165void iwn_tune_sensitivity(struct iwn_softc *,
166 const struct iwn_rx_stats *);
167int iwn_send_sensitivity(struct iwn_softc *);
169int iwn_auth(struct iwn_softc *);
170int iwn_run(struct iwn_softc *);
168int iwn_auth(struct iwn_softc *, struct ieee80211vap *);
169int iwn_run(struct iwn_softc *, struct ieee80211vap *);
171int iwn_scan(struct iwn_softc *);
172int iwn_config(struct iwn_softc *);
173void iwn_post_alive(struct iwn_softc *);
174void iwn_stop_master(struct iwn_softc *);
175int iwn_reset(struct iwn_softc *);
176void iwn_hw_config(struct iwn_softc *);
177void iwn_init_locked(struct iwn_softc *);
178void iwn_init(void *);
179void iwn_stop_locked(struct iwn_softc *);
180void iwn_stop(struct iwn_softc *);
181static void iwn_scan_start(struct ieee80211com *);
182static void iwn_scan_end(struct ieee80211com *);
183static void iwn_set_channel(struct ieee80211com *);
184static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned long);
185static void iwn_scan_mindwell(struct ieee80211_scan_state *);
170int iwn_scan(struct iwn_softc *);
171int iwn_config(struct iwn_softc *);
172void iwn_post_alive(struct iwn_softc *);
173void iwn_stop_master(struct iwn_softc *);
174int iwn_reset(struct iwn_softc *);
175void iwn_hw_config(struct iwn_softc *);
176void iwn_init_locked(struct iwn_softc *);
177void iwn_init(void *);
178void iwn_stop_locked(struct iwn_softc *);
179void iwn_stop(struct iwn_softc *);
180static void iwn_scan_start(struct ieee80211com *);
181static void iwn_scan_end(struct ieee80211com *);
182static void iwn_set_channel(struct ieee80211com *);
183static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned long);
184static void iwn_scan_mindwell(struct ieee80211_scan_state *);
186static void iwn_ops(void *, int);
187static int iwn_queue_cmd( struct iwn_softc *, int, int, int);
185static void iwn_hwreset(void *, int);
186static void iwn_radioon(void *, int);
187static void iwn_radiooff(void *, int);
188static void iwn_bpfattach(struct iwn_softc *);
189static void iwn_sysctlattach(struct iwn_softc *);
190
191#define IWN_DEBUG
192#ifdef IWN_DEBUG
193enum {
194 IWN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */
195 IWN_DEBUG_RECV = 0x00000002, /* basic recv operation */

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

208 IWN_DEBUG_ANY = 0xffffffff
209};
210
211#define DPRINTF(sc, m, fmt, ...) do { \
212 if (sc->sc_debug & (m)) \
213 printf(fmt, __VA_ARGS__); \
214} while (0)
215
188static void iwn_bpfattach(struct iwn_softc *);
189static void iwn_sysctlattach(struct iwn_softc *);
190
191#define IWN_DEBUG
192#ifdef IWN_DEBUG
193enum {
194 IWN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */
195 IWN_DEBUG_RECV = 0x00000002, /* basic recv operation */

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

208 IWN_DEBUG_ANY = 0xffffffff
209};
210
211#define DPRINTF(sc, m, fmt, ...) do { \
212 if (sc->sc_debug & (m)) \
213 printf(fmt, __VA_ARGS__); \
214} while (0)
215
216static const char *iwn_ops_str(int);
217static const char *iwn_intr_str(uint8_t);
218#else
219#define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
220#endif
221
222struct iwn_ident {
223 uint16_t vendor;
224 uint16_t device;

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

291 RF_ACTIVE | RF_SHAREABLE);
292 if (sc->irq == NULL) {
293 device_printf(dev, "could not allocate interrupt resource\n");
294 error = ENOMEM;
295 return error;
296 }
297
298 IWN_LOCK_INIT(sc);
216static const char *iwn_intr_str(uint8_t);
217#else
218#define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
219#endif
220
221struct iwn_ident {
222 uint16_t vendor;
223 uint16_t device;

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

290 RF_ACTIVE | RF_SHAREABLE);
291 if (sc->irq == NULL) {
292 device_printf(dev, "could not allocate interrupt resource\n");
293 error = ENOMEM;
294 return error;
295 }
296
297 IWN_LOCK_INIT(sc);
299 IWN_CMD_LOCK_INIT(sc);
300 callout_init_mtx(&sc->sc_timer_to, &sc->sc_mtx, 0);
298 callout_init_mtx(&sc->sc_timer_to, &sc->sc_mtx, 0);
299 TASK_INIT(&sc->sc_reinit_task, 0, iwn_hwreset, sc );
300 TASK_INIT(&sc->sc_radioon_task, 0, iwn_radioon, sc );
301 TASK_INIT(&sc->sc_radiooff_task, 0, iwn_radiooff, sc );
301
302
302 /*
303 * Create the taskqueues used by the driver. Primarily
304 * sc_tq handles most the task
305 */
306 sc->sc_tq = taskqueue_create("iwn_taskq", M_NOWAIT | M_ZERO,
307 taskqueue_thread_enqueue, &sc->sc_tq);
308 taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq",
309 device_get_nameunit(dev));
310
311 TASK_INIT(&sc->sc_ops_task, 0, iwn_ops, sc );
312 TASK_INIT(&sc->sc_bmiss_task, 0, iwn_bmiss, sc);
313
314 /*
315 * Put adapter into a known state.
316 */
317 error = iwn_reset(sc);
318 if (error != 0) {
319 device_printf(dev,
320 "could not reset adapter, error %d\n", error);
321 goto fail;

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

470int
471iwn_cleanup(device_t dev)
472{
473 struct iwn_softc *sc = device_get_softc(dev);
474 struct ifnet *ifp = sc->sc_ifp;
475 struct ieee80211com *ic = ifp->if_l2com;
476 int i;
477
303 /*
304 * Put adapter into a known state.
305 */
306 error = iwn_reset(sc);
307 if (error != 0) {
308 device_printf(dev,
309 "could not reset adapter, error %d\n", error);
310 goto fail;

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

459int
460iwn_cleanup(device_t dev)
461{
462 struct iwn_softc *sc = device_get_softc(dev);
463 struct ifnet *ifp = sc->sc_ifp;
464 struct ieee80211com *ic = ifp->if_l2com;
465 int i;
466
467 ieee80211_draintask(ic, &sc->sc_reinit_task);
468 ieee80211_draintask(ic, &sc->sc_radioon_task);
469 ieee80211_draintask(ic, &sc->sc_radiooff_task);
470
478 if (ifp != NULL) {
479 iwn_stop(sc);
480 callout_drain(&sc->sc_timer_to);
481 bpfdetach(ifp);
482 ieee80211_ifdetach(ic);
483 }
484
485 iwn_unload_firmware(sc);

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

494 bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq);
495 if (sc->irq_rid == 1)
496 pci_release_msi(dev);
497 }
498 if (sc->mem != NULL)
499 bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem);
500 if (ifp != NULL)
501 if_free(ifp);
471 if (ifp != NULL) {
472 iwn_stop(sc);
473 callout_drain(&sc->sc_timer_to);
474 bpfdetach(ifp);
475 ieee80211_ifdetach(ic);
476 }
477
478 iwn_unload_firmware(sc);

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

487 bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq);
488 if (sc->irq_rid == 1)
489 pci_release_msi(dev);
490 }
491 if (sc->mem != NULL)
492 bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem);
493 if (ifp != NULL)
494 if_free(ifp);
502 taskqueue_free(sc->sc_tq);
503 IWN_CMD_LOCK_DESTROY(sc);
504 IWN_LOCK_DESTROY(sc);
505 return 0;
506}
507
508static struct ieee80211vap *
509iwn_vap_create(struct ieee80211com *ic,
510 const char name[IFNAMSIZ], int unit, int opmode, int flags,
511 const uint8_t bssid[IEEE80211_ADDR_LEN],

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

978 struct ieee80211com *ic = vap->iv_ic;
979 struct iwn_softc *sc = ic->ic_ifp->if_softc;
980 int error;
981
982 DPRINTF(sc, IWN_DEBUG_STATE, "%s: %s -> %s\n", __func__,
983 ieee80211_state_name[vap->iv_state],
984 ieee80211_state_name[nstate]);
985
495 IWN_LOCK_DESTROY(sc);
496 return 0;
497}
498
499static struct ieee80211vap *
500iwn_vap_create(struct ieee80211com *ic,
501 const char name[IFNAMSIZ], int unit, int opmode, int flags,
502 const uint8_t bssid[IEEE80211_ADDR_LEN],

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

969 struct ieee80211com *ic = vap->iv_ic;
970 struct iwn_softc *sc = ic->ic_ifp->if_softc;
971 int error;
972
973 DPRINTF(sc, IWN_DEBUG_STATE, "%s: %s -> %s\n", __func__,
974 ieee80211_state_name[vap->iv_state],
975 ieee80211_state_name[nstate]);
976
977 IEEE80211_UNLOCK(ic);
986 IWN_LOCK(sc);
987 callout_stop(&sc->sc_timer_to);
978 IWN_LOCK(sc);
979 callout_stop(&sc->sc_timer_to);
988 IWN_UNLOCK(sc);
989
980
990 /*
991 * Some state transitions require issuing a configure request
992 * to the adapter. This must be done in a blocking context
993 * so we toss control to the task q thread where the state
994 * change will be finished after the command completes.
995 */
996 if (nstate == IEEE80211_S_AUTH && vap->iv_state != IEEE80211_S_AUTH) {
997 /* !AUTH -> AUTH requires adapter config */
981 if (nstate == IEEE80211_S_AUTH && vap->iv_state != IEEE80211_S_AUTH) {
982 /* !AUTH -> AUTH requires adapter config */
998 error = iwn_queue_cmd(sc, IWN_AUTH, arg, IWN_QUEUE_NORMAL);
999 return (error != 0 ? error : EINPROGRESS);
983 error = iwn_auth(sc, vap);
1000 }
1001 if (nstate == IEEE80211_S_RUN && vap->iv_state != IEEE80211_S_RUN) {
1002 /*
1003 * !RUN -> RUN requires setting the association id
1004 * which is done with a firmware cmd. We also defer
1005 * starting the timers until that work is done.
1006 */
984 }
985 if (nstate == IEEE80211_S_RUN && vap->iv_state != IEEE80211_S_RUN) {
986 /*
987 * !RUN -> RUN requires setting the association id
988 * which is done with a firmware cmd. We also defer
989 * starting the timers until that work is done.
990 */
1007 error = iwn_queue_cmd(sc, IWN_RUN, arg, IWN_QUEUE_NORMAL);
1008 return (error != 0 ? error : EINPROGRESS);
991 error = iwn_run(sc, vap);
1009 }
1010 if (nstate == IEEE80211_S_RUN) {
1011 /*
1012 * RUN -> RUN transition; just restart the timers.
1013 */
1014 iwn_calib_reset(sc);
1015 }
992 }
993 if (nstate == IEEE80211_S_RUN) {
994 /*
995 * RUN -> RUN transition; just restart the timers.
996 */
997 iwn_calib_reset(sc);
998 }
999 IWN_UNLOCK(sc);
1000 IEEE80211_LOCK(ic);
1016 return ivp->iv_newstate(vap, nstate, arg);
1017}
1018
1019/*
1020 * Grab exclusive access to NIC memory.
1021 */
1022void
1023iwn_mem_lock(struct iwn_softc *sc)

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

1652 bus_dmamap_unload(ring->data_dmat, data->map);
1653 m_freem(data->m);
1654 data->m = NULL;
1655 }
1656
1657 wakeup(&ring->cmd[desc->idx]);
1658}
1659
1001 return ivp->iv_newstate(vap, nstate, arg);
1002}
1003
1004/*
1005 * Grab exclusive access to NIC memory.
1006 */
1007void
1008iwn_mem_lock(struct iwn_softc *sc)

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

1637 bus_dmamap_unload(ring->data_dmat, data->map);
1638 m_freem(data->m);
1639 data->m = NULL;
1640 }
1641
1642 wakeup(&ring->cmd[desc->idx]);
1643}
1644
1660static void
1661iwn_bmiss(void *arg, int npending)
1662{
1663 struct iwn_softc *sc = arg;
1664 struct ieee80211com *ic = sc->sc_ifp->if_l2com;
1665
1666 ieee80211_beacon_miss(ic);
1667}
1668
1669void
1670iwn_notif_intr(struct iwn_softc *sc)
1671{
1672 struct ifnet *ifp = sc->sc_ifp;
1673 struct ieee80211com *ic = ifp->if_l2com;
1674 struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
1675 uint16_t hw;
1676

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

1721 misses, le32toh(miss->total));
1722 /*
1723 * If more than 5 consecutive beacons are missed,
1724 * reinitialize the sensitivity state machine.
1725 */
1726 if (vap->iv_state == IEEE80211_S_RUN && misses > 5)
1727 (void) iwn_init_sensitivity(sc);
1728 if (misses >= vap->iv_bmissthreshold)
1645void
1646iwn_notif_intr(struct iwn_softc *sc)
1647{
1648 struct ifnet *ifp = sc->sc_ifp;
1649 struct ieee80211com *ic = ifp->if_l2com;
1650 struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
1651 uint16_t hw;
1652

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

1697 misses, le32toh(miss->total));
1698 /*
1699 * If more than 5 consecutive beacons are missed,
1700 * reinitialize the sensitivity state machine.
1701 */
1702 if (vap->iv_state == IEEE80211_S_RUN && misses > 5)
1703 (void) iwn_init_sensitivity(sc);
1704 if (misses >= vap->iv_bmissthreshold)
1729 taskqueue_enqueue(taskqueue_swi,
1730 &sc->sc_bmiss_task);
1705 ieee80211_beacon_miss(ic);
1731 break;
1732 }
1733 case IWN_UC_READY: {
1734 struct iwn_ucode_info *uc =
1735 (struct iwn_ucode_info *)(desc + 1);
1736
1737 /* the microcontroller is ready */
1738 DPRINTF(sc, IWN_DEBUG_RESET,

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

1775 case IWN_STOP_SCAN: {
1776 struct iwn_stop_scan *scan =
1777 (struct iwn_stop_scan *)(desc + 1);
1778
1779 DPRINTF(sc, IWN_DEBUG_STATE,
1780 "scan finished nchan=%d status=%d chan=%d\n",
1781 scan->nchan, scan->status, scan->chan);
1782
1706 break;
1707 }
1708 case IWN_UC_READY: {
1709 struct iwn_ucode_info *uc =
1710 (struct iwn_ucode_info *)(desc + 1);
1711
1712 /* the microcontroller is ready */
1713 DPRINTF(sc, IWN_DEBUG_RESET,

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

1750 case IWN_STOP_SCAN: {
1751 struct iwn_stop_scan *scan =
1752 (struct iwn_stop_scan *)(desc + 1);
1753
1754 DPRINTF(sc, IWN_DEBUG_STATE,
1755 "scan finished nchan=%d status=%d chan=%d\n",
1756 scan->nchan, scan->status, scan->chan);
1757
1783 iwn_queue_cmd(sc, IWN_SCAN_NEXT, 0, IWN_QUEUE_NORMAL);
1758 ieee80211_scan_next(vap);
1784 break;
1785 }
1786 }
1787 sc->rxq.cur = (sc->rxq.cur + 1) % IWN_RX_RING_COUNT;
1788 }
1789
1790 /* tell the firmware what we have processed */
1791 hw = (hw == 0) ? IWN_RX_RING_COUNT - 1 : hw - 1;
1792 IWN_WRITE(sc, IWN_RX_WIDX, hw & ~7);
1793}
1794
1759 break;
1760 }
1761 }
1762 sc->rxq.cur = (sc->rxq.cur + 1) % IWN_RX_RING_COUNT;
1763 }
1764
1765 /* tell the firmware what we have processed */
1766 hw = (hw == 0) ? IWN_RX_RING_COUNT - 1 : hw - 1;
1767 IWN_WRITE(sc, IWN_RX_WIDX, hw & ~7);
1768}
1769
1770static void
1771iwn_rftoggle_intr(struct iwn_softc *sc)
1772{
1773 struct ifnet *ifp = sc->sc_ifp;
1774 struct ieee80211com *ic = ifp->if_l2com;
1775 uint32_t tmp = IWN_READ(sc, IWN_GPIO_CTL);
1776
1777 IWN_LOCK_ASSERT(sc);
1778
1779 device_printf(sc->sc_dev, "RF switch: radio %s\n",
1780 (tmp & IWN_GPIO_RF_ENABLED) ? "enabled" : "disabled");
1781 if (tmp & IWN_GPIO_RF_ENABLED)
1782 ieee80211_runtask(ic, &sc->sc_radioon_task);
1783 else
1784 ieee80211_runtask(ic, &sc->sc_radiooff_task);
1785}
1786
1787static void
1788iwn_error_intr(struct iwn_softc *sc, uint32_t r1, uint32_t r2)
1789{
1790 struct ifnet *ifp = sc->sc_ifp;
1791 struct ieee80211com *ic = ifp->if_l2com;
1792
1793 IWN_LOCK_ASSERT(sc);
1794
1795 device_printf(sc->sc_dev, "error, INTR=%b STATUS=0x%x\n",
1796 r1, IWN_INTR_BITS, r2);
1797 ieee80211_runtask(ic, &sc->sc_reinit_task);
1798}
1799
1795void
1796iwn_intr(void *arg)
1797{
1798 struct iwn_softc *sc = arg;
1799 uint32_t r1, r2;
1800
1801 IWN_LOCK(sc);
1802

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

1815 goto done; /* hardware gone */
1816
1817 /* ack interrupts */
1818 IWN_WRITE(sc, IWN_INTR, r1);
1819 IWN_WRITE(sc, IWN_INTR_STATUS, r2);
1820
1821 DPRINTF(sc, IWN_DEBUG_INTR, "interrupt reg1=%x reg2=%x\n", r1, r2);
1822
1800void
1801iwn_intr(void *arg)
1802{
1803 struct iwn_softc *sc = arg;
1804 uint32_t r1, r2;
1805
1806 IWN_LOCK(sc);
1807

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

1820 goto done; /* hardware gone */
1821
1822 /* ack interrupts */
1823 IWN_WRITE(sc, IWN_INTR, r1);
1824 IWN_WRITE(sc, IWN_INTR_STATUS, r2);
1825
1826 DPRINTF(sc, IWN_DEBUG_INTR, "interrupt reg1=%x reg2=%x\n", r1, r2);
1827
1823 if (r1 & IWN_RF_TOGGLED) {
1824 uint32_t tmp = IWN_READ(sc, IWN_GPIO_CTL);
1825 device_printf(sc->sc_dev, "RF switch: radio %s\n",
1826 (tmp & IWN_GPIO_RF_ENABLED) ? "enabled" : "disabled");
1827 if (tmp & IWN_GPIO_RF_ENABLED)
1828 iwn_queue_cmd(sc, IWN_RADIO_ENABLE, 0, IWN_QUEUE_CLEAR);
1829 else
1830 iwn_queue_cmd(sc, IWN_RADIO_DISABLE, 0, IWN_QUEUE_CLEAR);
1831 }
1828 if (r1 & IWN_RF_TOGGLED)
1829 iwn_rftoggle_intr(sc);
1832 if (r1 & IWN_CT_REACHED)
1833 device_printf(sc->sc_dev, "critical temperature reached!\n");
1834 if (r1 & (IWN_SW_ERROR | IWN_HW_ERROR)) {
1830 if (r1 & IWN_CT_REACHED)
1831 device_printf(sc->sc_dev, "critical temperature reached!\n");
1832 if (r1 & (IWN_SW_ERROR | IWN_HW_ERROR)) {
1835 device_printf(sc->sc_dev, "error, INTR=%b STATUS=0x%x\n",
1836 r1, IWN_INTR_BITS, r2);
1837 iwn_queue_cmd(sc, IWN_REINIT, 0, IWN_QUEUE_CLEAR);
1833 iwn_error_intr(sc, r1, r2);
1838 goto done;
1839 }
1840 if ((r1 & (IWN_RX_INTR | IWN_SW_RX_INTR)) || (r2 & IWN_RX_STATUS_INTR))
1841 iwn_notif_intr(sc);
1842 if (r1 & IWN_ALIVE_INTR)
1843 wakeup(sc);
1844
1845 /* re-enable interrupts */

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

2356 return error;
2357}
2358
2359static void
2360iwn_watchdog(struct iwn_softc *sc)
2361{
2362 if (sc->sc_tx_timer > 0 && --sc->sc_tx_timer == 0) {
2363 struct ifnet *ifp = sc->sc_ifp;
1834 goto done;
1835 }
1836 if ((r1 & (IWN_RX_INTR | IWN_SW_RX_INTR)) || (r2 & IWN_RX_STATUS_INTR))
1837 iwn_notif_intr(sc);
1838 if (r1 & IWN_ALIVE_INTR)
1839 wakeup(sc);
1840
1841 /* re-enable interrupts */

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

2352 return error;
2353}
2354
2355static void
2356iwn_watchdog(struct iwn_softc *sc)
2357{
2358 if (sc->sc_tx_timer > 0 && --sc->sc_tx_timer == 0) {
2359 struct ifnet *ifp = sc->sc_ifp;
2360 struct ieee80211com *ic = ifp->if_l2com;
2364
2365 if_printf(ifp, "device timeout\n");
2361
2362 if_printf(ifp, "device timeout\n");
2366 iwn_queue_cmd(sc, IWN_REINIT, 0, IWN_QUEUE_CLEAR);
2363 ieee80211_runtask(ic, &sc->sc_reinit_task);
2367 }
2368}
2369
2370int
2371iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
2372{
2373 struct iwn_softc *sc = ifp->if_softc;
2374 struct ieee80211com *ic = ifp->if_l2com;

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

3441 "%s: set sensitivity %d/%d/%d/%d/%d/%d/%d\n", __func__,
3442 calib->corr_ofdm_x1, calib->corr_ofdm_mrc_x1, calib->corr_ofdm_x4,
3443 calib->corr_ofdm_mrc_x4, calib->corr_cck_x4,
3444 calib->corr_cck_mrc_x4, calib->energy_cck);
3445 return iwn_cmd(sc, IWN_SENSITIVITY, &cmd, sizeof cmd, 1);
3446}
3447
3448int
2364 }
2365}
2366
2367int
2368iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
2369{
2370 struct iwn_softc *sc = ifp->if_softc;
2371 struct ieee80211com *ic = ifp->if_l2com;

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

3438 "%s: set sensitivity %d/%d/%d/%d/%d/%d/%d\n", __func__,
3439 calib->corr_ofdm_x1, calib->corr_ofdm_mrc_x1, calib->corr_ofdm_x4,
3440 calib->corr_ofdm_mrc_x4, calib->corr_cck_x4,
3441 calib->corr_cck_mrc_x4, calib->energy_cck);
3442 return iwn_cmd(sc, IWN_SENSITIVITY, &cmd, sizeof cmd, 1);
3443}
3444
3445int
3449iwn_auth(struct iwn_softc *sc)
3446iwn_auth(struct iwn_softc *sc, struct ieee80211vap *vap)
3450{
3451 struct ifnet *ifp = sc->sc_ifp;
3452 struct ieee80211com *ic = ifp->if_l2com;
3447{
3448 struct ifnet *ifp = sc->sc_ifp;
3449 struct ieee80211com *ic = ifp->if_l2com;
3453 struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); /*XXX*/
3454 struct ieee80211_node *ni = vap->iv_bss;
3455 struct iwn_node_info node;
3456 int error;
3457
3458 sc->calib.state = IWN_CALIB_STATE_INIT;
3459
3460 /* update adapter's configuration */
3461 sc->config.associd = 0;

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

3534
3535 return 0;
3536}
3537
3538/*
3539 * Configure the adapter for associated state.
3540 */
3541int
3450 struct ieee80211_node *ni = vap->iv_bss;
3451 struct iwn_node_info node;
3452 int error;
3453
3454 sc->calib.state = IWN_CALIB_STATE_INIT;
3455
3456 /* update adapter's configuration */
3457 sc->config.associd = 0;

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

3530
3531 return 0;
3532}
3533
3534/*
3535 * Configure the adapter for associated state.
3536 */
3537int
3542iwn_run(struct iwn_softc *sc)
3538iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap)
3543{
3544#define MS(v,x) (((v) & x) >> x##_S)
3545 struct ifnet *ifp = sc->sc_ifp;
3546 struct ieee80211com *ic = ifp->if_l2com;
3539{
3540#define MS(v,x) (((v) & x) >> x##_S)
3541 struct ifnet *ifp = sc->sc_ifp;
3542 struct ieee80211com *ic = ifp->if_l2com;
3547 struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); /*XXX*/
3548 struct ieee80211_node *ni = vap->iv_bss;
3549 struct iwn_node_info node;
3550 int error, maxrxampdu, ampdudensity;
3551
3552 sc->calib.state = IWN_CALIB_STATE_INIT;
3553
3554 if (ic->ic_opmode == IEEE80211_M_MONITOR) {
3555 /* link LED blinks while monitoring */

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

4265 callout_stop(&sc->sc_timer_to);
4266 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
4267
4268 /* disable interrupts */
4269 IWN_WRITE(sc, IWN_MASK, 0);
4270 IWN_WRITE(sc, IWN_INTR, 0xffffffff);
4271 IWN_WRITE(sc, IWN_INTR_STATUS, 0xffffffff);
4272
3543 struct ieee80211_node *ni = vap->iv_bss;
3544 struct iwn_node_info node;
3545 int error, maxrxampdu, ampdudensity;
3546
3547 sc->calib.state = IWN_CALIB_STATE_INIT;
3548
3549 if (ic->ic_opmode == IEEE80211_M_MONITOR) {
3550 /* link LED blinks while monitoring */

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

4260 callout_stop(&sc->sc_timer_to);
4261 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
4262
4263 /* disable interrupts */
4264 IWN_WRITE(sc, IWN_MASK, 0);
4265 IWN_WRITE(sc, IWN_INTR, 0xffffffff);
4266 IWN_WRITE(sc, IWN_INTR_STATUS, 0xffffffff);
4267
4273 /* Clear any commands left in the taskq command buffer */
4274 memset(sc->sc_cmd, 0, sizeof(sc->sc_cmd));
4275
4276 /* reset all Tx rings */
4277 for (i = 0; i < IWN_NTXQUEUES; i++)
4278 iwn_reset_tx_ring(sc, &sc->txq[i]);
4279
4280 /* reset Rx ring */
4281 iwn_reset_rx_ring(sc, &sc->rxq);
4282
4283 iwn_mem_lock(sc);

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

4303 * Callback from net80211 to start a scan.
4304 */
4305static void
4306iwn_scan_start(struct ieee80211com *ic)
4307{
4308 struct ifnet *ifp = ic->ic_ifp;
4309 struct iwn_softc *sc = ifp->if_softc;
4310
4268 /* reset all Tx rings */
4269 for (i = 0; i < IWN_NTXQUEUES; i++)
4270 iwn_reset_tx_ring(sc, &sc->txq[i]);
4271
4272 /* reset Rx ring */
4273 iwn_reset_rx_ring(sc, &sc->rxq);
4274
4275 iwn_mem_lock(sc);

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

4295 * Callback from net80211 to start a scan.
4296 */
4297static void
4298iwn_scan_start(struct ieee80211com *ic)
4299{
4300 struct ifnet *ifp = ic->ic_ifp;
4301 struct iwn_softc *sc = ifp->if_softc;
4302
4311 iwn_queue_cmd(sc, IWN_SCAN_START, 0, IWN_QUEUE_NORMAL);
4303 IWN_LOCK(sc);
4304 /* make the link LED blink while we're scanning */
4305 iwn_set_led(sc, IWN_LED_LINK, 20, 2);
4306 IWN_UNLOCK(sc);
4312}
4313
4314/*
4315 * Callback from net80211 to terminate a scan.
4316 */
4317static void
4318iwn_scan_end(struct ieee80211com *ic)
4319{
4307}
4308
4309/*
4310 * Callback from net80211 to terminate a scan.
4311 */
4312static void
4313iwn_scan_end(struct ieee80211com *ic)
4314{
4320 struct ifnet *ifp = ic->ic_ifp;
4321 struct iwn_softc *sc = ifp->if_softc;
4322
4323 iwn_queue_cmd(sc, IWN_SCAN_STOP, 0, IWN_QUEUE_NORMAL);
4315 /* ignore */
4324}
4325
4326/*
4327 * Callback from net80211 to force a channel change.
4328 */
4329static void
4330iwn_set_channel(struct ieee80211com *ic)
4331{
4332 struct ifnet *ifp = ic->ic_ifp;
4333 struct iwn_softc *sc = ifp->if_softc;
4316}
4317
4318/*
4319 * Callback from net80211 to force a channel change.
4320 */
4321static void
4322iwn_set_channel(struct ieee80211com *ic)
4323{
4324 struct ifnet *ifp = ic->ic_ifp;
4325 struct iwn_softc *sc = ifp->if_softc;
4326 struct ieee80211vap *vap;
4334 const struct ieee80211_channel *c = ic->ic_curchan;
4327 const struct ieee80211_channel *c = ic->ic_curchan;
4328 int error;
4335
4329
4330 vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */
4331
4332 IWN_LOCK(sc);
4336 if (c != sc->sc_curchan) {
4337 sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq);
4338 sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags);
4339 sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq);
4340 sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags);
4333 if (c != sc->sc_curchan) {
4334 sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq);
4335 sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags);
4336 sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq);
4337 sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags);
4341 iwn_queue_cmd(sc, IWN_SET_CHAN, 0, IWN_QUEUE_NORMAL);
4338
4339 error = iwn_config(sc);
4340 if (error != 0) {
4341 DPRINTF(sc, IWN_DEBUG_STATE,
4342 "%s: set chan failed, cancel scan\n",
4343 __func__);
4344 //XXX Handle failed scan correctly
4345 ieee80211_cancel_scan(vap);
4346 }
4342 }
4347 }
4348 IWN_UNLOCK(sc);
4343}
4344
4345/*
4346 * Callback from net80211 to start scanning of the current channel.
4347 */
4348static void
4349iwn_scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell)
4350{
4351 struct ieee80211vap *vap = ss->ss_vap;
4352 struct iwn_softc *sc = vap->iv_ic->ic_ifp->if_softc;
4349}
4350
4351/*
4352 * Callback from net80211 to start scanning of the current channel.
4353 */
4354static void
4355iwn_scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell)
4356{
4357 struct ieee80211vap *vap = ss->ss_vap;
4358 struct iwn_softc *sc = vap->iv_ic->ic_ifp->if_softc;
4359 int error;
4353
4360
4354 iwn_queue_cmd(sc, IWN_SCAN_CURCHAN, 0, IWN_QUEUE_NORMAL);
4361 IWN_LOCK(sc);
4362 error = iwn_scan(sc);
4363 IWN_UNLOCK(sc);
4364 if (error != 0)
4365 ieee80211_cancel_scan(vap);
4355}
4356
4357/*
4358 * Callback from net80211 to handle the minimum dwell time being met.
4359 * The intent is to terminate the scan but we just let the firmware
4360 * notify us when it's finished as we have no safe way to abort it.
4361 */
4362static void
4363iwn_scan_mindwell(struct ieee80211_scan_state *ss)
4364{
4365 /* NB: don't try to abort scan; wait for firmware to finish */
4366}
4367
4366}
4367
4368/*
4369 * Callback from net80211 to handle the minimum dwell time being met.
4370 * The intent is to terminate the scan but we just let the firmware
4371 * notify us when it's finished as we have no safe way to abort it.
4372 */
4373static void
4374iwn_scan_mindwell(struct ieee80211_scan_state *ss)
4375{
4376 /* NB: don't try to abort scan; wait for firmware to finish */
4377}
4378
4368/*
4369 * Carry out work in the taskq context.
4370 */
4371static void
4379static void
4372iwn_ops(void *arg0, int pending)
4380iwn_hwreset(void *arg0, int pending)
4373{
4374 struct iwn_softc *sc = arg0;
4375 struct ifnet *ifp = sc->sc_ifp;
4376 struct ieee80211com *ic = ifp->if_l2com;
4381{
4382 struct iwn_softc *sc = arg0;
4383 struct ifnet *ifp = sc->sc_ifp;
4384 struct ieee80211com *ic = ifp->if_l2com;
4377 struct ieee80211vap *vap;
4378 int cmd, arg, error;
4379 enum ieee80211_state nstate;
4380
4385
4381 for (;;) {
4382 IWN_CMD_LOCK(sc);
4383 cmd = sc->sc_cmd[sc->sc_cmd_cur];
4384 if (cmd == 0) {
4385 /* No more commands to process */
4386 IWN_CMD_UNLOCK(sc);
4387 return;
4388 }
4389 if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 &&
4390 cmd != IWN_RADIO_ENABLE ) {
4391 IWN_CMD_UNLOCK(sc);
4392 return;
4393 }
4394 arg = sc->sc_cmd_arg[sc->sc_cmd_cur];
4395 sc->sc_cmd[sc->sc_cmd_cur] = 0; /* free the slot */
4396 sc->sc_cmd_cur = (sc->sc_cmd_cur + 1) % IWN_CMD_MAXOPS;
4397 IWN_CMD_UNLOCK(sc);
4386 iwn_init(sc);
4387 ieee80211_notify_radio(ic, 1);
4388}
4398
4389
4399 IWN_LOCK(sc); /* NB: sync debug printfs on smp */
4400 DPRINTF(sc, IWN_DEBUG_OPS, "%s: %s (cmd 0x%x)\n",
4401 __func__, iwn_ops_str(cmd), cmd);
4390static void
4391iwn_radioon(void *arg0, int pending)
4392{
4393 struct iwn_softc *sc = arg0;
4402
4394
4403 vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */
4404 switch (cmd) {
4405 case IWN_SCAN_START:
4406 /* make the link LED blink while we're scanning */
4407 iwn_set_led(sc, IWN_LED_LINK, 20, 2);
4408 break;
4409 case IWN_SCAN_STOP:
4410 break;
4411 case IWN_SCAN_NEXT:
4412 ieee80211_scan_next(vap);
4413 break;
4414 case IWN_SCAN_CURCHAN:
4415 error = iwn_scan(sc);
4416 if (error != 0) {
4417 IWN_UNLOCK(sc);
4418 ieee80211_cancel_scan(vap);
4419 IWN_LOCK(sc);
4420 return;
4421 }
4422 break;
4423 case IWN_SET_CHAN:
4424 error = iwn_config(sc);
4425 if (error != 0) {
4426 DPRINTF(sc, IWN_DEBUG_STATE,
4427 "%s: set chan failed, cancel scan\n",
4428 __func__);
4429 IWN_UNLOCK(sc);
4430 //XXX Handle failed scan correctly
4431 ieee80211_cancel_scan(vap);
4432 return;
4433 }
4434 break;
4435 case IWN_AUTH:
4436 case IWN_RUN:
4437 if (cmd == IWN_AUTH) {
4438 error = iwn_auth(sc);
4439 nstate = IEEE80211_S_AUTH;
4440 } else {
4441 error = iwn_run(sc);
4442 nstate = IEEE80211_S_RUN;
4443 }
4444 if (error == 0) {
4445 IWN_UNLOCK(sc);
4446 IEEE80211_LOCK(ic);
4447 IWN_VAP(vap)->iv_newstate(vap, nstate, arg);
4448 if (vap->iv_newstate_cb != NULL)
4449 vap->iv_newstate_cb(vap, nstate, arg);
4450 IEEE80211_UNLOCK(ic);
4451 IWN_LOCK(sc);
4452 } else {
4453 device_printf(sc->sc_dev,
4454 "%s: %s state change failed, error %d\n",
4455 __func__, ieee80211_state_name[nstate],
4456 error);
4457 }
4458 break;
4459 case IWN_REINIT:
4460 IWN_UNLOCK(sc);
4461 iwn_init(sc);
4462 IWN_LOCK(sc);
4463 ieee80211_notify_radio(ic, 1);
4464 break;
4465 case IWN_RADIO_ENABLE:
4466 KASSERT(sc->fw_fp != NULL,
4467 ("Fware Not Loaded, can't load from tq"));
4468 IWN_UNLOCK(sc);
4469 iwn_init(sc);
4470 IWN_LOCK(sc);
4471 break;
4472 case IWN_RADIO_DISABLE:
4473 ieee80211_notify_radio(ic, 0);
4474 iwn_stop_locked(sc);
4475 break;
4476 }
4477 IWN_UNLOCK(sc);
4478 }
4395 iwn_init(sc);
4479}
4480
4396}
4397
4481/*
4482 * Queue a command for execution in the taskq thread.
4483 * This is needed as the net80211 callbacks do not allow
4484 * sleeping, since we need to sleep to confirm commands have
4485 * been processed by the firmware, we must defer execution to
4486 * a sleep enabled thread.
4487 */
4488static int
4489iwn_queue_cmd(struct iwn_softc *sc, int cmd, int arg, int clear)
4398static void
4399iwn_radiooff(void *arg0, int pending)
4490{
4400{
4491 IWN_CMD_LOCK(sc);
4492 if (clear) {
4493 sc->sc_cmd[0] = cmd;
4494 sc->sc_cmd_arg[0] = arg;
4495 sc->sc_cmd_cur = 0;
4496 sc->sc_cmd_next = 1;
4497 } else {
4498 if (sc->sc_cmd[sc->sc_cmd_next] != 0) {
4499 IWN_CMD_UNLOCK(sc);
4500 DPRINTF(sc, IWN_DEBUG_ANY, "%s: command %d dropped\n",
4501 __func__, cmd);
4502 return EBUSY;
4503 }
4504 sc->sc_cmd[sc->sc_cmd_next] = cmd;
4505 sc->sc_cmd_arg[sc->sc_cmd_next] = arg;
4506 sc->sc_cmd_next = (sc->sc_cmd_next + 1) % IWN_CMD_MAXOPS;
4507 }
4508 taskqueue_enqueue(sc->sc_tq, &sc->sc_ops_task);
4509 IWN_CMD_UNLOCK(sc);
4510 return 0;
4401 struct iwn_softc *sc = arg0;
4402 struct ifnet *ifp = sc->sc_ifp;
4403 struct ieee80211com *ic = ifp->if_l2com;
4404
4405 IWN_LOCK(sc);
4406 ieee80211_notify_radio(ic, 0);
4407 iwn_stop_locked(sc);
4408 IWN_UNLOCK(sc);
4511}
4512
4513static void
4514iwn_bpfattach(struct iwn_softc *sc)
4515{
4516 struct ifnet *ifp = sc->sc_ifp;
4517
4518 bpfattach(ifp, DLT_IEEE802_11_RADIO,

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

4537 sc->sc_debug = 0;
4538 SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
4539 "debug", CTLFLAG_RW, &sc->sc_debug, 0, "control debugging printfs");
4540#endif
4541}
4542
4543#ifdef IWN_DEBUG
4544static const char *
4409}
4410
4411static void
4412iwn_bpfattach(struct iwn_softc *sc)
4413{
4414 struct ifnet *ifp = sc->sc_ifp;
4415
4416 bpfattach(ifp, DLT_IEEE802_11_RADIO,

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

4435 sc->sc_debug = 0;
4436 SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
4437 "debug", CTLFLAG_RW, &sc->sc_debug, 0, "control debugging printfs");
4438#endif
4439}
4440
4441#ifdef IWN_DEBUG
4442static const char *
4545iwn_ops_str(int cmd)
4546{
4547 switch (cmd) {
4548 case IWN_SCAN_START: return "SCAN_START";
4549 case IWN_SCAN_CURCHAN: return "SCAN_CURCHAN";
4550 case IWN_SCAN_STOP: return "SCAN_STOP";
4551 case IWN_SET_CHAN: return "SET_CHAN";
4552 case IWN_AUTH: return "AUTH";
4553 case IWN_SCAN_NEXT: return "SCAN_NEXT";
4554 case IWN_RUN: return "RUN";
4555 case IWN_RADIO_ENABLE: return "RADIO_ENABLE";
4556 case IWN_RADIO_DISABLE: return "RADIO_DISABLE";
4557 case IWN_REINIT: return "REINIT";
4558 }
4559 return "UNKNOWN COMMAND";
4560}
4561
4562static const char *
4563iwn_intr_str(uint8_t cmd)
4564{
4565 switch (cmd) {
4566 /* Notifications */
4567 case IWN_UC_READY: return "UC_READY";
4568 case IWN_ADD_NODE_DONE: return "ADD_NODE_DONE";
4569 case IWN_TX_DONE: return "TX_DONE";
4570 case IWN_START_SCAN: return "START_SCAN";

--- 51 unchanged lines hidden ---
4443iwn_intr_str(uint8_t cmd)
4444{
4445 switch (cmd) {
4446 /* Notifications */
4447 case IWN_UC_READY: return "UC_READY";
4448 case IWN_ADD_NODE_DONE: return "ADD_NODE_DONE";
4449 case IWN_TX_DONE: return "TX_DONE";
4450 case IWN_START_SCAN: return "START_SCAN";

--- 51 unchanged lines hidden ---