diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mvm.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mvm.h | 83 |
1 files changed, 64 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index 420e82d379d9..29bebae7f003 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 | ||
93 | extern struct ieee80211_ops iwl_mvm_hw_ops; | 94 | extern struct ieee80211_ops iwl_mvm_hw_ops; |
95 | extern const struct iwl_mvm_power_ops pm_legacy_ops; | ||
96 | extern 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. |
@@ -150,6 +154,17 @@ enum iwl_power_scheme { | |||
150 | 154 | ||
151 | #define IWL_CONN_MAX_LISTEN_INTERVAL 70 | 155 | #define IWL_CONN_MAX_LISTEN_INTERVAL 70 |
152 | 156 | ||
157 | struct iwl_mvm_power_ops { | ||
158 | int (*power_update_mode)(struct iwl_mvm *mvm, | ||
159 | struct ieee80211_vif *vif); | ||
160 | int (*power_disable)(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | ||
161 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
162 | int (*power_dbgfs_read)(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | ||
163 | char *buf, int bufsz); | ||
164 | #endif | ||
165 | }; | ||
166 | |||
167 | |||
153 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 168 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
154 | enum iwl_dbgfs_pm_mask { | 169 | enum iwl_dbgfs_pm_mask { |
155 | MVM_DEBUGFS_PM_KEEP_ALIVE = BIT(0), | 170 | MVM_DEBUGFS_PM_KEEP_ALIVE = BIT(0), |
@@ -163,7 +178,7 @@ enum iwl_dbgfs_pm_mask { | |||
163 | }; | 178 | }; |
164 | 179 | ||
165 | struct iwl_dbgfs_pm { | 180 | struct iwl_dbgfs_pm { |
166 | u8 keep_alive_seconds; | 181 | u16 keep_alive_seconds; |
167 | u32 rx_data_timeout; | 182 | u32 rx_data_timeout; |
168 | u32 tx_data_timeout; | 183 | u32 tx_data_timeout; |
169 | bool skip_over_dtim; | 184 | bool skip_over_dtim; |
@@ -180,24 +195,28 @@ enum iwl_dbgfs_bf_mask { | |||
180 | MVM_DEBUGFS_BF_ENERGY_DELTA = BIT(0), | 195 | MVM_DEBUGFS_BF_ENERGY_DELTA = BIT(0), |
181 | MVM_DEBUGFS_BF_ROAMING_ENERGY_DELTA = BIT(1), | 196 | MVM_DEBUGFS_BF_ROAMING_ENERGY_DELTA = BIT(1), |
182 | MVM_DEBUGFS_BF_ROAMING_STATE = BIT(2), | 197 | MVM_DEBUGFS_BF_ROAMING_STATE = BIT(2), |
183 | MVM_DEBUGFS_BF_TEMPERATURE_DELTA = BIT(3), | 198 | MVM_DEBUGFS_BF_TEMP_THRESHOLD = BIT(3), |
184 | MVM_DEBUGFS_BF_ENABLE_BEACON_FILTER = BIT(4), | 199 | MVM_DEBUGFS_BF_TEMP_FAST_FILTER = BIT(4), |
185 | MVM_DEBUGFS_BF_DEBUG_FLAG = BIT(5), | 200 | MVM_DEBUGFS_BF_TEMP_SLOW_FILTER = BIT(5), |
186 | MVM_DEBUGFS_BF_ESCAPE_TIMER = BIT(6), | 201 | MVM_DEBUGFS_BF_ENABLE_BEACON_FILTER = BIT(6), |
187 | MVM_DEBUGFS_BA_ESCAPE_TIMER = BIT(7), | 202 | MVM_DEBUGFS_BF_DEBUG_FLAG = BIT(7), |
188 | MVM_DEBUGFS_BA_ENABLE_BEACON_ABORT = BIT(8), | 203 | MVM_DEBUGFS_BF_ESCAPE_TIMER = BIT(8), |
204 | MVM_DEBUGFS_BA_ESCAPE_TIMER = BIT(9), | ||
205 | MVM_DEBUGFS_BA_ENABLE_BEACON_ABORT = BIT(10), | ||
189 | }; | 206 | }; |
190 | 207 | ||
191 | struct iwl_dbgfs_bf { | 208 | struct iwl_dbgfs_bf { |
192 | u8 bf_energy_delta; | 209 | u32 bf_energy_delta; |
193 | u8 bf_roaming_energy_delta; | 210 | u32 bf_roaming_energy_delta; |
194 | u8 bf_roaming_state; | 211 | u32 bf_roaming_state; |
195 | u8 bf_temperature_delta; | 212 | u32 bf_temp_threshold; |
196 | u8 bf_enable_beacon_filter; | 213 | u32 bf_temp_fast_filter; |
197 | u8 bf_debug_flag; | 214 | u32 bf_temp_slow_filter; |
215 | u32 bf_enable_beacon_filter; | ||
216 | u32 bf_debug_flag; | ||
198 | u32 bf_escape_timer; | 217 | u32 bf_escape_timer; |
199 | u32 ba_escape_timer; | 218 | u32 ba_escape_timer; |
200 | u8 ba_enable_beacon_abort; | 219 | u32 ba_enable_beacon_abort; |
201 | int mask; | 220 | int mask; |
202 | }; | 221 | }; |
203 | #endif | 222 | #endif |
@@ -268,7 +287,7 @@ struct iwl_mvm_vif { | |||
268 | 287 | ||
269 | #if IS_ENABLED(CONFIG_IPV6) | 288 | #if IS_ENABLED(CONFIG_IPV6) |
270 | /* IPv6 addresses for WoWLAN */ | 289 | /* IPv6 addresses for WoWLAN */ |
271 | struct in6_addr target_ipv6_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS]; | 290 | struct in6_addr target_ipv6_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX]; |
272 | int num_target_ipv6_addrs; | 291 | int num_target_ipv6_addrs; |
273 | #endif | 292 | #endif |
274 | #endif | 293 | #endif |
@@ -459,6 +478,9 @@ struct iwl_mvm { | |||
459 | */ | 478 | */ |
460 | u8 vif_count; | 479 | u8 vif_count; |
461 | 480 | ||
481 | /* -1 for always, 0 for never, >0 for that many times */ | ||
482 | s8 restart_fw; | ||
483 | |||
462 | struct led_classdev led; | 484 | struct led_classdev led; |
463 | 485 | ||
464 | struct ieee80211_vif *p2p_device_vif; | 486 | struct ieee80211_vif *p2p_device_vif; |
@@ -482,6 +504,8 @@ struct iwl_mvm { | |||
482 | /* Thermal Throttling and CTkill */ | 504 | /* Thermal Throttling and CTkill */ |
483 | struct iwl_mvm_tt_mgmt thermal_throttle; | 505 | struct iwl_mvm_tt_mgmt thermal_throttle; |
484 | s32 temperature; /* Celsius */ | 506 | s32 temperature; /* Celsius */ |
507 | |||
508 | const struct iwl_mvm_power_ops *pm_ops; | ||
485 | }; | 509 | }; |
486 | 510 | ||
487 | /* Extract MVM priv from op_mode and _hw */ | 511 | /* Extract MVM priv from op_mode and _hw */ |
@@ -525,6 +549,7 @@ int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags, | |||
525 | enum ieee80211_band band); | 549 | enum ieee80211_band band); |
526 | u8 iwl_mvm_mac80211_idx_to_hwrate(int rate_idx); | 550 | u8 iwl_mvm_mac80211_idx_to_hwrate(int rate_idx); |
527 | void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm); | 551 | void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm); |
552 | void iwl_mvm_dump_sram(struct iwl_mvm *mvm); | ||
528 | u8 first_antenna(u8 mask); | 553 | u8 first_antenna(u8 mask); |
529 | u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx); | 554 | u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx); |
530 | 555 | ||
@@ -660,10 +685,26 @@ int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, | |||
660 | u8 flags, bool init); | 685 | u8 flags, bool init); |
661 | 686 | ||
662 | /* power managment */ | 687 | /* power managment */ |
663 | int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | 688 | static inline int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, |
664 | int iwl_mvm_power_disable(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | 689 | struct ieee80211_vif *vif) |
665 | void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 690 | { |
666 | struct iwl_powertable_cmd *cmd); | 691 | return mvm->pm_ops->power_update_mode(mvm, vif); |
692 | } | ||
693 | |||
694 | static inline int iwl_mvm_power_disable(struct iwl_mvm *mvm, | ||
695 | struct ieee80211_vif *vif) | ||
696 | { | ||
697 | return mvm->pm_ops->power_disable(mvm, vif); | ||
698 | } | ||
699 | |||
700 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
701 | static inline int iwl_mvm_power_dbgfs_read(struct iwl_mvm *mvm, | ||
702 | struct ieee80211_vif *vif, | ||
703 | char *buf, int bufsz) | ||
704 | { | ||
705 | return mvm->pm_ops->power_dbgfs_read(mvm, vif, buf, bufsz); | ||
706 | } | ||
707 | #endif | ||
667 | 708 | ||
668 | int iwl_mvm_leds_init(struct iwl_mvm *mvm); | 709 | int iwl_mvm_leds_init(struct iwl_mvm *mvm); |
669 | void iwl_mvm_leds_exit(struct iwl_mvm *mvm); | 710 | void iwl_mvm_leds_exit(struct iwl_mvm *mvm); |
@@ -707,6 +748,10 @@ int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm, | |||
707 | struct ieee80211_vif *vif); | 748 | struct ieee80211_vif *vif); |
708 | int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm, | 749 | int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm, |
709 | struct ieee80211_vif *vif); | 750 | struct ieee80211_vif *vif); |
751 | int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm, | ||
752 | struct iwl_beacon_filter_cmd *cmd); | ||
753 | int iwl_mvm_update_beacon_abort(struct iwl_mvm *mvm, | ||
754 | struct ieee80211_vif *vif, bool enable); | ||
710 | 755 | ||
711 | /* SMPS */ | 756 | /* SMPS */ |
712 | void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 757 | void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |