aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/mvm.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mvm.h')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h112
1 files changed, 91 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 420e82d379d9..b0389279cc1e 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -76,6 +76,7 @@
76#include "iwl-trans.h" 76#include "iwl-trans.h"
77#include "sta.h" 77#include "sta.h"
78#include "fw-api.h" 78#include "fw-api.h"
79#include "constants.h"
79 80
80#define IWL_INVALID_MAC80211_QUEUE 0xff 81#define IWL_INVALID_MAC80211_QUEUE 0xff
81#define IWL_MVM_MAX_ADDRESSES 5 82#define IWL_MVM_MAX_ADDRESSES 5
@@ -91,6 +92,9 @@ enum iwl_mvm_tx_fifo {
91}; 92};
92 93
93extern struct ieee80211_ops iwl_mvm_hw_ops; 94extern struct ieee80211_ops iwl_mvm_hw_ops;
95extern const struct iwl_mvm_power_ops pm_legacy_ops;
96extern const struct iwl_mvm_power_ops pm_mac_ops;
97
94/** 98/**
95 * struct iwl_mvm_mod_params - module parameters for iwlmvm 99 * struct iwl_mvm_mod_params - module parameters for iwlmvm
96 * @init_dbg: if true, then the NIC won't be stopped if the INIT fw asserted. 100 * @init_dbg: if true, then the NIC won't be stopped if the INIT fw asserted.
@@ -149,6 +153,22 @@ enum iwl_power_scheme {
149}; 153};
150 154
151#define IWL_CONN_MAX_LISTEN_INTERVAL 70 155#define IWL_CONN_MAX_LISTEN_INTERVAL 70
156#define IWL_UAPSD_AC_INFO (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\
157 IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\
158 IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\
159 IEEE80211_WMM_IE_STA_QOSINFO_AC_BE)
160#define IWL_UAPSD_MAX_SP IEEE80211_WMM_IE_STA_QOSINFO_SP_2
161
162struct iwl_mvm_power_ops {
163 int (*power_update_mode)(struct iwl_mvm *mvm,
164 struct ieee80211_vif *vif);
165 int (*power_disable)(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
166#ifdef CONFIG_IWLWIFI_DEBUGFS
167 int (*power_dbgfs_read)(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
168 char *buf, int bufsz);
169#endif
170};
171
152 172
153#ifdef CONFIG_IWLWIFI_DEBUGFS 173#ifdef CONFIG_IWLWIFI_DEBUGFS
154enum iwl_dbgfs_pm_mask { 174enum iwl_dbgfs_pm_mask {
@@ -160,10 +180,11 @@ enum iwl_dbgfs_pm_mask {
160 MVM_DEBUGFS_PM_DISABLE_POWER_OFF = BIT(5), 180 MVM_DEBUGFS_PM_DISABLE_POWER_OFF = BIT(5),
161 MVM_DEBUGFS_PM_LPRX_ENA = BIT(6), 181 MVM_DEBUGFS_PM_LPRX_ENA = BIT(6),
162 MVM_DEBUGFS_PM_LPRX_RSSI_THRESHOLD = BIT(7), 182 MVM_DEBUGFS_PM_LPRX_RSSI_THRESHOLD = BIT(7),
183 MVM_DEBUGFS_PM_SNOOZE_ENABLE = BIT(8),
163}; 184};
164 185
165struct iwl_dbgfs_pm { 186struct iwl_dbgfs_pm {
166 u8 keep_alive_seconds; 187 u16 keep_alive_seconds;
167 u32 rx_data_timeout; 188 u32 rx_data_timeout;
168 u32 tx_data_timeout; 189 u32 tx_data_timeout;
169 bool skip_over_dtim; 190 bool skip_over_dtim;
@@ -171,6 +192,7 @@ struct iwl_dbgfs_pm {
171 bool disable_power_off; 192 bool disable_power_off;
172 bool lprx_ena; 193 bool lprx_ena;
173 u32 lprx_rssi_threshold; 194 u32 lprx_rssi_threshold;
195 bool snooze_ena;
174 int mask; 196 int mask;
175}; 197};
176 198
@@ -180,24 +202,28 @@ enum iwl_dbgfs_bf_mask {
180 MVM_DEBUGFS_BF_ENERGY_DELTA = BIT(0), 202 MVM_DEBUGFS_BF_ENERGY_DELTA = BIT(0),
181 MVM_DEBUGFS_BF_ROAMING_ENERGY_DELTA = BIT(1), 203 MVM_DEBUGFS_BF_ROAMING_ENERGY_DELTA = BIT(1),
182 MVM_DEBUGFS_BF_ROAMING_STATE = BIT(2), 204 MVM_DEBUGFS_BF_ROAMING_STATE = BIT(2),
183 MVM_DEBUGFS_BF_TEMPERATURE_DELTA = BIT(3), 205 MVM_DEBUGFS_BF_TEMP_THRESHOLD = BIT(3),
184 MVM_DEBUGFS_BF_ENABLE_BEACON_FILTER = BIT(4), 206 MVM_DEBUGFS_BF_TEMP_FAST_FILTER = BIT(4),
185 MVM_DEBUGFS_BF_DEBUG_FLAG = BIT(5), 207 MVM_DEBUGFS_BF_TEMP_SLOW_FILTER = BIT(5),
186 MVM_DEBUGFS_BF_ESCAPE_TIMER = BIT(6), 208 MVM_DEBUGFS_BF_ENABLE_BEACON_FILTER = BIT(6),
187 MVM_DEBUGFS_BA_ESCAPE_TIMER = BIT(7), 209 MVM_DEBUGFS_BF_DEBUG_FLAG = BIT(7),
188 MVM_DEBUGFS_BA_ENABLE_BEACON_ABORT = BIT(8), 210 MVM_DEBUGFS_BF_ESCAPE_TIMER = BIT(8),
211 MVM_DEBUGFS_BA_ESCAPE_TIMER = BIT(9),
212 MVM_DEBUGFS_BA_ENABLE_BEACON_ABORT = BIT(10),
189}; 213};
190 214
191struct iwl_dbgfs_bf { 215struct iwl_dbgfs_bf {
192 u8 bf_energy_delta; 216 u32 bf_energy_delta;
193 u8 bf_roaming_energy_delta; 217 u32 bf_roaming_energy_delta;
194 u8 bf_roaming_state; 218 u32 bf_roaming_state;
195 u8 bf_temperature_delta; 219 u32 bf_temp_threshold;
196 u8 bf_enable_beacon_filter; 220 u32 bf_temp_fast_filter;
197 u8 bf_debug_flag; 221 u32 bf_temp_slow_filter;
222 u32 bf_enable_beacon_filter;
223 u32 bf_debug_flag;
198 u32 bf_escape_timer; 224 u32 bf_escape_timer;
199 u32 ba_escape_timer; 225 u32 ba_escape_timer;
200 u8 ba_enable_beacon_abort; 226 u32 ba_enable_beacon_abort;
201 int mask; 227 int mask;
202}; 228};
203#endif 229#endif
@@ -209,6 +235,21 @@ enum iwl_mvm_smps_type_request {
209}; 235};
210 236
211/** 237/**
238* struct iwl_mvm_vif_bf_data - beacon filtering related data
239* @bf_enabled: indicates if beacon filtering is enabled
240* @ba_enabled: indicated if beacon abort is enabled
241* @last_beacon_signal: last beacon rssi signal in dbm
242* @ave_beacon_signal: average beacon signal
243* @last_cqm_event: rssi of the last cqm event
244*/
245struct iwl_mvm_vif_bf_data {
246 bool bf_enabled;
247 bool ba_enabled;
248 s8 ave_beacon_signal;
249 s8 last_cqm_event;
250};
251
252/**
212 * struct iwl_mvm_vif - data per Virtual Interface, it is a MAC context 253 * struct iwl_mvm_vif - data per Virtual Interface, it is a MAC context
213 * @id: between 0 and 3 254 * @id: between 0 and 3
214 * @color: to solve races upon MAC addition and removal 255 * @color: to solve races upon MAC addition and removal
@@ -233,8 +274,7 @@ struct iwl_mvm_vif {
233 bool uploaded; 274 bool uploaded;
234 bool ap_active; 275 bool ap_active;
235 bool monitor_active; 276 bool monitor_active;
236 /* indicate whether beacon filtering is enabled */ 277 struct iwl_mvm_vif_bf_data bf_data;
237 bool bf_enabled;
238 278
239 u32 ap_beacon_time; 279 u32 ap_beacon_time;
240 280
@@ -268,7 +308,7 @@ struct iwl_mvm_vif {
268 308
269#if IS_ENABLED(CONFIG_IPV6) 309#if IS_ENABLED(CONFIG_IPV6)
270 /* IPv6 addresses for WoWLAN */ 310 /* IPv6 addresses for WoWLAN */
271 struct in6_addr target_ipv6_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS]; 311 struct in6_addr target_ipv6_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX];
272 int num_target_ipv6_addrs; 312 int num_target_ipv6_addrs;
273#endif 313#endif
274#endif 314#endif
@@ -402,6 +442,8 @@ struct iwl_mvm {
402 442
403 struct iwl_notif_wait_data notif_wait; 443 struct iwl_notif_wait_data notif_wait;
404 444
445 struct mvm_statistics_rx rx_stats;
446
405 unsigned long transport_queue_stop; 447 unsigned long transport_queue_stop;
406 u8 queue_to_mac80211[IWL_MAX_HW_QUEUES]; 448 u8 queue_to_mac80211[IWL_MAX_HW_QUEUES];
407 atomic_t queue_stop_count[IWL_MAX_HW_QUEUES]; 449 atomic_t queue_stop_count[IWL_MAX_HW_QUEUES];
@@ -459,6 +501,9 @@ struct iwl_mvm {
459 */ 501 */
460 u8 vif_count; 502 u8 vif_count;
461 503
504 /* -1 for always, 0 for never, >0 for that many times */
505 s8 restart_fw;
506
462 struct led_classdev led; 507 struct led_classdev led;
463 508
464 struct ieee80211_vif *p2p_device_vif; 509 struct ieee80211_vif *p2p_device_vif;
@@ -482,6 +527,8 @@ struct iwl_mvm {
482 /* Thermal Throttling and CTkill */ 527 /* Thermal Throttling and CTkill */
483 struct iwl_mvm_tt_mgmt thermal_throttle; 528 struct iwl_mvm_tt_mgmt thermal_throttle;
484 s32 temperature; /* Celsius */ 529 s32 temperature; /* Celsius */
530
531 const struct iwl_mvm_power_ops *pm_ops;
485}; 532};
486 533
487/* Extract MVM priv from op_mode and _hw */ 534/* Extract MVM priv from op_mode and _hw */
@@ -525,6 +572,7 @@ int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags,
525 enum ieee80211_band band); 572 enum ieee80211_band band);
526u8 iwl_mvm_mac80211_idx_to_hwrate(int rate_idx); 573u8 iwl_mvm_mac80211_idx_to_hwrate(int rate_idx);
527void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm); 574void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm);
575void iwl_mvm_dump_sram(struct iwl_mvm *mvm);
528u8 first_antenna(u8 mask); 576u8 first_antenna(u8 mask);
529u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx); 577u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx);
530 578
@@ -660,10 +708,26 @@ int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq,
660 u8 flags, bool init); 708 u8 flags, bool init);
661 709
662/* power managment */ 710/* power managment */
663int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, struct ieee80211_vif *vif); 711static inline int iwl_mvm_power_update_mode(struct iwl_mvm *mvm,
664int iwl_mvm_power_disable(struct iwl_mvm *mvm, struct ieee80211_vif *vif); 712 struct ieee80211_vif *vif)
665void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 713{
666 struct iwl_powertable_cmd *cmd); 714 return mvm->pm_ops->power_update_mode(mvm, vif);
715}
716
717static inline int iwl_mvm_power_disable(struct iwl_mvm *mvm,
718 struct ieee80211_vif *vif)
719{
720 return mvm->pm_ops->power_disable(mvm, vif);
721}
722
723#ifdef CONFIG_IWLWIFI_DEBUGFS
724static inline int iwl_mvm_power_dbgfs_read(struct iwl_mvm *mvm,
725 struct ieee80211_vif *vif,
726 char *buf, int bufsz)
727{
728 return mvm->pm_ops->power_dbgfs_read(mvm, vif, buf, bufsz);
729}
730#endif
667 731
668int iwl_mvm_leds_init(struct iwl_mvm *mvm); 732int iwl_mvm_leds_init(struct iwl_mvm *mvm);
669void iwl_mvm_leds_exit(struct iwl_mvm *mvm); 733void iwl_mvm_leds_exit(struct iwl_mvm *mvm);
@@ -707,6 +771,12 @@ int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
707 struct ieee80211_vif *vif); 771 struct ieee80211_vif *vif);
708int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm, 772int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
709 struct ieee80211_vif *vif); 773 struct ieee80211_vif *vif);
774int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
775 struct iwl_beacon_filter_cmd *cmd);
776int iwl_mvm_update_beacon_abort(struct iwl_mvm *mvm,
777 struct ieee80211_vif *vif, bool enable);
778int iwl_mvm_update_beacon_filter(struct iwl_mvm *mvm,
779 struct ieee80211_vif *vif);
710 780
711/* SMPS */ 781/* SMPS */
712void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 782void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif,