diff options
author | Mohamed Abbas <mohamed.abbas@intel.com> | 2009-04-20 17:37:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:57:19 -0400 |
commit | 447fee700f6cb7ada906c5db61c6c045741893e8 (patch) | |
tree | be2fc35c315fc0467fe1471e6f536b6da6015233 /drivers/net | |
parent | 279b05d4362472ae9269f982f00e644265bdbf94 (diff) |
iwlcore: Fix stay in table function.
Function rs_stay_in_table was flushing the rate scale table way to early. time_after
macro in expecting long value and was failing because we passing u32 value.
Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 98b6b37951b3..3504279c7586 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -52,7 +52,7 @@ | |||
52 | /* max allowed rate miss before sync LQ cmd */ | 52 | /* max allowed rate miss before sync LQ cmd */ |
53 | #define IWL_MISSED_RATE_MAX 15 | 53 | #define IWL_MISSED_RATE_MAX 15 |
54 | /* max time to accum history 2 seconds */ | 54 | /* max time to accum history 2 seconds */ |
55 | #define IWL_RATE_SCALE_FLUSH_INTVL (2*HZ) | 55 | #define IWL_RATE_SCALE_FLUSH_INTVL (3*HZ) |
56 | 56 | ||
57 | static u8 rs_ht_to_legacy[] = { | 57 | static u8 rs_ht_to_legacy[] = { |
58 | IWL_RATE_6M_INDEX, IWL_RATE_6M_INDEX, | 58 | IWL_RATE_6M_INDEX, IWL_RATE_6M_INDEX, |
@@ -135,7 +135,7 @@ struct iwl_lq_sta { | |||
135 | u32 table_count; | 135 | u32 table_count; |
136 | u32 total_failed; /* total failed frames, any/all rates */ | 136 | u32 total_failed; /* total failed frames, any/all rates */ |
137 | u32 total_success; /* total successful frames, any/all rates */ | 137 | u32 total_success; /* total successful frames, any/all rates */ |
138 | u32 flush_timer; /* time staying in mode before new search */ | 138 | u64 flush_timer; /* time staying in mode before new search */ |
139 | 139 | ||
140 | u8 action_counter; /* # mode-switch actions tried */ | 140 | u8 action_counter; /* # mode-switch actions tried */ |
141 | u8 is_green; | 141 | u8 is_green; |
@@ -1025,6 +1025,7 @@ static void rs_set_stay_in_table(struct iwl_priv *priv, u8 is_legacy, | |||
1025 | lq_sta->table_count = 0; | 1025 | lq_sta->table_count = 0; |
1026 | lq_sta->total_failed = 0; | 1026 | lq_sta->total_failed = 0; |
1027 | lq_sta->total_success = 0; | 1027 | lq_sta->total_success = 0; |
1028 | lq_sta->flush_timer = jiffies; | ||
1028 | } | 1029 | } |
1029 | 1030 | ||
1030 | /* | 1031 | /* |
@@ -1914,8 +1915,8 @@ static void rs_stay_in_table(struct iwl_lq_sta *lq_sta) | |||
1914 | /* Elapsed time using current modulation mode */ | 1915 | /* Elapsed time using current modulation mode */ |
1915 | if (lq_sta->flush_timer) | 1916 | if (lq_sta->flush_timer) |
1916 | flush_interval_passed = | 1917 | flush_interval_passed = |
1917 | time_after(jiffies, | 1918 | time_after(jiffies, |
1918 | (unsigned long)(lq_sta->flush_timer + | 1919 | (unsigned long)(lq_sta->flush_timer + |
1919 | IWL_RATE_SCALE_FLUSH_INTVL)); | 1920 | IWL_RATE_SCALE_FLUSH_INTVL)); |
1920 | 1921 | ||
1921 | /* | 1922 | /* |
@@ -2249,6 +2250,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
2249 | update_lq = 1; | 2250 | update_lq = 1; |
2250 | index = low; | 2251 | index = low; |
2251 | } | 2252 | } |
2253 | |||
2252 | break; | 2254 | break; |
2253 | case 1: | 2255 | case 1: |
2254 | /* Increase starting rate, update uCode's rate table */ | 2256 | /* Increase starting rate, update uCode's rate table */ |
@@ -2314,8 +2316,11 @@ lq_update: | |||
2314 | tbl->current_rate, index); | 2316 | tbl->current_rate, index); |
2315 | rs_fill_link_cmd(priv, lq_sta, tbl->current_rate); | 2317 | rs_fill_link_cmd(priv, lq_sta, tbl->current_rate); |
2316 | iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC); | 2318 | iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC); |
2317 | } | 2319 | } else |
2320 | done_search = 1; | ||
2321 | } | ||
2318 | 2322 | ||
2323 | if (done_search && !lq_sta->stay_in_tbl) { | ||
2319 | /* If the "active" (non-search) mode was legacy, | 2324 | /* If the "active" (non-search) mode was legacy, |
2320 | * and we've tried switching antennas, | 2325 | * and we've tried switching antennas, |
2321 | * but we haven't been able to try HT modes (not available), | 2326 | * but we haven't been able to try HT modes (not available), |
@@ -2350,17 +2355,6 @@ lq_update: | |||
2350 | lq_sta->action_counter = 0; | 2355 | lq_sta->action_counter = 0; |
2351 | rs_set_stay_in_table(priv, 0, lq_sta); | 2356 | rs_set_stay_in_table(priv, 0, lq_sta); |
2352 | } | 2357 | } |
2353 | |||
2354 | /* | ||
2355 | * Else, don't search for a new modulation mode. | ||
2356 | * Put new timestamp in stay-in-modulation-mode flush timer if: | ||
2357 | * 1) Not changing rates right now | ||
2358 | * 2) Not just finishing up a search | ||
2359 | * 3) flush timer is empty | ||
2360 | */ | ||
2361 | } else { | ||
2362 | if ((!update_lq) && (!done_search) && (!lq_sta->flush_timer)) | ||
2363 | lq_sta->flush_timer = jiffies; | ||
2364 | } | 2358 | } |
2365 | 2359 | ||
2366 | out: | 2360 | out: |