summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/mac/src/pe/lim/lim_process_tdls.c99
1 files changed, 16 insertions, 83 deletions
diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c
index 745e1ff80e..e6ecf8a40e 100644
--- a/core/mac/src/pe/lim/lim_process_tdls.c
+++ b/core/mac/src/pe/lim/lim_process_tdls.c
@@ -2258,8 +2258,7 @@ lim_tdls_populate_matching_rate_set(tpAniSirGlobal mac_ctx, tpDphHashNode stads,
tDot11fIEVHTCaps *vht_caps)
{
tSirMacRateSet temp_rate_set;
- uint32_t i, j, val, min, is_a_rate;
- tSirMacRateSet temp_rate_set2;
+ uint32_t i, j, val, is_a_rate;
uint32_t phymode;
uint8_t mcsSet[SIZE_OF_SUPPORTED_MCS_SET];
tpSirSupportedRates rates;
@@ -2268,70 +2267,9 @@ lim_tdls_populate_matching_rate_set(tpAniSirGlobal mac_ctx, tpDphHashNode stads,
uint8_t nss;
is_a_rate = 0;
- temp_rate_set2.numRates = 0;
lim_get_phy_mode(mac_ctx, &phymode, NULL);
- /* get own rate set */
- val = WNI_CFG_OPERATIONAL_RATE_SET_LEN;
- if (wlan_cfg_get_str(mac_ctx, WNI_CFG_OPERATIONAL_RATE_SET,
- (uint8_t *) &temp_rate_set.rate,
- &val) != QDF_STATUS_SUCCESS) {
- /* Could not get rateset from CFG. Log error. */
- pe_err("could not retrieve rateset");
- val = 0;
- }
- temp_rate_set.numRates = val;
-
- if (phymode == WNI_CFG_PHY_MODE_11G) {
- /* get own extended rate set */
- val = WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN;
- if (wlan_cfg_get_str(mac_ctx,
- WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET,
- (uint8_t *) &temp_rate_set2.rate,
- &val) != QDF_STATUS_SUCCESS)
- temp_rate_set2.numRates = val;
- }
-
- if ((temp_rate_set.numRates + temp_rate_set2.numRates) > 12) {
- pe_err("more than 12 rates in CFG");
- return QDF_STATUS_E_FAILURE;
- }
-
- /**
- * Handling of the rate set IEs is the following:
- * - keep only rates that we support and that the station supports
- * - sort and the rates into the pSta->rate array
- */
-
- /* Copy all rates in temp_rate_set, there are 12 rates max */
- for (i = 0; i < temp_rate_set2.numRates; i++)
- temp_rate_set.rate[i + temp_rate_set.numRates] =
- temp_rate_set2.rate[i];
-
- temp_rate_set.numRates += temp_rate_set2.numRates;
-
- /**
- * Sort rates in temp_rate_set (they are likely to be already sorted)
- * put the result in temp_rate_set2
- */
- temp_rate_set2.numRates = 0;
-
- for (i = 0; i < temp_rate_set.numRates; i++) {
- min = 0;
- val = 0xff;
-
- for (j = 0; j < temp_rate_set.numRates; j++)
- if ((uint32_t) (temp_rate_set.rate[j] & 0x7f) < val) {
- val = temp_rate_set.rate[j] & 0x7f;
- min = j;
- }
-
- temp_rate_set2.rate[temp_rate_set2.numRates++] =
- temp_rate_set.rate[min];
- temp_rate_set.rate[min] = 0xff;
- }
-
/**
* Copy received rates in temp_rate_set, the parser has ensured
* unicity of the rates so there cannot be more than 12 .
@@ -2350,27 +2288,22 @@ lim_tdls_populate_matching_rate_set(tpAniSirGlobal mac_ctx, tpDphHashNode stads,
rates = &stads->supportedRates;
qdf_mem_zero((uint8_t *) rates, sizeof(tSirSupportedRates));
- for (i = 0; i < temp_rate_set2.numRates; i++) {
- for (j = 0; j < temp_rate_set.numRates; j++) {
- if ((temp_rate_set2.rate[i] & 0x7F) !=
- (temp_rate_set.rate[j] & 0x7F))
- continue;
-
- if ((b_rateindex > SIR_NUM_11B_RATES) ||
- (a_rateindex > SIR_NUM_11A_RATES)) {
- pe_warn("Invalid number of rates (11b->%d, 11a->%d)",
+ for (j = 0; j < temp_rate_set.numRates; j++) {
+ if ((b_rateindex > SIR_NUM_11B_RATES) ||
+ (a_rateindex > SIR_NUM_11A_RATES)) {
+ pe_warn("Invalid number of rates (11b->%d, 11a->%d)",
b_rateindex, a_rateindex);
- return QDF_STATUS_E_FAILURE;
- }
- if (sirIsArate(temp_rate_set2.rate[i] & 0x7f)) {
- is_a_rate = 1;
- if (a_rateindex < SIR_NUM_11A_RATES)
- rates->llaRates[a_rateindex++] = temp_rate_set2.rate[i];
- } else {
- if (b_rateindex < SIR_NUM_11B_RATES)
- rates->llbRates[b_rateindex++] = temp_rate_set2.rate[i];
- }
- break;
+ return QDF_STATUS_E_FAILURE;
+ }
+ if (sirIsArate(temp_rate_set.rate[j] & 0x7f)) {
+ is_a_rate = 1;
+ if (a_rateindex < SIR_NUM_11A_RATES)
+ rates->llaRates[a_rateindex++] =
+ temp_rate_set.rate[j];
+ } else {
+ if (b_rateindex < SIR_NUM_11B_RATES)
+ rates->llbRates[b_rateindex++] =
+ temp_rate_set.rate[j];
}
}