From d0fad467ef01e57b8348579af2c8382fc87aad02 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Tue, 13 Jun 2017 18:23:48 -0700 Subject: [PATCH] qcacld-3.0: Process CSA IE only if CSA offload is not enabled If CSA offload is enabled, FW send the CSA offload event for the channel switch, so ignore the CSA IE check in beacon and probe response frame processing. Change-Id: I3f0d204317a4d26dc503c350307f4c144bf8672d CRs-Fixed: 2060145 --- .../mac/src/pe/lim/lim_process_probe_rsp_frame.c | 3 ++- core/mac/src/pe/sch/sch_beacon_process.c | 2 +- core/wma/inc/wma_api.h | 1 + core/wma/src/wma_utils.c | 16 ++++++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c index d0026a4c9751..83f9a64a87ca 100644 --- a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c @@ -222,7 +222,8 @@ lim_process_probe_rsp_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_Packet_info, (uint8_t)probe_rsp->channelNumber, session_entry); } - if (LIM_IS_STA_ROLE(session_entry)) { + if (LIM_IS_STA_ROLE(session_entry) && + !wma_is_csa_offload_enabled()) { if (probe_rsp->channelSwitchPresent) { /* * on receiving channel switch announcement diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index fe71a757e11f..78c8376bbfb4 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -792,7 +792,7 @@ static void __sch_beacon_process_for_session(tpAniSirGlobal mac_ctx, lim_update_sta_run_time_ht_switch_chnl_params(mac_ctx, &bcn->HTInfo, bssIdx, session); - if (LIM_IS_STA_ROLE(session) + if ((LIM_IS_STA_ROLE(session) && !wma_is_csa_offload_enabled()) || LIM_IS_IBSS_ROLE(session)) { /* Channel Switch information element updated */ if (bcn->channelSwitchPresent) { diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 4085af77375a..00b8f37754f9 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -223,6 +223,7 @@ static inline QDF_STATUS wma_register_ndp_cb(QDF_STATUS (*pe_ndp_event_handler) } #endif /* WLAN_FEATURE_NAN_DATAPATH && !WLAN_FEATURE_NAN_CONVERGENCE */ +bool wma_is_csa_offload_enabled(void); bool wma_is_p2p_lo_capable(void); QDF_STATUS wma_p2p_lo_start(struct sir_p2p_lo_start *params); QDF_STATUS wma_p2p_lo_stop(u_int32_t vdev_id); diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 8978776789e5..6aa09f0fe483 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -3829,6 +3829,22 @@ uint32_t wma_get_num_of_setbits_from_bitmask(uint32_t mask) return num_of_setbits; } +/** + * wma_is_csa_offload_enabled - checks fw CSA offload capability + * + * Return: true or false + */ + +bool wma_is_csa_offload_enabled(void) +{ + tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA); + + if (!wma) + return false; + + return WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap, + WMI_SERVICE_CSA_OFFLOAD); +} /** * wma_config_debug_module_cmd - set debug log config * @wmi_handle: wmi layer handle