From f9dc79123c21fab544cff87cbdcbf660a6d869cf Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Wed, 28 Jun 2017 18:10:58 -0700 Subject: [PATCH] qcacld-3.0: Igonre HT BW change if channel switch is in progress If channel switch is in progress and if the HT IE received in beacon has the BW change then do not send the bandwidth update request to FW. After the channel switch response is received and beacon has different BW bandwidth a new BW update request will be sent to FW. Change-Id: Id41bd0523f821d2b81e132318230492fda79f32a CRs-Fixed: 2068906 --- core/mac/src/pe/include/lim_session.h | 1 + core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 1 + core/mac/src/pe/lim/lim_send_messages.c | 1 + core/mac/src/pe/lim/lim_utils.c | 5 +++++ core/wma/inc/wma.h | 2 ++ core/wma/src/wma_dev_if.c | 3 +++ core/wma/src/wma_features.c | 7 +++++++ core/wma/src/wma_scan_roam.c | 5 +++++ 8 files changed, 25 insertions(+) diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index ee757fe5c3f0..df499f27ec84 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -516,6 +516,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ #endif bool enable_bcast_probe_rsp; uint8_t ht_client_cnt; + bool ch_switch_in_progress; } tPESession, *tpPESession; /*------------------------------------------------------------------------- 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 209e209aa61c..602f74bd972f 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 @@ -3097,6 +3097,7 @@ void lim_process_switch_channel_rsp(tpAniSirGlobal pMac, void *body) pe_err("session does not exist for given sessionId"); return; } + psessionEntry->ch_switch_in_progress = false; /* HAL fills in the tx power used for mgmt frames in this field. */ /* Store this value to use in TPC report IE. */ rrm_cache_mgmt_tx_power(pMac, pChnlParams->txMgmtPower, psessionEntry); diff --git a/core/mac/src/pe/lim/lim_send_messages.c b/core/mac/src/pe/lim/lim_send_messages.c index 1d5d8b6c4242..ae4ae44e50f2 100644 --- a/core/mac/src/pe/lim/lim_send_messages.c +++ b/core/mac/src/pe/lim/lim_send_messages.c @@ -288,6 +288,7 @@ tSirRetStatus lim_send_switch_chnl_params(tpAniSirGlobal pMac, pe_err("Posting CH_SWITCH_REQ to WMA failed"); return eSIR_FAILURE; } + pSessionEntry->ch_switch_in_progress = true; return eSIR_SUCCESS; } diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index e94c931b93e7..ee900a2d8a89 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -4333,6 +4333,11 @@ void lim_update_sta_run_time_ht_switch_chnl_params(tpAniSirGlobal pMac, return; } + if (psessionEntry->ch_switch_in_progress == true) { + pe_debug("ch switch is in progress, ignore HT IE BW update"); + return; + } + if (!pHTInfo->primaryChannel) { pe_debug("Ignore as primary channel is 0 in HT info"); return; diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index f0c79e715684..3fdcaa8d59dd 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -1084,6 +1084,8 @@ struct wma_txrx_node { uint32_t he_ops; #endif bool in_bmps; + struct beacon_filter_param beacon_filter; + bool beacon_filter_enabled; }; #if defined(QCA_WIFI_FTM) diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index a420a22591bf..a9766a91c485 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1099,6 +1099,9 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info, } else { wma_vdev_set_mlme_state(wma, resp_event->vdev_id, WLAN_VDEV_S_RUN); + if (iface->beacon_filter_enabled) + wma_add_beacon_filter(wma, + &iface->beacon_filter); } } diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index bebac44ab208..3dbe7b4b3ce8 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -842,7 +842,9 @@ QDF_STATUS wma_add_beacon_filter(WMA_HANDLE handle, u_int8_t *buf; A_UINT32 *ie_map; int ret; + struct wma_txrx_node *iface; tp_wma_handle wma = (tp_wma_handle) handle; + wmi_add_bcn_filter_cmd_fixed_param *cmd; int len = sizeof(wmi_add_bcn_filter_cmd_fixed_param); @@ -855,6 +857,11 @@ QDF_STATUS wma_add_beacon_filter(WMA_HANDLE handle, return QDF_STATUS_E_INVAL; } + iface = &wma->interfaces[filter_params->vdev_id]; + qdf_mem_copy(&iface->beacon_filter, filter_params, + sizeof(struct beacon_filter_param)); + iface->beacon_filter_enabled = true; + wmi_buf = wmi_buf_alloc(wma->wmi_handle, len); if (!wmi_buf) { WMA_LOGE("%s: wmi_buf_alloc failed", __func__); diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 8f54da24d067..93104bd71e6b 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -3026,6 +3026,11 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params) (params->restart_on_chan_switch == true)) wma->interfaces[req.vdev_id].is_channel_switch = true; + if (params->restart_on_chan_switch == true && + wma->interfaces[req.vdev_id].beacon_filter_enabled) + wma_remove_beacon_filter(wma, + &wma->interfaces[req.vdev_id].beacon_filter); + if (QDF_GLOBAL_MONITOR_MODE == cds_get_conparam() && wma_is_vdev_up(vdev_id)) { status = wma_switch_channel(wma, &req);