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 d3df1d31eba3..0096b48cab36 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 @@ -211,6 +211,13 @@ lim_process_probe_rsp_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_Packet_info, } if (LIM_IS_STA_ROLE(session_entry)) { if (probe_rsp->channelSwitchPresent) { + /* + * on receiving channel switch announcement + * from AP, delete all TDLS peers before + * leaving BSS and proceed for channel switch + */ + lim_delete_tdls_peers(mac_ctx, session_entry); + lim_update_channel_switch(mac_ctx, probe_rsp, session_entry); diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index e27113cd52da..10a7032ce8a3 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1984,6 +1984,12 @@ void lim_handle_csa_offload_msg(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) } if (LIM_IS_STA_ROLE(session_entry)) { + /* + * on receiving channel switch announcement from AP, delete all + * TDLS peers before leaving BSS and proceed for channel switch + */ + lim_delete_tdls_peers(mac_ctx, session_entry); + session_entry->gLimChannelSwitch.switchMode = csa_params->switchmode; /* timer already started by firmware, switch immediately */ diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 8bffe8b8e244..e03973065135 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -539,14 +539,20 @@ void lim_send_sme_tdls_delete_all_peer_ind(tpAniSirGlobal pMac, tpPESession psessionEntry); void lim_send_sme_mgmt_tx_completion(tpAniSirGlobal pMac, tpPESession psessionEntry, uint32_t txCompleteStatus); -tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal pMac, - tpPESession psessionEntry); +tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx, + tpPESession session_entry); CDF_STATUS lim_process_tdls_add_sta_rsp(tpAniSirGlobal pMac, void *msg, tpPESession); tSirRetStatus lim_send_tdls_teardown_frame(tpAniSirGlobal pMac, tSirMacAddr peerMac, uint16_t reason, uint8_t responder, tpPESession psessionEntry, uint8_t *addIe, uint16_t addIeLen); +#else +static inline tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx, + tpPESession session_entry) +{ + return eSIR_SUCCESS; +} #endif /* Algorithms & Link Monitoring related functions */ diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 459cb90bcb2c..66c7a71ad4ee 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -739,6 +739,14 @@ static void __sch_beacon_process_for_session(tpAniSirGlobal mac_ctx, || LIM_IS_IBSS_ROLE(session)) { /* Channel Switch information element updated */ if (bcn->channelSwitchPresent) { + /* + * on receiving channel switch announcement from AP, + * delete all TDLS peers before leaving BSS and proceed + * for channel switch + */ + if (LIM_IS_STA_ROLE(session)) + lim_delete_tdls_peers(mac_ctx, session); + lim_update_channel_switch(mac_ctx, bcn, session); } else if (session->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) {