summaryrefslogtreecommitdiff
path: root/CORE/SAP/src/sapModule.c
diff options
context:
space:
mode:
authorRavi Joshi <ravij@qca.qualcomm.com>2013-12-13 22:52:22 -0800
committerPrakash Dhavali <pdhavali@codeaurora.org>2014-01-16 21:45:56 -0800
commita02f1d78e9c4d81aaa66b74169e102ba67f7c7aa (patch)
treeaf63555cf652c1a631b91302137f8366637d694c /CORE/SAP/src/sapModule.c
parent791c922935fc4434e3f9bf4095312187d86dfe20 (diff)
wlan: ROME DFS Changes on branch
Implements DFS Channel Change for SAP in addition to Radar Indication, random channel selection, SAP States for CAC, partial changes for start beacon Indication. . Change-Id: I6b62e797b3c104ba716697d2bb2441aa5fccca7c CRs-Fixed: 589876
Diffstat (limited to 'CORE/SAP/src/sapModule.c')
-rw-r--r--CORE/SAP/src/sapModule.c127
1 files changed, 127 insertions, 0 deletions
diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c
index b644747209af..9865ade148cb 100644
--- a/CORE/SAP/src/sapModule.c
+++ b/CORE/SAP/src/sapModule.c
@@ -2363,3 +2363,130 @@ VOS_STATUS WLANSAP_DeRegisterMgmtFrame( v_PVOID_t pvosGCtx, tANI_U16 frameType,
return VOS_STATUS_E_FAULT;
}
+
+/*==========================================================================
+ FUNCTION WLANSAP_ChannelChangeRequest
+
+ DESCRIPTION
+ This API is used to send an Indication to SME/PE to change the
+ current operating channel to a different target channel.
+
+ The Channel change will be issued by SAP under the following
+ scenarios.
+ 1. A radar indication is received during SAP CAC WAIT STATE and
+ channel change is required.
+ 2. A radar indication is received during SAP STARTED STATE and
+ channel change is required.
+ DEPENDENCIES
+ NA.
+
+ PARAMETERS
+ IN
+ sapContext: Pointer to vos global context structure
+
+ RETURN VALUE
+ The VOS_STATUS code associated with performing the operation
+
+ VOS_STATUS_SUCCESS: Success
+
+ SIDE EFFECTS
+============================================================================*/
+VOS_STATUS
+WLANSAP_ChannelChangeRequest(v_PVOID_t pSapCtx, tANI_U8 tArgetChannel)
+{
+ ptSapContext sapContext = NULL;
+ eHalStatus halStatus = eHAL_STATUS_FAILURE;
+ v_PVOID_t hHal = NULL;
+ sapContext = (ptSapContext)pSapCtx;
+
+ if ( NULL == sapContext )
+ {
+ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid SAP pointer from pvosGCtx", __func__);
+ return VOS_STATUS_E_FAULT;
+ }
+
+ hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx);
+ if (NULL == hHal)
+ {
+ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid HAL pointer from pvosGCtx", __func__);
+ return VOS_STATUS_E_FAULT;
+ }
+
+ halStatus = sme_RoamChannelChangeReq( hHal,
+ sapContext->sessionId, tArgetChannel);
+
+ if (halStatus == eHAL_STATUS_SUCCESS)
+ {
+ return VOS_STATUS_SUCCESS;
+ }
+ return VOS_STATUS_E_FAULT;
+}
+
+/*==========================================================================
+
+ FUNCTION WLANSAP_StartBeaconReq
+ DESCRIPTION
+ This API is used to send an Indication to SME/PE to start
+ beaconing on the current operating channel.
+
+ Brief:When SAP is started on DFS channel and when ADD BSS RESP is received
+ LIM temporarily holds off Beaconing for SAP to do CAC WAIT. When
+ CAC WAIT is done SAP resumes the Beacon Tx by sending a start beacon
+ request to LIM.
+
+ DEPENDENCIES
+ NA.
+
+PARAMETERS
+
+IN
+ pvosGCtx: Pointer to vos global context structure
+
+RETURN VALUE
+ The VOS_STATUS code associated with performing the operation
+
+VOS_STATUS_SUCCESS: Success
+
+SIDE EFFECTS
+============================================================================*/
+VOS_STATUS WLANSAP_StartBeaconReq(v_PVOID_t pSapCtx)
+{
+ ptSapContext sapContext = NULL;
+ eHalStatus halStatus = eHAL_STATUS_FAILURE;
+ v_PVOID_t hHal = NULL;
+ tANI_U8 dfsCacWaitStatus = 0;
+ sapContext = (ptSapContext)pSapCtx;
+
+ if ( NULL == sapContext )
+ {
+ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid SAP pointer from pvosGCtx", __func__);
+ return VOS_STATUS_E_FAULT;
+ }
+
+ hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx);
+ if (NULL == hHal)
+ {
+ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid HAL pointer from pvosGCtx", __func__);
+ return VOS_STATUS_E_FAULT;
+ }
+
+ /* No Radar was found during CAC WAIT, So start Beaconing */
+ if (sapContext->SapDfsInfo.sap_radar_found_status == 0)
+ {
+ /* CAC Wait done without any Radar Detection */
+ dfsCacWaitStatus = 1;
+ halStatus = sme_RoamStartBeaconReq( hHal,
+ sapContext->sessionId, dfsCacWaitStatus);
+ if (halStatus == eHAL_STATUS_SUCCESS)
+ {
+ return VOS_STATUS_SUCCESS;
+ }
+ return VOS_STATUS_E_FAULT;
+ }
+
+ return VOS_STATUS_E_FAULT;
+}