aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJahnavi Meher <jahnavi.meher@gmail.com>2014-06-16 10:13:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-06-19 15:49:22 -0400
commit0d59f5267d93f71b3d0c3c80f4948065e77ee75c (patch)
treeaf5942d70d82c94d42fb89b9679518a474596780
parent8701d0312880fcddff757d153c7591d8caad4217 (diff)
rsi: Changed rate handling.
Changed rate handling. Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_mgmt.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
index 5c122e8cd526..f5182cd67f53 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
@@ -942,7 +942,7 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)
942 struct ieee80211_hw *hw = common->priv->hw; 942 struct ieee80211_hw *hw = common->priv->hw;
943 u8 band = hw->conf.chandef.chan->band; 943 u8 band = hw->conf.chandef.chan->band;
944 u8 num_supported_rates = 0; 944 u8 num_supported_rates = 0;
945 u8 rate_offset = 0; 945 u8 rate_table_offset, rate_offset = 0;
946 u32 rate_bitmap = common->bitrate_mask[band]; 946 u32 rate_bitmap = common->bitrate_mask[band];
947 947
948 u16 *selected_rates, min_rate; 948 u16 *selected_rates, min_rate;
@@ -978,14 +978,18 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)
978 if (common->channel_width == BW_40MHZ) 978 if (common->channel_width == BW_40MHZ)
979 auto_rate->desc_word[7] |= cpu_to_le16(1); 979 auto_rate->desc_word[7] |= cpu_to_le16(1);
980 980
981 if (band == IEEE80211_BAND_2GHZ) 981 if (band == IEEE80211_BAND_2GHZ) {
982 min_rate = STD_RATE_01; 982 min_rate = RSI_RATE_1;
983 else 983 rate_table_offset = 0;
984 min_rate = STD_RATE_06; 984 } else {
985 min_rate = RSI_RATE_6;
986 rate_table_offset = 4;
987 }
985 988
986 for (ii = 0, jj = 0; ii < ARRAY_SIZE(rsi_rates); ii++) { 989 for (ii = 0, jj = 0; ii < ARRAY_SIZE(rsi_rates); ii++) {
987 if (rate_bitmap & BIT(ii)) { 990 if (rate_bitmap & BIT(ii)) {
988 selected_rates[jj++] = (rsi_rates[ii].bitrate / 5); 991 selected_rates[jj++] =
992 (rsi_rates[ii + rate_table_offset].bitrate / 5);
989 rate_offset++; 993 rate_offset++;
990 } 994 }
991 } 995 }
@@ -998,13 +1002,6 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)
998 rate_offset += ARRAY_SIZE(mcs); 1002 rate_offset += ARRAY_SIZE(mcs);
999 } 1003 }
1000 1004
1001 if (rate_offset < (RSI_TBL_SZ / 2) - 1) {
1002 for (ii = jj; ii < (RSI_TBL_SZ / 2); ii++) {
1003 selected_rates[jj++] = min_rate;
1004 rate_offset++;
1005 }
1006 }
1007
1008 sort(selected_rates, jj, sizeof(u16), &rsi_compare, NULL); 1005 sort(selected_rates, jj, sizeof(u16), &rsi_compare, NULL);
1009 1006
1010 /* mapping the rates to RSI rates */ 1007 /* mapping the rates to RSI rates */
@@ -1020,25 +1017,25 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)
1020 1017
1021 /* loading HT rates in the bottom half of the auto rate table */ 1018 /* loading HT rates in the bottom half of the auto rate table */
1022 if (common->vif_info[0].is_ht) { 1019 if (common->vif_info[0].is_ht) {
1023 if (common->vif_info[0].sgi)
1024 auto_rate->supported_rates[rate_offset++] =
1025 cpu_to_le16(RSI_RATE_MCS7_SG);
1026
1027 for (ii = rate_offset, kk = ARRAY_SIZE(rsi_mcsrates) - 1; 1020 for (ii = rate_offset, kk = ARRAY_SIZE(rsi_mcsrates) - 1;
1028 ii < rate_offset + 2 * ARRAY_SIZE(rsi_mcsrates); ii++) { 1021 ii < rate_offset + 2 * ARRAY_SIZE(rsi_mcsrates); ii++) {
1029 if (common->vif_info[0].sgi) 1022 if (common->vif_info[0].sgi ||
1023 conf_is_ht40(&common->priv->hw->conf))
1030 auto_rate->supported_rates[ii++] = 1024 auto_rate->supported_rates[ii++] =
1031 cpu_to_le16(rsi_mcsrates[kk] | BIT(9)); 1025 cpu_to_le16(rsi_mcsrates[kk] | BIT(9));
1032 auto_rate->supported_rates[ii] = 1026 auto_rate->supported_rates[ii] =
1033 cpu_to_le16(rsi_mcsrates[kk--]); 1027 cpu_to_le16(rsi_mcsrates[kk--]);
1034 } 1028 }
1035 1029
1036 for (; ii < RSI_TBL_SZ; ii++) { 1030 for (; ii < (RSI_TBL_SZ - 1); ii++) {
1037 auto_rate->supported_rates[ii] = 1031 auto_rate->supported_rates[ii] =
1038 cpu_to_le16(rsi_mcsrates[0]); 1032 cpu_to_le16(rsi_mcsrates[0]);
1039 } 1033 }
1040 } 1034 }
1041 1035
1036 for (; ii < RSI_TBL_SZ; ii++)
1037 auto_rate->supported_rates[ii] = min_rate;
1038
1042 auto_rate->num_supported_rates = cpu_to_le16(num_supported_rates * 2); 1039 auto_rate->num_supported_rates = cpu_to_le16(num_supported_rates * 2);
1043 auto_rate->moderate_rate_inx = cpu_to_le16(num_supported_rates / 2); 1040 auto_rate->moderate_rate_inx = cpu_to_le16(num_supported_rates / 2);
1044 auto_rate->desc_word[7] |= cpu_to_le16(0 << 8); 1041 auto_rate->desc_word[7] |= cpu_to_le16(0 << 8);