diff options
author | Alexander Bondar <alexander.bondar@intel.com> | 2013-03-10 09:29:44 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-07-16 09:13:23 -0400 |
commit | e811ada7a6a3f720c178ba29998ce9f9685f9df3 (patch) | |
tree | 726f979761d68443e4a90dd86d10dbf2231e8aee /drivers/net/wireless/iwlwifi/mvm/mvm.h | |
parent | 0c393d4eac31912ad6ea362d4f9bf78aa1fe9a69 (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.h | 46 |
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 | ||
93 | extern struct ieee80211_ops iwl_mvm_hw_ops; | 93 | extern struct ieee80211_ops iwl_mvm_hw_ops; |
94 | extern const struct iwl_mvm_power_ops pm_legacy_ops; | ||
95 | extern 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 | ||
156 | struct 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 |
154 | enum iwl_dbgfs_pm_mask { | 168 | enum 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 | ||
165 | struct iwl_dbgfs_pm { | 179 | struct 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 */ |
663 | int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | 679 | 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); | 680 | struct ieee80211_vif *vif) |
665 | void 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 | |||
685 | static 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 | ||
692 | static 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 | ||
668 | int iwl_mvm_leds_init(struct iwl_mvm *mvm); | 700 | int iwl_mvm_leds_init(struct iwl_mvm *mvm); |
669 | void iwl_mvm_leds_exit(struct iwl_mvm *mvm); | 701 | void 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); |
708 | int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm, | 740 | int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm, |
709 | struct ieee80211_vif *vif); | 741 | struct ieee80211_vif *vif); |
742 | int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm, | ||
743 | struct iwl_beacon_filter_cmd *cmd); | ||
744 | int iwl_mvm_update_beacon_abort(struct iwl_mvm *mvm, | ||
745 | struct ieee80211_vif *vif, bool enable); | ||
710 | 746 | ||
711 | /* SMPS */ | 747 | /* SMPS */ |
712 | void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 748 | void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |