diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-12-03 13:33:36 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-12-13 18:53:09 -0500 |
commit | 33c68770a8605d84aea35c2cd90009edfc4b161a (patch) | |
tree | 07558c7cd64dfee385abe39516bfa1c5e2655cb8 /drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c | |
parent | d058ff8b9255b2a15bcb040cc9901baca66dc9c4 (diff) |
iwlagn: More detail tx power logging
For enhanced tx power table in EEPROM, add more detail logging
to help debugging
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c index 77d92b71be81..97906dd442e6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c | |||
@@ -203,15 +203,6 @@ static s8 iwl_get_max_txpower_avg(struct iwl_priv *priv, | |||
203 | { | 203 | { |
204 | s8 max_txpower_avg = 0; /* (dBm) */ | 204 | s8 max_txpower_avg = 0; /* (dBm) */ |
205 | 205 | ||
206 | IWL_DEBUG_EEPROM(priv, "%d - " | ||
207 | "chain_a: %d dB chain_b: %d dB " | ||
208 | "chain_c: %d dB mimo2: %d dB mimo3: %d dB\n", | ||
209 | element, | ||
210 | enhanced_txpower[element].chain_a_max >> 1, | ||
211 | enhanced_txpower[element].chain_b_max >> 1, | ||
212 | enhanced_txpower[element].chain_c_max >> 1, | ||
213 | enhanced_txpower[element].mimo2_max >> 1, | ||
214 | enhanced_txpower[element].mimo3_max >> 1); | ||
215 | /* Take the highest tx power from any valid chains */ | 206 | /* Take the highest tx power from any valid chains */ |
216 | if ((priv->cfg->valid_tx_ant & ANT_A) && | 207 | if ((priv->cfg->valid_tx_ant & ANT_A) && |
217 | (enhanced_txpower[element].chain_a_max > max_txpower_avg)) | 208 | (enhanced_txpower[element].chain_a_max > max_txpower_avg)) |
@@ -279,6 +270,9 @@ iwlcore_eeprom_enh_txp_read_element(struct iwl_priv *priv, | |||
279 | #define EEPROM_TXP_ENTRY_LEN sizeof(struct iwl_eeprom_enhanced_txpwr) | 270 | #define EEPROM_TXP_ENTRY_LEN sizeof(struct iwl_eeprom_enhanced_txpwr) |
280 | #define EEPROM_TXP_SZ_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT_SIZE) | 271 | #define EEPROM_TXP_SZ_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT_SIZE) |
281 | 272 | ||
273 | #define TXP_CHECK_AND_PRINT(x) ((txp->flags & IWL_EEPROM_ENH_TXP_FL_##x) \ | ||
274 | ? # x " " : "") | ||
275 | |||
282 | void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | 276 | void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) |
283 | { | 277 | { |
284 | struct iwl_eeprom_enhanced_txpwr *txp_array, *txp; | 278 | struct iwl_eeprom_enhanced_txpwr *txp_array, *txp; |
@@ -293,13 +287,39 @@ void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | |||
293 | entries = le16_to_cpup(txp_len) * 2 / EEPROM_TXP_ENTRY_LEN; | 287 | entries = le16_to_cpup(txp_len) * 2 / EEPROM_TXP_ENTRY_LEN; |
294 | 288 | ||
295 | txp_array = (void *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_OFFS); | 289 | txp_array = (void *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_OFFS); |
290 | |||
296 | for (idx = 0; idx < entries; idx++) { | 291 | for (idx = 0; idx < entries; idx++) { |
297 | txp = &txp_array[idx]; | 292 | txp = &txp_array[idx]; |
298 | |||
299 | /* skip invalid entries */ | 293 | /* skip invalid entries */ |
300 | if (!(txp->flags & IWL_EEPROM_ENH_TXP_FL_VALID)) | 294 | if (!(txp->flags & IWL_EEPROM_ENH_TXP_FL_VALID)) |
301 | continue; | 295 | continue; |
302 | 296 | ||
297 | IWL_DEBUG_EEPROM(priv, "%s %d:\t %s%s%s%s%s%s%s%s (0x%02x)\n", | ||
298 | (txp->channel && (txp->flags & | ||
299 | IWL_EEPROM_ENH_TXP_FL_COMMON_TYPE)) ? | ||
300 | "Common " : (txp->channel) ? | ||
301 | "Channel" : "Common", | ||
302 | (txp->channel), | ||
303 | TXP_CHECK_AND_PRINT(VALID), | ||
304 | TXP_CHECK_AND_PRINT(BAND_52G), | ||
305 | TXP_CHECK_AND_PRINT(OFDM), | ||
306 | TXP_CHECK_AND_PRINT(40MHZ), | ||
307 | TXP_CHECK_AND_PRINT(HT_AP), | ||
308 | TXP_CHECK_AND_PRINT(RES1), | ||
309 | TXP_CHECK_AND_PRINT(RES2), | ||
310 | TXP_CHECK_AND_PRINT(COMMON_TYPE), | ||
311 | txp->flags); | ||
312 | IWL_DEBUG_EEPROM(priv, "\t\t chain_A: 0x%02x " | ||
313 | "chain_B: 0X%02x chain_C: 0X%02x\n", | ||
314 | txp->chain_a_max, txp->chain_b_max, | ||
315 | txp->chain_c_max); | ||
316 | IWL_DEBUG_EEPROM(priv, "\t\t MIMO2: 0x%02x " | ||
317 | "MIMO3: 0x%02x High 20_on_40: 0x%02x " | ||
318 | "Low 20_on_40: 0x%02x\n", | ||
319 | txp->mimo2_max, txp->mimo3_max, | ||
320 | ((txp->delta_20_in_40 & 0xf0) >> 4), | ||
321 | (txp->delta_20_in_40 & 0x0f)); | ||
322 | |||
303 | max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx, | 323 | max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx, |
304 | &max_txp_avg_halfdbm); | 324 | &max_txp_avg_halfdbm); |
305 | 325 | ||