From 8104abd5a902dceb4e998dc46b514b8cce986ded Mon Sep 17 00:00:00 2001 From: "Chandrasekaran, Manishekar" Date: Fri, 29 Jan 2016 18:10:27 +0530 Subject: [PATCH] qcacld-3.0: Restrict channel switch only to the intended interface Ensure that application triggered channel switch impacts only the interface of interest. eSAP_DFS_CHNL_SWITCH_ANNOUNCEMENT_START gets used for both radar detected channel switch and application triggered channel switch using ioctl or nl commands. On radar detected channel switch, if radar was detected by one of the SAP interface, all SAP interfaces in the driver would vacate the channel. In application triggered channel switch, only the interface of interest should vacate the channel. Change-Id: I8eee8bde89ae44eec31c1bd35a99a78e517b4a5e CRs-Fixed: 969323 --- core/sap/src/sap_fsm.c | 19 +++++++++++++++++++ core/sap/src/sap_fsm_ext.h | 1 + core/sap/src/sap_module.c | 7 +++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 11bedb3613bb..f1122249349e 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -3594,6 +3594,25 @@ static QDF_STATUS sap_fsm_state_started(ptSapContext sap_ctx, (void *) temp_sap_ctx); } } + } else if (eSAP_CHANNEL_SWITCH_ANNOUNCEMENT_START == msg) { + enum tQDF_ADAPTER_MODE persona; + + if (!sap_ctx) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, + FL("Invalid sap_ctx")); + return qdf_status; + } + + persona = mac_ctx->sap.sapCtxList[sap_ctx->sessionId]. + sapPersona; + + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED, + FL("app trigger chan switch: mode:%d vdev:%d"), + persona, sap_ctx->sessionId); + + if ((QDF_SAP_MODE == persona) || (QDF_P2P_GO_MODE == persona)) + qdf_status = wlansap_dfs_send_csa_ie_request( + (void *) sap_ctx); } else { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("in state %s, invalid event msg %d"), diff --git a/core/sap/src/sap_fsm_ext.h b/core/sap/src/sap_fsm_ext.h index ad98431f2924..170f1f5bd0a9 100644 --- a/core/sap/src/sap_fsm_ext.h +++ b/core/sap/src/sap_fsm_ext.h @@ -54,6 +54,7 @@ typedef enum { eSAP_DFS_CHNL_SWITCH_ANNOUNCEMENT_START, eSAP_OPERATING_CHANNEL_CHANGED, eSAP_CHANNEL_SELECTION_RETRY, + eSAP_CHANNEL_SWITCH_ANNOUNCEMENT_START, eSAP_NO_MSG } eSapMsg_t; diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 47d38b6e6083..31450eccc537 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1558,12 +1558,12 @@ wlansap_set_channel_change_with_csa(void *p_cds_gctx, uint32_t targetChannel, sap_cac_reset_notify(hHal); /* - * Post the eSAP_DFS_CHNL_SWITCH_ANNOUNCEMENT_START + * Post the eSAP_CHANNEL_SWITCH_ANNOUNCEMENT_START * to SAP state machine to process the channel * request with CSA IE set in the beacons. */ sapEvent.event = - eSAP_DFS_CHNL_SWITCH_ANNOUNCEMENT_START; + eSAP_CHANNEL_SWITCH_ANNOUNCEMENT_START; sapEvent.params = 0; sapEvent.u1 = 0; sapEvent.u2 = 0; @@ -1586,8 +1586,7 @@ wlansap_set_channel_change_with_csa(void *p_cds_gctx, uint32_t targetChannel, } QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, - "%s: Posted eSAP_DFS_CHNL_SWITCH_ANNOUNCEMENT_START" - "successfully to sap_fsm for Channel = %d", + "%s: Posted eSAP_CHANNEL_SWITCH_ANNOUNCEMENT_START successfully to sap_fsm for Channel = %d", __func__, targetChannel); return QDF_STATUS_SUCCESS;