aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/mvm.h
diff options
context:
space:
mode:
authorAlexander Bondar <alexander.bondar@intel.com>2013-03-10 09:29:44 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-07-16 09:13:23 -0400
commite811ada7a6a3f720c178ba29998ce9f9685f9df3 (patch)
tree726f979761d68443e4a90dd86d10dbf2231e8aee /drivers/net/wireless/iwlwifi/mvm/mvm.h
parent0c393d4eac31912ad6ea362d4f9bf78aa1fe9a69 (diff)
iwlwifi: mvm: Upgrade to a new power management uAPSD API
Change power management implementation to support new host-device API containing uAPSD parameters. Verify FW support for this new API. Use the new power table command (0xA9) to configure power management. Use the legacy command (0x77) if FW does not support the new API. New file power_legacy.c is introduced for legacy implementation. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mvm.h')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h46
1 files changed, 41 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 3aaecbcdc551..caa6a1758172 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -91,6 +91,9 @@ enum iwl_mvm_tx_fifo {
91}; 91};
92 92
93extern struct ieee80211_ops iwl_mvm_hw_ops; 93extern struct ieee80211_ops iwl_mvm_hw_ops;
94extern const struct iwl_mvm_power_ops pm_legacy_ops;
95extern const struct iwl_mvm_power_ops pm_mac_ops;
96
94/** 97/**
95 * struct iwl_mvm_mod_params - module parameters for iwlmvm 98 * 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. 99 * @init_dbg: if true, then the NIC won't be stopped if the INIT fw asserted.
@@ -150,6 +153,17 @@ enum iwl_power_scheme {
150 153
151#define IWL_CONN_MAX_LISTEN_INTERVAL 70 154#define IWL_CONN_MAX_LISTEN_INTERVAL 70
152 155
156struct iwl_mvm_power_ops {
157 int (*power_update_mode)(struct iwl_mvm *mvm,
158 struct ieee80211_vif *vif);
159 int (*power_disable)(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
160#ifdef CONFIG_IWLWIFI_DEBUGFS
161 int (*power_dbgfs_read)(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
162 char *buf, int bufsz);
163#endif
164};
165
166
153#ifdef CONFIG_IWLWIFI_DEBUGFS 167#ifdef CONFIG_IWLWIFI_DEBUGFS
154enum iwl_dbgfs_pm_mask { 168enum iwl_dbgfs_pm_mask {
155 MVM_DEBUGFS_PM_KEEP_ALIVE = BIT(0), 169 MVM_DEBUGFS_PM_KEEP_ALIVE = BIT(0),
@@ -163,7 +177,7 @@ enum iwl_dbgfs_pm_mask {
163}; 177};
164 178
165struct iwl_dbgfs_pm { 179struct iwl_dbgfs_pm {
166 u8 keep_alive_seconds; 180 u16 keep_alive_seconds;
167 u32 rx_data_timeout; 181 u32 rx_data_timeout;
168 u32 tx_data_timeout; 182 u32 tx_data_timeout;
169 bool skip_over_dtim; 183 bool skip_over_dtim;
@@ -481,6 +495,8 @@ struct iwl_mvm {
481 /* Thermal Throttling and CTkill */ 495 /* Thermal Throttling and CTkill */
482 struct iwl_mvm_tt_mgmt thermal_throttle; 496 struct iwl_mvm_tt_mgmt thermal_throttle;
483 s32 temperature; /* Celsius */ 497 s32 temperature; /* Celsius */
498
499 const struct iwl_mvm_power_ops *pm_ops;
484}; 500};
485 501
486/* Extract MVM priv from op_mode and _hw */ 502/* Extract MVM priv from op_mode and _hw */
@@ -660,10 +676,26 @@ int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq,
660 u8 flags, bool init); 676 u8 flags, bool init);
661 677
662/* power managment */ 678/* power managment */
663int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, struct ieee80211_vif *vif); 679static inline int iwl_mvm_power_update_mode(struct iwl_mvm *mvm,
664int iwl_mvm_power_disable(struct iwl_mvm *mvm, struct ieee80211_vif *vif); 680 struct ieee80211_vif *vif)
665void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 681{
666 struct iwl_powertable_cmd *cmd); 682 return mvm->pm_ops->power_update_mode(mvm, vif);
683}
684
685static inline int iwl_mvm_power_disable(struct iwl_mvm *mvm,
686 struct ieee80211_vif *vif)
687{
688 return mvm->pm_ops->power_disable(mvm, vif);
689}
690
691#ifdef CONFIG_IWLWIFI_DEBUGFS
692static inline int iwl_mvm_power_dbgfs_read(struct iwl_mvm *mvm,
693 struct ieee80211_vif *vif,
694 char *buf, int bufsz)
695{
696 return mvm->pm_ops->power_dbgfs_read(mvm, vif, buf, bufsz);
697}
698#endif
667 699
668int iwl_mvm_leds_init(struct iwl_mvm *mvm); 700int iwl_mvm_leds_init(struct iwl_mvm *mvm);
669void iwl_mvm_leds_exit(struct iwl_mvm *mvm); 701void iwl_mvm_leds_exit(struct iwl_mvm *mvm);
@@ -707,6 +739,10 @@ int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
707 struct ieee80211_vif *vif); 739 struct ieee80211_vif *vif);
708int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm, 740int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
709 struct ieee80211_vif *vif); 741 struct ieee80211_vif *vif);
742int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
743 struct iwl_beacon_filter_cmd *cmd);
744int iwl_mvm_update_beacon_abort(struct iwl_mvm *mvm,
745 struct ieee80211_vif *vif, bool enable);
710 746
711/* SMPS */ 747/* SMPS */
712void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 748void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif,