From e22c1947b48808322eb11b02a5ea2b40559065d7 Mon Sep 17 00:00:00 2001 From: Jyoti Kumari Date: Tue, 10 Nov 2020 13:20:21 +0530 Subject: [PATCH] qcacld-3.0: Update nw type for tdls peer after channel switch rsp When firmware sends wma_csa_offload_handler() event, peer should switch to new channel and update network type. But only frequency is getting updated, network type is old. Add check to update network type based on channel frequency Change-Id: Icd70823f98cfd528863cfb9ec1c2bf5e78e9912b CRs-Fixed: 2813847 --- core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 401b0159b161..a22afa4f8e2c 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -2848,6 +2848,7 @@ void lim_process_switch_channel_rsp(struct mac_context *mac, QDF_STATUS status; uint16_t channelChangeReasonCode; struct pe_session *pe_session; + struct wlan_channel *vdev_chan; /* we need to process the deferred message since the initiating req. there might be nested request. */ /* in the case of nested request the new request initiated from the response will take care of resetting */ /* the deffered flag. */ @@ -2865,6 +2866,18 @@ void lim_process_switch_channel_rsp(struct mac_context *mac, pe_session->chainMask = rsp->chain_mask; pe_session->smpsMode = rsp->smps_mode; pe_session->channelChangeReasonCode = 0xBAD; + + vdev_chan = wlan_vdev_mlme_get_des_chan(pe_session->vdev); + + if (WLAN_REG_IS_24GHZ_CH_FREQ(vdev_chan->ch_freq)) { + if (vdev_chan->ch_phymode == WLAN_PHYMODE_11B) + pe_session->nwType = eSIR_11B_NW_TYPE; + else + pe_session->nwType = eSIR_11G_NW_TYPE; + } else { + pe_session->nwType = eSIR_11A_NW_TYPE; + } + pe_debug("new network type for peer: %d", pe_session->nwType); switch (channelChangeReasonCode) { case LIM_SWITCH_CHANNEL_REASSOC: lim_process_switch_channel_re_assoc_req(mac, pe_session, status);