diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-rs.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index f65c308a6714..af6b9d444778 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -124,7 +124,7 @@ static struct iwl3945_tpt_entry iwl3945_tpt_table_g[] = { | |||
124 | #define IWL39_RATE_HIGH_TH 11520 | 124 | #define IWL39_RATE_HIGH_TH 11520 |
125 | #define IWL_SUCCESS_UP_TH 8960 | 125 | #define IWL_SUCCESS_UP_TH 8960 |
126 | #define IWL_SUCCESS_DOWN_TH 10880 | 126 | #define IWL_SUCCESS_DOWN_TH 10880 |
127 | #define IWL_RATE_MIN_FAILURE_TH 8 | 127 | #define IWL_RATE_MIN_FAILURE_TH 6 |
128 | #define IWL_RATE_MIN_SUCCESS_TH 8 | 128 | #define IWL_RATE_MIN_SUCCESS_TH 8 |
129 | #define IWL_RATE_DECREASE_TH 1920 | 129 | #define IWL_RATE_DECREASE_TH 1920 |
130 | #define IWL_RATE_RETRY_TH 15 | 130 | #define IWL_RATE_RETRY_TH 15 |
@@ -488,7 +488,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband | |||
488 | 488 | ||
489 | IWL_DEBUG_RATE(priv, "enter\n"); | 489 | IWL_DEBUG_RATE(priv, "enter\n"); |
490 | 490 | ||
491 | retries = info->status.rates[0].count - 1; | 491 | retries = info->status.rates[0].count; |
492 | /* Sanity Check for retries */ | 492 | /* Sanity Check for retries */ |
493 | if (retries > IWL_RATE_RETRY_TH) | 493 | if (retries > IWL_RATE_RETRY_TH) |
494 | retries = IWL_RATE_RETRY_TH; | 494 | retries = IWL_RATE_RETRY_TH; |
@@ -791,16 +791,15 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
791 | if ((window->success_ratio < IWL_RATE_DECREASE_TH) || !current_tpt) { | 791 | if ((window->success_ratio < IWL_RATE_DECREASE_TH) || !current_tpt) { |
792 | IWL_DEBUG_RATE(priv, "decrease rate because of low success_ratio\n"); | 792 | IWL_DEBUG_RATE(priv, "decrease rate because of low success_ratio\n"); |
793 | scale_action = -1; | 793 | scale_action = -1; |
794 | |||
795 | /* No throughput measured yet for adjacent rates, | 794 | /* No throughput measured yet for adjacent rates, |
796 | * try increase */ | 795 | * try increase */ |
797 | } else if ((low_tpt == IWL_INVALID_VALUE) && | 796 | } else if ((low_tpt == IWL_INVALID_VALUE) && |
798 | (high_tpt == IWL_INVALID_VALUE)) { | 797 | (high_tpt == IWL_INVALID_VALUE)) { |
799 | 798 | ||
800 | if (high != IWL_RATE_INVALID && window->success_counter >= IWL_RATE_INCREASE_TH) | 799 | if (high != IWL_RATE_INVALID && window->success_ratio >= IWL_RATE_INCREASE_TH) |
801 | scale_action = 1; | 800 | scale_action = 1; |
802 | else if (low != IWL_RATE_INVALID) | 801 | else if (low != IWL_RATE_INVALID) |
803 | scale_action = -1; | 802 | scale_action = 0; |
804 | 803 | ||
805 | /* Both adjacent throughputs are measured, but neither one has | 804 | /* Both adjacent throughputs are measured, but neither one has |
806 | * better throughput; we're using the best rate, don't change | 805 | * better throughput; we're using the best rate, don't change |
@@ -826,14 +825,14 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
826 | else { | 825 | else { |
827 | IWL_DEBUG_RATE(priv, | 826 | IWL_DEBUG_RATE(priv, |
828 | "decrease rate because of high tpt\n"); | 827 | "decrease rate because of high tpt\n"); |
829 | scale_action = -1; | 828 | scale_action = 0; |
830 | } | 829 | } |
831 | } else if (low_tpt != IWL_INVALID_VALUE) { | 830 | } else if (low_tpt != IWL_INVALID_VALUE) { |
832 | if (low_tpt > current_tpt) { | 831 | if (low_tpt > current_tpt) { |
833 | IWL_DEBUG_RATE(priv, | 832 | IWL_DEBUG_RATE(priv, |
834 | "decrease rate because of low tpt\n"); | 833 | "decrease rate because of low tpt\n"); |
835 | scale_action = -1; | 834 | scale_action = -1; |
836 | } else if (window->success_counter >= IWL_RATE_INCREASE_TH) { | 835 | } else if (window->success_ratio >= IWL_RATE_INCREASE_TH) { |
837 | /* Lower rate has better | 836 | /* Lower rate has better |
838 | * throughput,decrease rate */ | 837 | * throughput,decrease rate */ |
839 | scale_action = 1; | 838 | scale_action = 1; |