aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-12-18 21:37:31 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:15 -0500
commit978785a3892b34448446e8c8a17f48454f1bdd6a (patch)
tree76d50b34bc166d9400c99335c533a4681ff8887a /drivers/net/wireless/iwlwifi/iwl-agn-rs.c
parent146846aed534aa0eb1fb0a8e6c0394190e5c1ad7 (diff)
iwlwifi: clean up printing
Use IWL_ macros where possible to unify debug output usage. Define new unconditional printouts IWL_ERR, IWL_WARN, IWL_INFO, and IWL_CRIT which don't use hidden priv pointer. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 19dd9fd9c09a..c0f8b96b9f8b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -463,8 +463,9 @@ static int rs_collect_tx_data(struct iwl_rate_scale_data *windows,
463 * Fill uCode API rate_n_flags field, based on "search" or "active" table. 463 * Fill uCode API rate_n_flags field, based on "search" or "active" table.
464 */ 464 */
465/* FIXME:RS:remove this function and put the flags statically in the table */ 465/* FIXME:RS:remove this function and put the flags statically in the table */
466static u32 rate_n_flags_from_tbl(struct iwl_scale_tbl_info *tbl, 466static u32 rate_n_flags_from_tbl(struct iwl_priv *priv,
467 int index, u8 use_green) 467 struct iwl_scale_tbl_info *tbl,
468 int index, u8 use_green)
468{ 469{
469 u32 rate_n_flags = 0; 470 u32 rate_n_flags = 0;
470 471
@@ -475,8 +476,7 @@ static u32 rate_n_flags_from_tbl(struct iwl_scale_tbl_info *tbl,
475 476
476 } else if (is_Ht(tbl->lq_type)) { 477 } else if (is_Ht(tbl->lq_type)) {
477 if (index > IWL_LAST_OFDM_RATE) { 478 if (index > IWL_LAST_OFDM_RATE) {
478 printk(KERN_ERR RS_NAME": Invalid HT rate index %d\n", 479 IWL_ERR(priv, "Invalid HT rate index %d\n", index);
479 index);
480 index = IWL_LAST_OFDM_RATE; 480 index = IWL_LAST_OFDM_RATE;
481 } 481 }
482 rate_n_flags = RATE_MCS_HT_MSK; 482 rate_n_flags = RATE_MCS_HT_MSK;
@@ -488,8 +488,7 @@ static u32 rate_n_flags_from_tbl(struct iwl_scale_tbl_info *tbl,
488 else 488 else
489 rate_n_flags |= iwl_rates[index].plcp_mimo3; 489 rate_n_flags |= iwl_rates[index].plcp_mimo3;
490 } else { 490 } else {
491 printk(KERN_ERR RS_NAME": Invalid tbl->lq_type %d\n", 491 IWL_ERR(priv, "Invalid tbl->lq_type %d\n", tbl->lq_type);
492 tbl->lq_type);
493 } 492 }
494 493
495 rate_n_flags |= ((tbl->ant_type << RATE_MCS_ANT_POS) & 494 rate_n_flags |= ((tbl->ant_type << RATE_MCS_ANT_POS) &
@@ -509,8 +508,7 @@ static u32 rate_n_flags_from_tbl(struct iwl_scale_tbl_info *tbl,
509 rate_n_flags |= RATE_MCS_GF_MSK; 508 rate_n_flags |= RATE_MCS_GF_MSK;
510 if (is_siso(tbl->lq_type) && tbl->is_SGI) { 509 if (is_siso(tbl->lq_type) && tbl->is_SGI) {
511 rate_n_flags &= ~RATE_MCS_SGI_MSK; 510 rate_n_flags &= ~RATE_MCS_SGI_MSK;
512 printk(KERN_ERR RS_NAME 511 IWL_ERR(priv, "GF was set with SGI:SISO\n");
513 ": GF was set with SGI:SISO\n");
514 } 512 }
515 } 513 }
516 } 514 }
@@ -761,7 +759,7 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
761 low = scale_index; 759 low = scale_index;
762 760
763out: 761out:
764 return rate_n_flags_from_tbl(tbl, low, is_green); 762 return rate_n_flags_from_tbl(lq_sta->drv, tbl, low, is_green);
765} 763}
766 764
767/* 765/*
@@ -1179,7 +1177,7 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv,
1179 rate, rate_mask); 1177 rate, rate_mask);
1180 return -1; 1178 return -1;
1181 } 1179 }
1182 tbl->current_rate = rate_n_flags_from_tbl(tbl, rate, is_green); 1180 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, rate, is_green);
1183 1181
1184 IWL_DEBUG_RATE("LQ: Switch to new mcs %X index is green %X\n", 1182 IWL_DEBUG_RATE("LQ: Switch to new mcs %X index is green %X\n",
1185 tbl->current_rate, is_green); 1183 tbl->current_rate, is_green);
@@ -1239,7 +1237,7 @@ static int rs_switch_to_siso(struct iwl_priv *priv,
1239 rate, rate_mask); 1237 rate, rate_mask);
1240 return -1; 1238 return -1;
1241 } 1239 }
1242 tbl->current_rate = rate_n_flags_from_tbl(tbl, rate, is_green); 1240 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, rate, is_green);
1243 IWL_DEBUG_RATE("LQ: Switch to new mcs %X index is green %X\n", 1241 IWL_DEBUG_RATE("LQ: Switch to new mcs %X index is green %X\n",
1244 tbl->current_rate, is_green); 1242 tbl->current_rate, is_green);
1245 return 0; 1243 return 0;
@@ -1442,8 +1440,9 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1442 if (tpt >= search_tbl->expected_tpt[index]) 1440 if (tpt >= search_tbl->expected_tpt[index])
1443 break; 1441 break;
1444 } 1442 }
1445 search_tbl->current_rate = rate_n_flags_from_tbl( 1443 search_tbl->current_rate =
1446 search_tbl, index, is_green); 1444 rate_n_flags_from_tbl(priv, search_tbl,
1445 index, is_green);
1447 goto out; 1446 goto out;
1448 } 1447 }
1449 tbl->action++; 1448 tbl->action++;
@@ -1554,8 +1553,9 @@ static int rs_move_mimo_to_other(struct iwl_priv *priv,
1554 if (tpt >= search_tbl->expected_tpt[index]) 1553 if (tpt >= search_tbl->expected_tpt[index])
1555 break; 1554 break;
1556 } 1555 }
1557 search_tbl->current_rate = rate_n_flags_from_tbl( 1556 search_tbl->current_rate =
1558 search_tbl, index, is_green); 1557 rate_n_flags_from_tbl(priv, search_tbl,
1558 index, is_green);
1559 goto out; 1559 goto out;
1560 1560
1561 } 1561 }
@@ -1947,7 +1947,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1947lq_update: 1947lq_update:
1948 /* Replace uCode's rate table for the destination station. */ 1948 /* Replace uCode's rate table for the destination station. */
1949 if (update_lq) { 1949 if (update_lq) {
1950 rate = rate_n_flags_from_tbl(tbl, index, is_green); 1950 rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
1951 rs_fill_link_cmd(priv, lq_sta, rate); 1951 rs_fill_link_cmd(priv, lq_sta, rate);
1952 iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC); 1952 iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC);
1953 } 1953 }
@@ -2031,7 +2031,7 @@ lq_update:
2031 } 2031 }
2032 2032
2033out: 2033out:
2034 tbl->current_rate = rate_n_flags_from_tbl(tbl, index, is_green); 2034 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
2035 i = index; 2035 i = index;
2036 lq_sta->last_txrate_idx = i; 2036 lq_sta->last_txrate_idx = i;
2037 2037
@@ -2084,7 +2084,7 @@ static void rs_initialize_lq(struct iwl_priv *priv,
2084 if (!rs_is_valid_ant(valid_tx_ant, tbl->ant_type)) 2084 if (!rs_is_valid_ant(valid_tx_ant, tbl->ant_type))
2085 rs_toggle_antenna(valid_tx_ant, &rate, tbl); 2085 rs_toggle_antenna(valid_tx_ant, &rate, tbl);
2086 2086
2087 rate = rate_n_flags_from_tbl(tbl, rate_idx, use_green); 2087 rate = rate_n_flags_from_tbl(priv, tbl, rate_idx, use_green);
2088 tbl->current_rate = rate; 2088 tbl->current_rate = rate;
2089 rs_set_expected_tpt_table(lq_sta, tbl); 2089 rs_set_expected_tpt_table(lq_sta, tbl);
2090 rs_fill_link_cmd(NULL, lq_sta, rate); 2090 rs_fill_link_cmd(NULL, lq_sta, rate);