aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
diff options
context:
space:
mode:
authorEster Kummer <ester.kummer@intel.com>2008-05-04 22:22:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-14 16:29:45 -0400
commitbf403db8a2f5580a5eb355a109d29b9287ca51e1 (patch)
tree90a462e9256170ebbf2025ffc9c01e48bb1c08d8 /drivers/net/wireless/iwlwifi/iwl-4965-rs.c
parent2469bf2e9938eef3c6ab0951985b050ff1f8c94f (diff)
iwlwifi: move per driverdebug_level to per device
This patch ports the debug_level to iwl_priv and changes the format of the debug prints. Signed-off-by: Ester Kummer <ester.kummer@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-4965-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index e3444c4ea1a..5baa000c788 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -662,7 +662,8 @@ static u16 rs_get_supported_rates(struct iwl4965_lq_sta *lq_sta,
662 } 662 }
663} 663}
664 664
665static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type) 665static u16 rs_get_adjacent_rate(struct iwl_priv *priv, u8 index, u16 rate_mask,
666 int rate_type)
666{ 667{
667 u8 high = IWL_RATE_INVALID; 668 u8 high = IWL_RATE_INVALID;
668 u8 low = IWL_RATE_INVALID; 669 u8 low = IWL_RATE_INVALID;
@@ -763,7 +764,8 @@ static u32 rs_get_lower_rate(struct iwl4965_lq_sta *lq_sta,
763 goto out; 764 goto out;
764 } 765 }
765 766
766 high_low = rs_get_adjacent_rate(scale_index, rate_mask, tbl->lq_type); 767 high_low = rs_get_adjacent_rate(lq_sta->drv, scale_index, rate_mask,
768 tbl->lq_type);
767 low = high_low & 0xff; 769 low = high_low & 0xff;
768 770
769 if (low == IWL_RATE_INVALID) 771 if (low == IWL_RATE_INVALID)
@@ -990,7 +992,7 @@ out:
990 * These control how long we stay using same modulation mode before 992 * These control how long we stay using same modulation mode before
991 * searching for a new mode. 993 * searching for a new mode.
992 */ 994 */
993static void rs_set_stay_in_table(u8 is_legacy, 995static void rs_set_stay_in_table(struct iwl_priv *priv, u8 is_legacy,
994 struct iwl4965_lq_sta *lq_sta) 996 struct iwl4965_lq_sta *lq_sta)
995{ 997{
996 IWL_DEBUG_RATE("we are staying in the same table\n"); 998 IWL_DEBUG_RATE("we are staying in the same table\n");
@@ -1079,7 +1081,8 @@ static s32 rs_get_best_rate(struct iwl_priv *priv,
1079 new_rate = high = low = start_hi = IWL_RATE_INVALID; 1081 new_rate = high = low = start_hi = IWL_RATE_INVALID;
1080 1082
1081 for (; ;) { 1083 for (; ;) {
1082 high_low = rs_get_adjacent_rate(rate, rate_mask, tbl->lq_type); 1084 high_low = rs_get_adjacent_rate(priv, rate, rate_mask,
1085 tbl->lq_type);
1083 1086
1084 low = high_low & 0xff; 1087 low = high_low & 0xff;
1085 high = (high_low >> 8) & 0xff; 1088 high = (high_low >> 8) & 0xff;
@@ -1565,7 +1568,9 @@ static void rs_stay_in_table(struct iwl4965_lq_sta *lq_sta)
1565 int i; 1568 int i;
1566 int active_tbl; 1569 int active_tbl;
1567 int flush_interval_passed = 0; 1570 int flush_interval_passed = 0;
1571 struct iwl_priv *priv;
1568 1572
1573 priv = lq_sta->drv;
1569 active_tbl = lq_sta->active_tbl; 1574 active_tbl = lq_sta->active_tbl;
1570 1575
1571 tbl = &(lq_sta->lq_info[active_tbl]); 1576 tbl = &(lq_sta->lq_info[active_tbl]);
@@ -1838,7 +1843,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1838 1843
1839 /* (Else) not in search of better modulation mode, try for better 1844 /* (Else) not in search of better modulation mode, try for better
1840 * starting rate, while staying in this mode. */ 1845 * starting rate, while staying in this mode. */
1841 high_low = rs_get_adjacent_rate(index, rate_scale_index_msk, 1846 high_low = rs_get_adjacent_rate(priv, index, rate_scale_index_msk,
1842 tbl->lq_type); 1847 tbl->lq_type);
1843 low = high_low & 0xff; 1848 low = high_low & 0xff;
1844 high = (high_low >> 8) & 0xff; 1849 high = (high_low >> 8) & 0xff;
@@ -1998,7 +2003,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1998 (lq_sta->action_counter >= 1)) { 2003 (lq_sta->action_counter >= 1)) {
1999 lq_sta->action_counter = 0; 2004 lq_sta->action_counter = 0;
2000 IWL_DEBUG_RATE("LQ: STAY in legacy table\n"); 2005 IWL_DEBUG_RATE("LQ: STAY in legacy table\n");
2001 rs_set_stay_in_table(1, lq_sta); 2006 rs_set_stay_in_table(priv, 1, lq_sta);
2002 } 2007 }
2003 2008
2004 /* If we're in an HT mode, and all 3 mode switch actions 2009 /* If we're in an HT mode, and all 3 mode switch actions
@@ -2015,7 +2020,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
2015 } 2020 }
2016#endif /*CONFIG_IWL4965_HT */ 2021#endif /*CONFIG_IWL4965_HT */
2017 lq_sta->action_counter = 0; 2022 lq_sta->action_counter = 0;
2018 rs_set_stay_in_table(0, lq_sta); 2023 rs_set_stay_in_table(priv, 0, lq_sta);
2019 } 2024 }
2020 2025
2021 /* 2026 /*
@@ -2169,11 +2174,13 @@ out:
2169 rcu_read_unlock(); 2174 rcu_read_unlock();
2170} 2175}
2171 2176
2172static void *rs_alloc_sta(void *priv, gfp_t gfp) 2177static void *rs_alloc_sta(void *priv_rate, gfp_t gfp)
2173{ 2178{
2174 struct iwl4965_lq_sta *lq_sta; 2179 struct iwl4965_lq_sta *lq_sta;
2180 struct iwl_priv *priv;
2175 int i, j; 2181 int i, j;
2176 2182
2183 priv = (struct iwl_priv *)priv_rate;
2177 IWL_DEBUG_RATE("create station rate scale window\n"); 2184 IWL_DEBUG_RATE("create station rate scale window\n");
2178 2185
2179 lq_sta = kzalloc(sizeof(struct iwl4965_lq_sta), gfp); 2186 lq_sta = kzalloc(sizeof(struct iwl4965_lq_sta), gfp);
@@ -2443,10 +2450,12 @@ static void rs_clear(void *priv_rate)
2443 IWL_DEBUG_RATE("leave\n"); 2450 IWL_DEBUG_RATE("leave\n");
2444} 2451}
2445 2452
2446static void rs_free_sta(void *priv, void *priv_sta) 2453static void rs_free_sta(void *priv_rate, void *priv_sta)
2447{ 2454{
2448 struct iwl4965_lq_sta *lq_sta = priv_sta; 2455 struct iwl4965_lq_sta *lq_sta = priv_sta;
2456 struct iwl_priv *priv;
2449 2457
2458 priv = (struct iwl_priv *)priv_rate;
2450 IWL_DEBUG_RATE("enter\n"); 2459 IWL_DEBUG_RATE("enter\n");
2451 kfree(lq_sta); 2460 kfree(lq_sta);
2452 IWL_DEBUG_RATE("leave\n"); 2461 IWL_DEBUG_RATE("leave\n");
@@ -2462,6 +2471,9 @@ static int open_file_generic(struct inode *inode, struct file *file)
2462static void rs_dbgfs_set_mcs(struct iwl4965_lq_sta *lq_sta, 2471static void rs_dbgfs_set_mcs(struct iwl4965_lq_sta *lq_sta,
2463 u32 *rate_n_flags, int index) 2472 u32 *rate_n_flags, int index)
2464{ 2473{
2474 struct iwl_priv *priv;
2475
2476 priv = lq_sta->drv;
2465 if (lq_sta->dbg_fixed_rate) { 2477 if (lq_sta->dbg_fixed_rate) {
2466 if (index < 12) { 2478 if (index < 12) {
2467 *rate_n_flags = lq_sta->dbg_fixed_rate; 2479 *rate_n_flags = lq_sta->dbg_fixed_rate;
@@ -2481,10 +2493,12 @@ static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
2481 const char __user *user_buf, size_t count, loff_t *ppos) 2493 const char __user *user_buf, size_t count, loff_t *ppos)
2482{ 2494{
2483 struct iwl4965_lq_sta *lq_sta = file->private_data; 2495 struct iwl4965_lq_sta *lq_sta = file->private_data;
2496 struct iwl_priv *priv;
2484 char buf[64]; 2497 char buf[64];
2485 int buf_size; 2498 int buf_size;
2486 u32 parsed_rate; 2499 u32 parsed_rate;
2487 2500
2501 priv = lq_sta->drv;
2488 memset(buf, 0, sizeof(buf)); 2502 memset(buf, 0, sizeof(buf));
2489 buf_size = min(count, sizeof(buf) - 1); 2503 buf_size = min(count, sizeof(buf) - 1);
2490 if (copy_from_user(buf, user_buf, buf_size)) 2504 if (copy_from_user(buf, user_buf, buf_size))