iwlwifi: mvm: refactor power code
The main complexity of the power code is that it needs to
take into account the firmware limitations.
These limitations state that we need to have a global
picture of the vifs present in the system to be able to
decide if we can enable power management on a specific vif.
Even device power save (as opposed to vif power management)
must be disabled in certain circumstances (monitor vif).
Refactor the current code to make this clearer by defining
a function that explicitely computes these constraints.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index bf6b602..ab6e1e9 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -588,7 +588,9 @@
u8 bound_vif_cnt;
/* Indicate if device power save is allowed */
- bool ps_prevented;
+ bool ps_disabled;
+ /* Indicate if device power management is allowed */
+ bool pm_disabled;
};
/* Extract MVM priv from op_mode and _hw */
@@ -812,11 +814,8 @@
/* power management */
int iwl_power_legacy_set_cam_mode(struct iwl_mvm *mvm);
-int iwl_mvm_power_mac_update_mode(struct iwl_mvm *mvm,
- struct ieee80211_vif *vif);
int iwl_mvm_power_update_device(struct iwl_mvm *mvm);
-void iwl_mvm_power_update_binding(struct iwl_mvm *mvm,
- struct ieee80211_vif *vif, bool assign);
+int iwl_mvm_power_update_mac(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
int iwl_mvm_power_mac_dbgfs_read(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
char *buf, int bufsz);