diff options
| author | Deepak Dhamdhere <ddhamdhe@qca.qualcomm.com> | 2014-02-20 09:39:31 -0800 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-02-25 12:31:41 -0800 |
| commit | ccac96e1cdc8bfcd0eff43f8073f6d81d4a340c5 (patch) | |
| tree | 425c22d52c3bf0238c77e54bc84616bdeeb2bab9 | |
| parent | 1c26e84fe61c6d62126010024ec0646dbec86a58 (diff) | |
qcacld: Use correct network type for peer_assoc in roaming
Use nwType from original ADD_BSS request while setting
phymode in peer_assoc command sent to firmware during
roaming.
Added defensive code to detect phymode and rate mismatch
in wmi_unified_send_peer_assoc().
Fix for JIRA WCNSTABLE-38493
Change-Id: I206df8d65ef58668c7777022975f626aa1073767
CRs-Fixed: 615981
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 30 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.h | 1 |
2 files changed, 25 insertions, 6 deletions
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 8505fd62f2db..b88694661dd9 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -6040,6 +6040,10 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, wmi_vht_rate_set *mcs; u_int32_t num_peer_legacy_rates; u_int32_t num_peer_ht_rates; + u_int32_t num_peer_11b_rates=0; + u_int32_t num_peer_11a_rates=0; + u_int32_t phymode; + struct wma_txrx_node *intr = &wma->interfaces[params->smesessionId]; pdev = vos_get_context(VOS_MODULE_ID_TXRX, wma->vos_context); @@ -6052,6 +6056,11 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, vos_mem_zero(&peer_legacy_rates, sizeof(wmi_rate_set)); vos_mem_zero(&peer_ht_rates, sizeof(wmi_rate_set)); + phymode = wma_peer_phymode(nw_type, params->htCapable, + params->txChannelWidthSet, + params->vhtCapable, + params->vhtTxChannelWidthSet); + /* Legacy Rateset */ rate_pos = (u_int8_t *) peer_legacy_rates.rates; for (i = 0; i < SIR_NUM_11B_RATES; i++) { @@ -6059,14 +6068,22 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, continue; rate_pos[peer_legacy_rates.num_rates++] = params->supportedRates.llbRates[i]; + num_peer_11b_rates++; } for (i = 0; i < SIR_NUM_11A_RATES; i++) { if (!params->supportedRates.llaRates[i]) continue; rate_pos[peer_legacy_rates.num_rates++] = params->supportedRates.llaRates[i]; + num_peer_11a_rates++; } + if ((phymode == MODE_11A && num_peer_11a_rates == 0) || + (phymode == MODE_11B && num_peer_11b_rates == 0)) { + WMA_LOGW("%s: Invalid phy rates. phymode 0x%x, 11b_rates %d, 11a_rates %d", + __func__, phymode, num_peer_11b_rates, num_peer_11a_rates); + return -EINVAL; + } /* Set the Legacy Rates to Word Aligned */ num_peer_legacy_rates = roundup(peer_legacy_rates.num_rates, sizeof(u_int32_t)); @@ -6294,10 +6311,7 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, } intr->nss = cmd->peer_nss; - cmd->peer_phymode = wma_peer_phymode(nw_type, params->htCapable, - params->txChannelWidthSet, - params->vhtCapable, - params->vhtTxChannelWidthSet); + cmd->peer_phymode = phymode; WMA_LOGD("%s: vdev_id %d associd %d peer_flags %x rate_caps %x " "peer_caps %x listen_intval %d ht_caps %x max_mpdu %d " @@ -7747,6 +7761,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss) iface->dtimPeriod = add_bss->dtimPeriod; iface->llbCoexist = add_bss->llbCoexist; iface->shortSlotTimeSupported = add_bss->shortSlotTimeSupported; + iface->nwType = add_bss->nwType; if (add_bss->reassocReq) { // Called in preassoc state. BSSID peer is already added by set_linkstate peer = ol_txrx_find_peer_by_addr(pdev, add_bss->bssId, &peer_id); @@ -7816,6 +7831,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss) wmi_unified_send_txbf(wma, &add_bss->staContext); + wmi_unified_send_peer_assoc(wma, add_bss->nwType, &add_bss->staContext); #ifdef WLAN_FEATURE_11W @@ -8447,8 +8463,10 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params) params->smesessionId); } wmi_unified_send_txbf(wma, params); - wmi_unified_send_peer_assoc(wma, params->nwType, - (tAddStaParams *)iface->addBssStaContext); + + wmi_unified_send_peer_assoc(wma, + iface->nwType, + (tAddStaParams *)iface->addBssStaContext); #ifdef WLAN_FEATURE_11W if (params->rmfEnabled) { /* when 802.11w PMF is enabled for hw encr/decr diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index 6b5ff4722f9c..8474bd96c07f 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -434,6 +434,7 @@ struct wma_txrx_node { u_int16_t pause_bitmap; tPowerdBm tx_power; /* TX power in dBm */ tPowerdBm max_tx_power; /* max Tx power in dBm */ + u_int32_t nwType; }; #if defined(QCA_WIFI_FTM) && !defined(QCA_WIFI_ISOC) |
