diff options
author | Alexander Bondar <alexander.bondar@intel.com> | 2013-03-05 07:08:23 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-03 16:49:17 -0400 |
commit | 3f0b2b3ec84b4e90e6980793fc0dd0ec183aeb60 (patch) | |
tree | 8adfc896c7233562d5778654de9b3dc7454cb9d9 /drivers/net/wireless/iwlwifi | |
parent | e16cf7ec6ffbcf96ef3c322b76ff90c2611254d9 (diff) |
iwlwifi: mvm: encapsulate power table command log message
Encapsulate the power table command logging in a separate
function to print the same information in both cases.
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/power.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c index 6e7e06a2b9c1..2d2ce9803267 100644 --- a/drivers/net/wireless/iwlwifi/mvm/power.c +++ b/drivers/net/wireless/iwlwifi/mvm/power.c | |||
@@ -75,6 +75,25 @@ | |||
75 | 75 | ||
76 | #define POWER_KEEP_ALIVE_PERIOD_SEC 25 | 76 | #define POWER_KEEP_ALIVE_PERIOD_SEC 25 |
77 | 77 | ||
78 | static void iwl_mvm_power_log(struct iwl_mvm *mvm, | ||
79 | struct iwl_powertable_cmd *cmd) | ||
80 | { | ||
81 | IWL_DEBUG_POWER(mvm, | ||
82 | "Sending power table command for power level %d, flags = 0x%X\n", | ||
83 | iwlmvm_mod_params.power_scheme, | ||
84 | le16_to_cpu(cmd->flags)); | ||
85 | IWL_DEBUG_POWER(mvm, "Keep alive = %u sec\n", cmd->keep_alive_seconds); | ||
86 | |||
87 | if (cmd->flags & cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK)) { | ||
88 | IWL_DEBUG_POWER(mvm, "Rx timeout = %u usec\n", | ||
89 | le32_to_cpu(cmd->rx_data_timeout)); | ||
90 | IWL_DEBUG_POWER(mvm, "Tx timeout = %u usec\n", | ||
91 | le32_to_cpu(cmd->tx_data_timeout)); | ||
92 | IWL_DEBUG_POWER(mvm, "LP RX RSSI threshold = %u\n", | ||
93 | cmd->lprx_rssi_threshold); | ||
94 | } | ||
95 | } | ||
96 | |||
78 | static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, | 97 | static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, |
79 | struct ieee80211_vif *vif, | 98 | struct ieee80211_vif *vif, |
80 | struct iwl_powertable_cmd *cmd) | 99 | struct iwl_powertable_cmd *cmd) |
@@ -146,21 +165,7 @@ int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
146 | return 0; | 165 | return 0; |
147 | 166 | ||
148 | iwl_mvm_power_build_cmd(mvm, vif, &cmd); | 167 | iwl_mvm_power_build_cmd(mvm, vif, &cmd); |
149 | 168 | iwl_mvm_power_log(mvm, &cmd); | |
150 | IWL_DEBUG_POWER(mvm, | ||
151 | "Sending power table command for power level %d, flags = 0x%X\n", | ||
152 | iwlmvm_mod_params.power_scheme, le16_to_cpu(cmd.flags)); | ||
153 | |||
154 | if (cmd.flags & cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK)) { | ||
155 | IWL_DEBUG_POWER(mvm, "Keep alive = %u sec\n", | ||
156 | cmd.keep_alive_seconds); | ||
157 | IWL_DEBUG_POWER(mvm, "Rx timeout = %u usec\n", | ||
158 | le32_to_cpu(cmd.rx_data_timeout)); | ||
159 | IWL_DEBUG_POWER(mvm, "Tx timeout = %u usec\n", | ||
160 | le32_to_cpu(cmd.tx_data_timeout)); | ||
161 | IWL_DEBUG_POWER(mvm, "LP RX RSSI threshold = %u\n", | ||
162 | cmd.lprx_rssi_threshold); | ||
163 | } | ||
164 | 169 | ||
165 | return iwl_mvm_send_cmd_pdu(mvm, POWER_TABLE_CMD, CMD_SYNC, | 170 | return iwl_mvm_send_cmd_pdu(mvm, POWER_TABLE_CMD, CMD_SYNC, |
166 | sizeof(cmd), &cmd); | 171 | sizeof(cmd), &cmd); |
@@ -177,9 +182,7 @@ int iwl_mvm_power_disable(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
177 | iwlwifi_mod_params.power_save) | 182 | iwlwifi_mod_params.power_save) |
178 | cmd.flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); | 183 | cmd.flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); |
179 | 184 | ||
180 | IWL_DEBUG_POWER(mvm, | 185 | iwl_mvm_power_log(mvm, &cmd); |
181 | "Sending power table command power level %d, flags = 0x%X\n", | ||
182 | iwlmvm_mod_params.power_scheme, le16_to_cpu(cmd.flags)); | ||
183 | 186 | ||
184 | return iwl_mvm_send_cmd_pdu(mvm, POWER_TABLE_CMD, CMD_ASYNC, | 187 | return iwl_mvm_send_cmd_pdu(mvm, POWER_TABLE_CMD, CMD_ASYNC, |
185 | sizeof(cmd), &cmd); | 188 | sizeof(cmd), &cmd); |