1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31#ifndef __iwl_dev_h__
32#define __iwl_dev_h__
33
34#include <linux/interrupt.h>
35#include <linux/kernel.h>
36#include <linux/wait.h>
37#include <linux/leds.h>
38#include <linux/slab.h>
39#include <linux/mutex.h>
40
41#include "iwl-fw.h"
42#include "iwl-eeprom-parse.h"
43#include "iwl-csr.h"
44#include "iwl-debug.h"
45#include "iwl-agn-hw.h"
46#include "iwl-op-mode.h"
47#include "iwl-notif-wait.h"
48#include "iwl-trans.h"
49
50#include "led.h"
51#include "power.h"
52#include "rs.h"
53#include "tt.h"
54
55
56#define CT_KILL_THRESHOLD_LEGACY 110
57#define CT_KILL_THRESHOLD 114
58#define CT_KILL_EXIT_THRESHOLD 95
59
60
61
62
63
64
65
66
67
68
69
70#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)
71
72
73
74
75
76
77
78
79
80#define DEFAULT_RTS_THRESHOLD 2347U
81#define MIN_RTS_THRESHOLD 0U
82#define MAX_RTS_THRESHOLD 2347U
83#define MAX_MSDU_SIZE 2304U
84#define MAX_MPDU_SIZE 2346U
85#define DEFAULT_BEACON_INTERVAL 200U
86#define DEFAULT_SHORT_RETRY_LIMIT 7U
87#define DEFAULT_LONG_RETRY_LIMIT 4U
88
89#define IWL_NUM_SCAN_RATES (2)
90
91
92#define IEEE80211_DATA_LEN 2304
93#define IEEE80211_4ADDR_LEN 30
94#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
95#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
96
97#define SUP_RATE_11A_MAX_NUM_CHANNELS 8
98#define SUP_RATE_11B_MAX_NUM_CHANNELS 4
99#define SUP_RATE_11G_MAX_NUM_CHANNELS 12
100
101#define IWL_SUPPORTED_RATES_IE_LEN 8
102
103#define IWL_INVALID_RATE 0xFF
104#define IWL_INVALID_VALUE -1
105
106union iwl_ht_rate_supp {
107 u16 rates;
108 struct {
109 u8 siso_rate;
110 u8 mimo_rate;
111 };
112};
113
114struct iwl_ht_config {
115 bool single_chain_sufficient;
116 enum ieee80211_smps_mode smps;
117};
118
119
120struct iwl_qos_info {
121 int qos_active;
122 struct iwl_qosparam_cmd def_qos_parm;
123};
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139enum iwl_agg_state {
140 IWL_AGG_OFF = 0,
141 IWL_AGG_STARTING,
142 IWL_AGG_ON,
143 IWL_EMPTYING_HW_QUEUE_ADDBA,
144 IWL_EMPTYING_HW_QUEUE_DELBA,
145};
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165struct iwl_ht_agg {
166 u32 rate_n_flags;
167 enum iwl_agg_state state;
168 u16 txq_id;
169 u16 ssn;
170 bool wait_for_ba;
171};
172
173
174
175
176
177
178
179
180
181
182
183struct iwl_tid_data {
184 u16 seq_number;
185 u16 next_reclaimed;
186 struct iwl_ht_agg agg;
187};
188
189
190
191
192
193
194
195struct iwl_station_entry {
196 struct iwl_addsta_cmd sta;
197 u8 used, ctxid;
198 struct iwl_link_quality_cmd *lq;
199};
200
201
202
203
204
205
206
207
208struct iwl_station_priv {
209 struct iwl_rxon_context *ctx;
210 struct iwl_lq_sta lq_sta;
211 atomic_t pending_frames;
212 bool client;
213 bool asleep;
214 u8 max_agg_bufsize;
215 u8 sta_id;
216};
217
218
219
220
221
222
223
224struct iwl_vif_priv {
225 struct iwl_rxon_context *ctx;
226 u8 ibss_bssid_sta_id;
227};
228
229struct iwl_sensitivity_ranges {
230 u16 min_nrg_cck;
231
232 u16 nrg_th_cck;
233 u16 nrg_th_ofdm;
234
235 u16 auto_corr_min_ofdm;
236 u16 auto_corr_min_ofdm_mrc;
237 u16 auto_corr_min_ofdm_x1;
238 u16 auto_corr_min_ofdm_mrc_x1;
239
240 u16 auto_corr_max_ofdm;
241 u16 auto_corr_max_ofdm_mrc;
242 u16 auto_corr_max_ofdm_x1;
243 u16 auto_corr_max_ofdm_mrc_x1;
244
245 u16 auto_corr_max_cck;
246 u16 auto_corr_max_cck_mrc;
247 u16 auto_corr_min_cck;
248 u16 auto_corr_min_cck_mrc;
249
250 u16 barker_corr_th_min;
251 u16 barker_corr_th_min_mrc;
252 u16 nrg_th_cca;
253};
254
255
256#define KELVIN_TO_CELSIUS(x) ((x)-273)
257#define CELSIUS_TO_KELVIN(x) ((x)+273)
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273extern void iwl_update_chain_flags(struct iwl_priv *priv);
274extern const u8 iwl_bcast_addr[ETH_ALEN];
275
276#define IWL_OPERATION_MODE_AUTO 0
277#define IWL_OPERATION_MODE_HT_ONLY 1
278#define IWL_OPERATION_MODE_MIXED 2
279#define IWL_OPERATION_MODE_20MHZ 3
280
281#define TX_POWER_IWL_ILLEGAL_VOLTAGE -10000
282
283
284#define INITIALIZATION_VALUE 0xFFFF
285#define IWL_CAL_NUM_BEACONS 16
286#define MAXIMUM_ALLOWED_PATHLOSS 15
287
288#define CHAIN_NOISE_MAX_DELTA_GAIN_CODE 3
289
290#define MAX_FA_OFDM 50
291#define MIN_FA_OFDM 5
292#define MAX_FA_CCK 50
293#define MIN_FA_CCK 5
294
295#define AUTO_CORR_STEP_OFDM 1
296
297#define AUTO_CORR_STEP_CCK 3
298#define AUTO_CORR_MAX_TH_CCK 160
299
300#define NRG_DIFF 2
301#define NRG_STEP_CCK 2
302#define NRG_MARGIN 8
303#define MAX_NUMBER_CCK_NO_FA 100
304
305#define AUTO_CORR_CCK_MIN_VAL_DEF (125)
306
307#define CHAIN_A 0
308#define CHAIN_B 1
309#define CHAIN_C 2
310#define CHAIN_NOISE_DELTA_GAIN_INIT_VAL 4
311#define ALL_BAND_FILTER 0xFF00
312#define IN_BAND_FILTER 0xFF
313#define MIN_AVERAGE_NOISE_MAX_VALUE 0xFFFFFFFF
314
315#define NRG_NUM_PREV_STAT_L 20
316#define NUM_RX_CHAINS 3
317
318enum iwlagn_false_alarm_state {
319 IWL_FA_TOO_MANY = 0,
320 IWL_FA_TOO_FEW = 1,
321 IWL_FA_GOOD_RANGE = 2,
322};
323
324enum iwlagn_chain_noise_state {
325 IWL_CHAIN_NOISE_ALIVE = 0,
326 IWL_CHAIN_NOISE_ACCUMULATE,
327 IWL_CHAIN_NOISE_CALIBRATED,
328 IWL_CHAIN_NOISE_DONE,
329};
330
331
332struct iwl_sensitivity_data {
333 u32 auto_corr_ofdm;
334 u32 auto_corr_ofdm_mrc;
335 u32 auto_corr_ofdm_x1;
336 u32 auto_corr_ofdm_mrc_x1;
337 u32 auto_corr_cck;
338 u32 auto_corr_cck_mrc;
339
340 u32 last_bad_plcp_cnt_ofdm;
341 u32 last_fa_cnt_ofdm;
342 u32 last_bad_plcp_cnt_cck;
343 u32 last_fa_cnt_cck;
344
345 u32 nrg_curr_state;
346 u32 nrg_prev_state;
347 u32 nrg_value[10];
348 u8 nrg_silence_rssi[NRG_NUM_PREV_STAT_L];
349 u32 nrg_silence_ref;
350 u32 nrg_energy_idx;
351 u32 nrg_silence_idx;
352 u32 nrg_th_cck;
353 s32 nrg_auto_corr_silence_diff;
354 u32 num_in_cck_no_fa;
355 u32 nrg_th_ofdm;
356
357 u16 barker_corr_th_min;
358 u16 barker_corr_th_min_mrc;
359 u16 nrg_th_cca;
360};
361
362
363struct iwl_chain_noise_data {
364 u32 active_chains;
365 u32 chain_noise_a;
366 u32 chain_noise_b;
367 u32 chain_noise_c;
368 u32 chain_signal_a;
369 u32 chain_signal_b;
370 u32 chain_signal_c;
371 u16 beacon_count;
372 u8 disconn_array[NUM_RX_CHAINS];
373 u8 delta_gain_code[NUM_RX_CHAINS];
374 u8 radio_write;
375 u8 state;
376};
377
378enum {
379 MEASUREMENT_READY = (1 << 0),
380 MEASUREMENT_ACTIVE = (1 << 1),
381};
382
383
384struct reply_tx_error_statistics {
385 u32 pp_delay;
386 u32 pp_few_bytes;
387 u32 pp_bt_prio;
388 u32 pp_quiet_period;
389 u32 pp_calc_ttak;
390 u32 int_crossed_retry;
391 u32 short_limit;
392 u32 long_limit;
393 u32 fifo_underrun;
394 u32 drain_flow;
395 u32 rfkill_flush;
396 u32 life_expire;
397 u32 dest_ps;
398 u32 host_abort;
399 u32 bt_retry;
400 u32 sta_invalid;
401 u32 frag_drop;
402 u32 tid_disable;
403 u32 fifo_flush;
404 u32 insuff_cf_poll;
405 u32 fail_hw_drop;
406 u32 sta_color_mismatch;
407 u32 unknown;
408};
409
410
411struct reply_agg_tx_error_statistics {
412 u32 underrun;
413 u32 bt_prio;
414 u32 few_bytes;
415 u32 abort;
416 u32 last_sent_ttl;
417 u32 last_sent_try;
418 u32 last_sent_bt_kill;
419 u32 scd_query;
420 u32 bad_crc32;
421 u32 response;
422 u32 dump_tx;
423 u32 delay_tx;
424 u32 unknown;
425};
426
427
428
429
430
431#define UCODE_TRACE_PERIOD (10)
432
433
434
435
436
437
438
439
440
441
442
443
444struct iwl_event_log {
445 bool ucode_trace;
446 u32 num_wraps;
447 u32 next_entry;
448 int non_wraps_count;
449 int wraps_once_count;
450 int wraps_more_count;
451};
452
453#define IWL_DELAY_NEXT_FORCE_RF_RESET (HZ*3)
454
455
456#define IWL_BT_ANTENNA_COUPLING_THRESHOLD (35)
457
458
459#define IWL_MIN_RELOAD_DURATION 1000
460#define IWL_MAX_CONTINUE_RELOAD_CNT 4
461
462
463struct iwl_rf_reset {
464 int reset_request_count;
465 int reset_success_count;
466 int reset_reject_count;
467 unsigned long last_reset_jiffies;
468};
469
470enum iwl_rxon_context_id {
471 IWL_RXON_CTX_BSS,
472 IWL_RXON_CTX_PAN,
473
474 NUM_IWL_RXON_CTX
475};
476
477
478
479
480
481
482
483#define IWLAGN_EXT_BEACON_TIME_POS 22
484
485struct iwl_rxon_context {
486 struct ieee80211_vif *vif;
487
488 u8 mcast_queue;
489 u8 ac_to_queue[IEEE80211_NUM_ACS];
490 u8 ac_to_fifo[IEEE80211_NUM_ACS];
491
492
493
494
495
496
497 bool always_active, is_active;
498
499 bool ht_need_multiple_chains;
500
501 enum iwl_rxon_context_id ctxid;
502
503 u32 interface_modes, exclusive_interface_modes;
504 u8 unused_devtype, ap_devtype, ibss_devtype, station_devtype;
505
506
507
508
509
510
511
512 const struct iwl_rxon_cmd active;
513 struct iwl_rxon_cmd staging;
514
515 struct iwl_rxon_time_cmd timing;
516
517 struct iwl_qos_info qos_data;
518
519 u8 bcast_sta_id, ap_sta_id;
520
521 u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd;
522 u8 qos_cmd;
523 u8 wep_key_cmd;
524
525 struct iwl_wep_key wep_keys[WEP_KEYS_MAX];
526 u8 key_mapping_keys;
527
528 __le32 station_flags;
529
530 int beacon_int;
531
532 struct {
533 bool non_gf_sta_present;
534 u8 protection;
535 bool enabled, is_40mhz;
536 u8 extension_chan_offset;
537 } ht;
538};
539
540enum iwl_scan_type {
541 IWL_SCAN_NORMAL,
542 IWL_SCAN_RADIO_RESET,
543 IWL_SCAN_ROC,
544};
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559struct iwl_hw_params {
560 u8 tx_chains_num;
561 u8 rx_chains_num;
562 bool use_rts_for_aggregation;
563 u32 ct_kill_threshold;
564 u32 ct_kill_exit_threshold;
565
566 const struct iwl_sensitivity_ranges *sens;
567};
568
569
570
571
572
573
574
575
576
577struct iwl_dvm_bt_params {
578 bool advanced_bt_coexist;
579 u8 bt_init_traffic_load;
580 u32 bt_prio_boost;
581 u16 agg_time_limit;
582 bool bt_sco_disable;
583 bool bt_session_2;
584};
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606struct iwl_dvm_cfg {
607 void (*set_hw_params)(struct iwl_priv *priv);
608 int (*set_channel_switch)(struct iwl_priv *priv,
609 struct ieee80211_channel_switch *ch_switch);
610 void (*nic_config)(struct iwl_priv *priv);
611 void (*temperature)(struct iwl_priv *priv);
612
613 const struct iwl_dvm_bt_params *bt_params;
614 s32 chain_noise_scale;
615 u8 plcp_delta_threshold;
616 bool adv_thermal_throttle;
617 bool support_ct_kill_exit;
618 bool hd_v2;
619 bool no_idle_support;
620 bool need_temp_offset_calib;
621 bool no_xtal_calib;
622 bool temp_offset_v2;
623 bool adv_pm;
624};
625
626struct iwl_wipan_noa_data {
627 struct rcu_head rcu_head;
628 u32 length;
629 u8 data[];
630};
631
632
633enum {
634 IWL_CALIB_ENABLE_ALL = 0,
635
636 IWL_SENSITIVITY_CALIB_DISABLED = BIT(0),
637 IWL_CHAIN_NOISE_CALIB_DISABLED = BIT(1),
638 IWL_TX_POWER_CALIB_DISABLED = BIT(2),
639
640 IWL_CALIB_DISABLE_ALL = 0xFFFFFFFF,
641};
642
643#define IWL_OP_MODE_GET_DVM(_iwl_op_mode) \
644 ((struct iwl_priv *) ((_iwl_op_mode)->op_mode_specific))
645
646#define IWL_MAC80211_GET_DVM(_hw) \
647 ((struct iwl_priv *) ((struct iwl_op_mode *) \
648 (_hw)->priv)->op_mode_specific)
649
650struct iwl_priv {
651
652 struct iwl_trans *trans;
653 struct device *dev;
654 const struct iwl_cfg *cfg;
655 const struct iwl_fw *fw;
656 const struct iwl_dvm_cfg *lib;
657 unsigned long status;
658
659 spinlock_t sta_lock;
660 struct mutex mutex;
661
662 unsigned long transport_queue_stop;
663 bool passive_no_rx;
664#define IWL_INVALID_MAC80211_QUEUE 0xff
665 u8 queue_to_mac80211[IWL_MAX_HW_QUEUES];
666 atomic_t queue_stop_count[IWL_MAX_HW_QUEUES];
667
668 unsigned long agg_q_alloc[BITS_TO_LONGS(IWL_MAX_HW_QUEUES)];
669
670
671 struct ieee80211_hw *hw;
672
673 struct list_head calib_results;
674
675 struct workqueue_struct *workqueue;
676
677 struct iwl_hw_params hw_params;
678
679 enum ieee80211_band band;
680 u8 valid_contexts;
681
682 int (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv,
683 struct iwl_rx_cmd_buffer *rxb,
684 struct iwl_device_cmd *cmd);
685
686 struct iwl_notif_wait_data notif_wait;
687
688
689 struct iwl_spectrum_notification measure_report;
690 u8 measurement_status;
691
692
693 u32 ucode_beacon_time;
694 int missed_beacon_threshold;
695
696
697 u32 ibss_manager;
698
699
700 unsigned long rx_statistics_jiffies;
701
702
703 u32 rx_handlers_stats[REPLY_MAX];
704
705
706 struct iwl_rf_reset rf_reset;
707
708
709 unsigned long reload_jiffies;
710 int reload_count;
711 bool ucode_loaded;
712 bool init_ucode_run;
713
714 u8 plcp_delta_threshold;
715
716
717 s32 temperature;
718 s32 last_temperature;
719
720 struct iwl_wipan_noa_data __rcu *noa_data;
721
722
723 unsigned long scan_start;
724 unsigned long scan_start_tsf;
725 void *scan_cmd;
726 enum ieee80211_band scan_band;
727 struct cfg80211_scan_request *scan_request;
728 struct ieee80211_vif *scan_vif;
729 enum iwl_scan_type scan_type;
730 u8 scan_tx_ant[IEEE80211_NUM_BANDS];
731 u8 mgmt_tx_ant;
732
733
734 u8 sta_key_max_num;
735
736 bool new_scan_threshold_behaviour;
737
738 bool wowlan;
739
740
741 struct mac_address addresses[2];
742
743 struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
744
745 __le16 switch_channel;
746
747 u8 start_calib;
748 struct iwl_sensitivity_data sensitivity_data;
749 struct iwl_chain_noise_data chain_noise_data;
750 __le16 sensitivity_tbl[HD_TABLE_SIZE];
751 __le16 enhance_sensitivity_tbl[ENHANCE_HD_TABLE_ENTRIES];
752
753 struct iwl_ht_config current_ht_config;
754
755
756 u8 retry_rate;
757
758 int activity_timer_active;
759
760 struct iwl_power_mgr power_data;
761 struct iwl_tt_mgmt thermal_throttle;
762
763
764 int num_stations;
765 struct iwl_station_entry stations[IWLAGN_STATION_COUNT];
766 unsigned long ucode_key_table;
767 struct iwl_tid_data tid_data[IWLAGN_STATION_COUNT][IWL_MAX_TID_COUNT];
768 atomic_t num_aux_in_flight;
769
770 u8 mac80211_registered;
771
772
773 u8 is_open;
774
775 enum nl80211_iftype iw_mode;
776
777
778 u64 timestamp;
779
780 struct {
781 __le32 flag;
782 struct statistics_general_common common;
783 struct statistics_rx_non_phy rx_non_phy;
784 struct statistics_rx_phy rx_ofdm;
785 struct statistics_rx_ht_phy rx_ofdm_ht;
786 struct statistics_rx_phy rx_cck;
787 struct statistics_tx tx;
788#ifdef CONFIG_IWLWIFI_DEBUGFS
789 struct statistics_bt_activity bt_activity;
790 __le32 num_bt_kills, accum_num_bt_kills;
791#endif
792 spinlock_t lock;
793 } statistics;
794#ifdef CONFIG_IWLWIFI_DEBUGFS
795 struct {
796 struct statistics_general_common common;
797 struct statistics_rx_non_phy rx_non_phy;
798 struct statistics_rx_phy rx_ofdm;
799 struct statistics_rx_ht_phy rx_ofdm_ht;
800 struct statistics_rx_phy rx_cck;
801 struct statistics_tx tx;
802 struct statistics_bt_activity bt_activity;
803 } accum_stats, delta_stats, max_delta_stats;
804#endif
805
806
807
808
809
810 u8 agg_tids_count;
811
812 struct iwl_rx_phy_res last_phy_res;
813 u32 ampdu_ref;
814 bool last_phy_res_valid;
815
816
817
818
819
820
821 u8 phy_calib_chain_noise_reset_cmd;
822 u8 phy_calib_chain_noise_gain_cmd;
823
824
825 struct reply_tx_error_statistics reply_tx_stats;
826 struct reply_agg_tx_error_statistics reply_agg_tx_stats;
827
828
829 struct ieee80211_channel *hw_roc_channel;
830 struct delayed_work hw_roc_disable_work;
831 int hw_roc_duration;
832 bool hw_roc_setup, hw_roc_start_notified;
833
834
835 u8 bt_enable_flag;
836 u8 bt_status;
837 u8 bt_traffic_load, last_bt_traffic_load;
838 bool bt_ch_announce;
839 bool bt_full_concurrent;
840 bool bt_ant_couple_ok;
841 __le32 kill_ack_mask;
842 __le32 kill_cts_mask;
843 __le16 bt_valid;
844 bool reduced_txpower;
845 u16 bt_on_thresh;
846 u16 bt_duration;
847 u16 dynamic_frag_thresh;
848 u8 bt_ci_compliance;
849 struct work_struct bt_traffic_change_work;
850 bool bt_enable_pspoll;
851 struct iwl_rxon_context *cur_rssi_ctx;
852 bool bt_is_sco;
853
854 struct work_struct restart;
855 struct work_struct scan_completed;
856 struct work_struct abort_scan;
857
858 struct work_struct beacon_update;
859 struct iwl_rxon_context *beacon_ctx;
860 struct sk_buff *beacon_skb;
861 void *beacon_cmd;
862
863 struct work_struct tt_work;
864 struct work_struct ct_enter;
865 struct work_struct ct_exit;
866 struct work_struct start_internal_scan;
867 struct work_struct tx_flush;
868 struct work_struct bt_full_concurrency;
869 struct work_struct bt_runtime_config;
870
871 struct delayed_work scan_check;
872
873
874 s8 tx_power_user_lmt;
875 s8 tx_power_next;
876
877#ifdef CONFIG_IWLWIFI_DEBUGFS
878
879 struct dentry *debugfs_dir;
880 u32 dbgfs_sram_offset, dbgfs_sram_len;
881 bool disable_ht40;
882 void *wowlan_sram;
883#endif
884
885 struct iwl_nvm_data *nvm_data;
886
887 u8 *eeprom_blob;
888 size_t eeprom_blob_size;
889
890 struct work_struct txpower_work;
891 u32 calib_disabled;
892 struct work_struct run_time_calib_work;
893 struct timer_list statistics_periodic;
894 struct timer_list ucode_trace;
895
896 struct iwl_event_log event_log;
897
898 struct led_classdev led;
899 unsigned long blink_on, blink_off;
900 bool led_registered;
901
902
903 u8 kck[NL80211_KCK_LEN], kek[NL80211_KEK_LEN];
904 __le64 replay_ctr;
905 __le16 last_seq_ctl;
906 bool have_rekey_data;
907#ifdef CONFIG_PM_SLEEP
908 struct wiphy_wowlan_support wowlan_support;
909#endif
910
911
912 struct {
913 u32 error_event_table;
914 u32 log_event_table;
915 } device_pointers;
916
917
918 enum iwl_ucode_type cur_ucode;
919};
920
921static inline struct iwl_rxon_context *
922iwl_rxon_ctx_from_vif(struct ieee80211_vif *vif)
923{
924 struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv;
925
926 return vif_priv->ctx;
927}
928
929#define for_each_context(priv, ctx) \
930 for (ctx = &priv->contexts[IWL_RXON_CTX_BSS]; \
931 ctx < &priv->contexts[NUM_IWL_RXON_CTX]; ctx++) \
932 if (priv->valid_contexts & BIT(ctx->ctxid))
933
934static inline int iwl_is_associated_ctx(struct iwl_rxon_context *ctx)
935{
936 return (ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
937}
938
939static inline int iwl_is_associated(struct iwl_priv *priv,
940 enum iwl_rxon_context_id ctxid)
941{
942 return iwl_is_associated_ctx(&priv->contexts[ctxid]);
943}
944
945static inline int iwl_is_any_associated(struct iwl_priv *priv)
946{
947 struct iwl_rxon_context *ctx;
948 for_each_context(priv, ctx)
949 if (iwl_is_associated_ctx(ctx))
950 return true;
951 return false;
952}
953
954#endif
955