/* * TDLS request API, called from HDD to Send Link Establishment Parameters */ VOS_STATUS csrTdlsSendLinkEstablishParams(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); tSmeCmd *tdlsLinkEstablishCmd; eHalStatus status = eHAL_STATUS_FAILURE ; //If connected and in Infra. Only then allow this if( CSR_IS_SESSION_VALID( pMac, sessionId ) && csrIsConnStateConnectedInfra( pMac, sessionId ) && (NULL != peerMac) ) { tdlsLinkEstablishCmd = csrGetCommandBuffer(pMac) ; if(tdlsLinkEstablishCmd) { tTdlsLinkEstablishCmdInfo *tdlsLinkEstablishCmdInfo = &tdlsLinkEstablishCmd->u.tdlsCmd.u.tdlsLinkEstablishCmdInfo ; tdlsLinkEstablishCmd->sessionId = sessionId; vos_mem_copy( tdlsLinkEstablishCmdInfo->peerMac, peerMac, sizeof(tSirMacAddr)); tdlsLinkEstablishCmdInfo->isBufSta = tdlsLinkEstablishParams->isBufSta; tdlsLinkEstablishCmdInfo->isResponder = tdlsLinkEstablishParams->isResponder; tdlsLinkEstablishCmdInfo->maxSp = tdlsLinkEstablishParams->maxSp; tdlsLinkEstablishCmdInfo->uapsdQueues = tdlsLinkEstablishParams->uapsdQueues; tdlsLinkEstablishCmdInfo->isOffChannelSupported = tdlsLinkEstablishParams->isOffChannelSupported; vos_mem_copy(tdlsLinkEstablishCmdInfo->supportedChannels, tdlsLinkEstablishParams->supportedChannels, tdlsLinkEstablishParams->supportedChannelsLen); tdlsLinkEstablishCmdInfo->supportedChannelsLen = tdlsLinkEstablishParams->supportedChannelsLen; vos_mem_copy(tdlsLinkEstablishCmdInfo->supportedOperClasses, tdlsLinkEstablishParams->supportedOperClasses, tdlsLinkEstablishParams->supportedOperClassesLen); tdlsLinkEstablishCmdInfo->supportedOperClassesLen = tdlsLinkEstablishParams->supportedOperClassesLen; tdlsLinkEstablishCmdInfo->isResponder= tdlsLinkEstablishParams->isResponder; tdlsLinkEstablishCmdInfo->maxSp= tdlsLinkEstablishParams->maxSp; tdlsLinkEstablishCmdInfo->uapsdQueues= tdlsLinkEstablishParams->uapsdQueues; tdlsLinkEstablishCmd->command = eSmeCommandTdlsLinkEstablish ; tdlsLinkEstablishCmd->u.tdlsCmd.size = sizeof(tTdlsLinkEstablishCmdInfo) ; smePushCommand(pMac, tdlsLinkEstablishCmd, FALSE) ; status = eHAL_STATUS_SUCCESS ; } } return status ; }
void sme_SetFTPTKState(tHalHandle hHal, tANI_U32 sessionId, v_BOOL_t state) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); if (!pSession) { smsLog(pMac, LOGE, FL("pSession is NULL")); return; } pSession->ftSmeContext.setFTPTKState = state; }
tANI_BOOLEAN csrCheckPSReady(void *pv) { tpAniSirGlobal pMac = PMAC_STRUCT( pv ); if (pMac->roam.sPendingCommands < 0) { VOS_ASSERT( pMac->roam.sPendingCommands >= 0 ); return 0; } return (pMac->roam.sPendingCommands == 0); }
void ccmStart(tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); pMac->ccm.state = eCCM_STARTED ; #if defined(ANI_LOGDUMP) ccmDumpInit(hHal); #endif //#if defined(ANI_LOGDUMP) return ; }
/****************************************************************************** * Function: sme_NanRegisterCallback * * Description: * This function gets called when HDD wants register nan rsp callback with * sme layer. * * Args: * hHal and callback which needs to be registered. * * Returns: * void *****************************************************************************/ void sme_NanRegisterCallback(tHalHandle hHal, NanCallback callback) { tpAniSirGlobal pMac = NULL; if (NULL == hHal) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("hHal is not valid")); return; } pMac = PMAC_STRUCT(hHal); pMac->sme.nanCallback = callback; }
void ccmStop(tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); pMac->ccm.state = eCCM_STOPPED ; pal_local_bh_disable() ; purgeReqQ(hHal); pal_local_bh_enable() ; return ; }
eHalStatus ccmCfgUpdate(tHalHandle hHal, tCcmCfgSetCallback callback) { tHddHandle hHdd = halHandle2HddHandle(hHal); tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status ; pal_local_bh_disable() ; status = cfgUpdate(pMac, hHdd, callback) ; if (status == eHAL_STATUS_SUCCESS) { if (pMac->ccm.replay.nr_param == 0) { /* there is nothing saved at comp[], so we are done! */ pMac->ccm.replay.started = 0 ; } else { /* we have sent update message to MAC SW */ void *sem ; status = palMutexAllocLocked( hHdd, &sem ) ; if (status != eHAL_STATUS_SUCCESS) { smsLog(pMac, LOGE, FL("mutex alloc failed")); pMac->ccm.replay.started = 0 ; } else { pMac->ccm.replay.done = sem ; } } } pal_local_bh_enable() ; /* Waiting here ... */ if (status == eHAL_STATUS_SUCCESS && pMac->ccm.replay.done) { #ifdef CCM_DEBUG smsLog(pMac, LOGW, FL("ccmWaitForCompletion(%p)"), pMac->ccm.replay.done); #endif ccmWaitForCompletion(hHdd, pMac->ccm.replay.done); #ifdef CCM_DEBUG smsLog(pMac, LOGW, FL("free(%p)"), pMac->ccm.replay.done); #endif palSemaphoreFree( hHdd, pMac->ccm.replay.done) ; } return status ; }
/*-------------------------------------------------------------------------- Reset the FT context. ------------------------------------------------------------------------*/ void sme_FTReset(tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); if (pMac == NULL) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is NULL")); return; } if (pMac->ft.ftSmeContext.auth_ft_ies != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOGE, FL(" Freeing FT Auth IE %p and setting to NULL"), pMac->ft.ftSmeContext.auth_ft_ies); #endif vos_mem_free(pMac->ft.ftSmeContext.auth_ft_ies); } pMac->ft.ftSmeContext.auth_ft_ies = NULL; pMac->ft.ftSmeContext.auth_ft_ies_length = 0; if (pMac->ft.ftSmeContext.reassoc_ft_ies != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOGE, FL(" Freeing FT Reassoc IE %p and setting to NULL"), pMac->ft.ftSmeContext.auth_ft_ies); #endif vos_mem_free(pMac->ft.ftSmeContext.reassoc_ft_ies); } pMac->ft.ftSmeContext.reassoc_ft_ies = NULL; pMac->ft.ftSmeContext.reassoc_ft_ies_length = 0; if (pMac->ft.ftSmeContext.psavedFTPreAuthRsp != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOGE, FL("Freeing FtPreAuthRsp %p and setting to NULL"), pMac->ft.ftSmeContext.psavedFTPreAuthRsp); #endif vos_mem_free(pMac->ft.ftSmeContext.psavedFTPreAuthRsp); } pMac->ft.ftSmeContext.psavedFTPreAuthRsp = NULL; pMac->ft.ftSmeContext.setFTPreAuthState = FALSE; pMac->ft.ftSmeContext.setFTPTKState = FALSE; if (pMac->ft.ftSmeContext.pCsrFTKeyInfo != NULL) { vos_mem_zero(pMac->ft.ftSmeContext.pCsrFTKeyInfo, sizeof(tCsrRoamSetKey)); vos_mem_free(pMac->ft.ftSmeContext.pCsrFTKeyInfo); } pMac->ft.ftSmeContext.pCsrFTKeyInfo = NULL; vos_mem_zero(pMac->ft.ftSmeContext.preAuthbssId, ANI_MAC_ADDR_SIZE); pMac->ft.ftSmeContext.FTState = eFT_START_READY; }
CDF_STATUS sme_p2p_close(tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); if (pMac->p2pContext.probeRspIe) { cdf_mem_free(pMac->p2pContext.probeRspIe); pMac->p2pContext.probeRspIe = NULL; } pMac->p2pContext.probeRspIeLength = 0; return CDF_STATUS_SUCCESS; }
eHalStatus p2pRemainOnChannel(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 channel, tANI_U32 duration, remainOnChanCallback callback, void *pContext #ifdef WLAN_FEATURE_P2P_INTERNAL , eP2PRemainOnChnReason reason #endif ) { eHalStatus status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); tSmeCmd *pRemainChlCmd = NULL; tANI_U32 phyMode; pRemainChlCmd = smeGetCommandBuffer(pMac); if(pRemainChlCmd == NULL) return eHAL_STATUS_FAILURE; if (SIR_BAND_5_GHZ == GetRFBand(channel)) { phyMode = WNI_CFG_PHY_MODE_11A; } else { phyMode = WNI_CFG_PHY_MODE_11G; } cfgSetInt(pMac, WNI_CFG_PHY_MODE, phyMode); do { /* call set in context */ pRemainChlCmd->command = eSmeCommandRemainOnChannel; pRemainChlCmd->sessionId = sessionId; pRemainChlCmd->u.remainChlCmd.chn = channel; pRemainChlCmd->u.remainChlCmd.duration = duration; pRemainChlCmd->u.remainChlCmd.callback = callback; pRemainChlCmd->u.remainChlCmd.callbackCtx = pContext; //Put it at the head of the Q if we just finish finding the peer and ready to send a frame #ifdef WLAN_FEATURE_P2P_INTERNAL smePushCommand(pMac, pRemainChlCmd, (eP2PRemainOnChnReasonSendFrame == reason)); #else csrQueueSmeCommand(pMac, pRemainChlCmd, eANI_BOOLEAN_FALSE); #endif } while(0); smsLog(pMac, LOGW, "exiting function %s\n", __FUNCTION__); return(status); }
CDF_STATUS sme_p2p_open(tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); CDF_STATUS status = CDF_STATUS_SUCCESS; /* If static structure is too big, Need to change this function to allocate memory dynamically */ cdf_mem_zero(&pMac->p2pContext, sizeof(tp2pContext)); if (!CDF_IS_STATUS_SUCCESS(status)) { sme_p2p_close(hHal); } return status; }
eHalStatus sme_p2pClose( tHalHandle hHal ) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); if( pMac->p2pContext.probeRspIe ) { vos_mem_free(pMac->p2pContext.probeRspIe); pMac->p2pContext.probeRspIe = NULL; } pMac->p2pContext.probeRspIeLength = 0; return eHAL_STATUS_SUCCESS; }
/*-------------------------------------------------------------------------- Reset the FT context. ------------------------------------------------------------------------*/ void sme_FTReset(tHalHandle hHal, tANI_U32 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); tCsrRoamSession *pSession = NULL; if (pMac == NULL) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is NULL")); return; } pSession = CSR_GET_SESSION(pMac, sessionId); if (NULL != pSession) { if (pSession->ftSmeContext.auth_ft_ies != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog(pMac, LOG1, FL("Freeing FT Auth IE %p and setting to NULL"), pSession->ftSmeContext.auth_ft_ies); #endif vos_mem_free(pSession->ftSmeContext.auth_ft_ies); pSession->ftSmeContext.auth_ft_ies = NULL; } pSession->ftSmeContext.auth_ft_ies_length = 0; if (pSession->ftSmeContext.reassoc_ft_ies != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog(pMac, LOG1, FL("Freeing FT Reassoc IE %p and setting to NULL"), pSession->ftSmeContext.reassoc_ft_ies); #endif vos_mem_free(pSession->ftSmeContext.reassoc_ft_ies); pSession->ftSmeContext.reassoc_ft_ies = NULL; } pSession->ftSmeContext.reassoc_ft_ies_length = 0; if (pSession->ftSmeContext.psavedFTPreAuthRsp != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOG1, FL("Freeing FtPreAuthRsp %p and setting to NULL"), pSession->ftSmeContext.psavedFTPreAuthRsp); #endif vos_mem_free(pSession->ftSmeContext.psavedFTPreAuthRsp); vos_mem_set(pSession->ftSmeContext.psavedFTPreAuthRsp, sizeof(tSirFTPreAuthRsp), 0); } pSession->ftSmeContext.setFTPreAuthState = VOS_FALSE; pSession->ftSmeContext.setFTPTKState = VOS_FALSE; vos_mem_zero(pSession->ftSmeContext.preAuthbssId, ANI_MAC_ADDR_SIZE); pSession->ftSmeContext.FTState = eFT_START_READY; } }
eHalStatus sme_p2pOpen( tHalHandle hHal ) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); eHalStatus status = eHAL_STATUS_SUCCESS; //If static structure is too big, Need to change this function to allocate memory dynamically vos_mem_zero(&pMac->p2pContext, sizeof( tp2pContext )); if(!HAL_STATUS_SUCCESS(status)) { sme_p2pClose(hHal); } return status; }
void csrFullPowerCallback(void *pv, eHalStatus status) { tpAniSirGlobal pMac = PMAC_STRUCT( pv ); tListElem *pEntry; tSmeCmd *pCommand; (void)status; while( NULL != ( pEntry = csrLLRemoveHead( &pMac->roam.roamCmdPendingList, eANI_BOOLEAN_TRUE ) ) ) { pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); smePushCommand( pMac, pCommand, eANI_BOOLEAN_FALSE ); } }
CDF_STATUS sme_send_action_cnf(tHalHandle hHal, uint8_t *pMsg) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); CDF_STATUS status = CDF_STATUS_SUCCESS; tCsrRoamInfo RoamInfo; tSirSmeRsp *pSmeRsp = (tSirSmeRsp *) pMsg; /* forward the indication to HDD */ /* RoamInfo can be passed as NULL....todo */ csr_roam_call_callback(pMac, pSmeRsp->sessionId, &RoamInfo, 0, eCSR_ROAM_SEND_ACTION_CNF, (pSmeRsp->statusCode == eSIR_SME_SUCCESS) ? 0 : eCSR_ROAM_RESULT_SEND_ACTION_FAIL); return status; }
/*-------------------------------------------------------------------------- Initialize the FT context. ------------------------------------------------------------------------*/ void sme_FTOpen(tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; //Clear the FT Context. sme_FTReset(hHal); status = vos_timer_init(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer,VOS_TIMER_TYPE_SW, sme_PreauthReassocIntvlTimerCallback, (void *)pMac); if (eHAL_STATUS_SUCCESS != status) { smsLog(pMac, LOGE, FL("Preauth Reassoc interval Timer allocation failed")); return; } }
/*-------------------------------------------------------------------------- * * HDD Interface to SME. SME now sends the Auth 2 and RIC IEs up to the supplicant. * The supplicant will then proceed to send down the * Reassoc Req. * *------------------------------------------------------------------------*/ void sme_GetFTPreAuthResponse( tHalHandle hHal, tANI_U32 sessionId, tANI_U8 *ft_ies, tANI_U32 ft_ies_ip_len, tANI_U16 *ft_ies_length ) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); eHalStatus status = eHAL_STATUS_FAILURE; if (!pSession) { smsLog( pMac, LOGE, FL("pSession is NULL")); return; } *ft_ies_length = 0; status = sme_AcquireGlobalLock( &pMac->sme ); if (!( HAL_STATUS_SUCCESS( status ))) return; /* All or nothing - proceed only if both BSSID and FT IE fit */ if((ANI_MAC_ADDR_SIZE + pSession->ftSmeContext.psavedFTPreAuthRsp->ft_ies_length) > ft_ies_ip_len) { sme_ReleaseGlobalLock( &pMac->sme ); return; } // hdd needs to pack the bssid also along with the // auth response to supplicant vos_mem_copy(ft_ies, pSession->ftSmeContext.preAuthbssId, ANI_MAC_ADDR_SIZE); // Copy the auth resp FTIEs vos_mem_copy(&(ft_ies[ANI_MAC_ADDR_SIZE]), pSession->ftSmeContext.psavedFTPreAuthRsp->ft_ies, pSession->ftSmeContext.psavedFTPreAuthRsp->ft_ies_length); *ft_ies_length = ANI_MAC_ADDR_SIZE + pSession->ftSmeContext.psavedFTPreAuthRsp->ft_ies_length; pSession->ftSmeContext.FTState = eFT_REASSOC_REQ_WAIT; #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOG1, FL(" Filled auth resp = %d"), *ft_ies_length); #endif sme_ReleaseGlobalLock( &pMac->sme ); return; }
/* --------------------------------------------------------------------------- \fn p2pRemainOnChannel \brief API to post the remain on channel command. \param hHal - The handle returned by macOpen. \param sessinId - HDD session ID. \param channel - Channel to remain on channel. \param duration - Duration for which we should remain on channel \param callback - callback function. \param pContext - argument to the callback function \return eHalStatus -------------------------------------------------------------------------------*/ eHalStatus p2pRemainOnChannel(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 channel, tANI_U32 duration, remainOnChanCallback callback, void *pContext, tANI_U8 isP2PProbeReqAllowed ) { eHalStatus status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); tSmeCmd *pRemainChlCmd = NULL; tANI_U32 phyMode; pRemainChlCmd = smeGetCommandBuffer(pMac); if(pRemainChlCmd == NULL) return eHAL_STATUS_FAILURE; if (SIR_BAND_5_GHZ == GetRFBand(channel)) { phyMode = WNI_CFG_PHY_MODE_11A; } else { phyMode = WNI_CFG_PHY_MODE_11G; } cfgSetInt(pMac, WNI_CFG_PHY_MODE, phyMode); do { /* call set in context */ pRemainChlCmd->command = eSmeCommandRemainOnChannel; pRemainChlCmd->sessionId = sessionId; pRemainChlCmd->u.remainChlCmd.chn = channel; pRemainChlCmd->u.remainChlCmd.duration = duration; pRemainChlCmd->u.remainChlCmd.isP2PProbeReqAllowed = isP2PProbeReqAllowed; pRemainChlCmd->u.remainChlCmd.callback = callback; pRemainChlCmd->u.remainChlCmd.callbackCtx = pContext; //Put it at the head of the Q if we just finish finding the peer and ready to send a frame status = csrQueueSmeCommand(pMac, pRemainChlCmd, eANI_BOOLEAN_FALSE); } while(0); smsLog(pMac, LOGW, "exiting function %s", __func__); return(status); }
eHalStatus ccmCfgGetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 *pValue) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS ; tCfgReq *req = pMac->ccm.comp[cfgId] ; if (req && req->state == eCCM_REQ_DONE) { *pValue = req->ccmValue ; } else { if (wlan_cfgGetInt(pMac, (tANI_U16)cfgId, pValue) != eSIR_SUCCESS) status = eHAL_STATUS_FAILURE; } return status ; }
eHalStatus oemData_OemDataReqOpen(tHalHandle hHal) { eHalStatus status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); do { //initialize all the variables to null vos_mem_set(&(pMac->oemData), sizeof(tOemDataStruct), 0); if(!HAL_STATUS_SUCCESS(status)) { smsLog(pMac, LOGE, "oemData_OemDataReqOpen: Cannot allocate memory for the timer function"); break; } } while(0); return status; }
/* * TDLS request API, called from HDD to Send Channel Switch Parameters */ VOS_STATUS csrTdlsSendChanSwitchReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, tANI_S32 tdlsOffCh, tANI_S32 tdlsOffChBwOffset, tANI_U8 tdlsSwMode) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); tSmeCmd *tdlsChanSwitchCmd; eHalStatus status = eHAL_STATUS_FAILURE ; //If connected and in Infra. Only then allow this if( CSR_IS_SESSION_VALID( pMac, sessionId ) && csrIsConnStateConnectedInfra( pMac, sessionId ) && (NULL != peerMac) ) { tdlsChanSwitchCmd = csrGetCommandBuffer(pMac) ; if(tdlsChanSwitchCmd) { tTdlsChanSwitchCmdInfo *tdlsChanSwitchCmdInfo = &tdlsChanSwitchCmd->u.tdlsCmd.u.tdlsChanSwitchCmdInfo; vos_mem_zero(&tdlsChanSwitchCmd->u.tdlsCmd, sizeof(tTdlsCmd)); tdlsChanSwitchCmd->sessionId = sessionId; vos_mem_copy(tdlsChanSwitchCmdInfo->peerMac, peerMac, sizeof(tSirMacAddr)); tdlsChanSwitchCmdInfo->tdlsOffCh = tdlsOffCh; tdlsChanSwitchCmdInfo->tdlsOffChBwOffset = tdlsOffChBwOffset; tdlsChanSwitchCmdInfo->tdlsSwMode = tdlsSwMode; tdlsChanSwitchCmd->command = eSmeCommandTdlsChannelSwitch; tdlsChanSwitchCmd->u.tdlsCmd.size = sizeof(tTdlsChanSwitchCmdInfo) ; smePushCommand(pMac, tdlsChanSwitchCmd, FALSE) ; status = eHAL_STATUS_SUCCESS ; smsLog( pMac, LOG1, FL("Successfully posted tdlsChanSwitchCmd to SME")); } } return status ; }
/* --------------------------------------------------------------------------- \fn p2p_remain_on_channel \brief API to post the remain on channel command. \param hHal - The handle returned by mac_open. \param sessinId - HDD session ID. \param channel - Channel to remain on channel. \param duration - Duration for which we should remain on channel \param callback - callback function. \param pContext - argument to the callback function \return CDF_STATUS -------------------------------------------------------------------------------*/ CDF_STATUS p2p_remain_on_channel(tHalHandle hHal, uint8_t sessionId, uint8_t channel, uint32_t duration, remainOnChanCallback callback, void *pContext, uint8_t isP2PProbeReqAllowed, uint32_t scan_id) { CDF_STATUS status = CDF_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); tSmeCmd *pRemainChlCmd = NULL; uint32_t phyMode; pRemainChlCmd = sme_get_command_buffer(pMac); if (pRemainChlCmd == NULL) return CDF_STATUS_E_FAILURE; if (SIR_BAND_5_GHZ == get_rf_band(channel)) { phyMode = WNI_CFG_PHY_MODE_11A; } else { phyMode = WNI_CFG_PHY_MODE_11G; } cfg_set_int(pMac, WNI_CFG_PHY_MODE, phyMode); do { /* call set in context */ pRemainChlCmd->command = eSmeCommandRemainOnChannel; pRemainChlCmd->sessionId = sessionId; pRemainChlCmd->u.remainChlCmd.chn = channel; pRemainChlCmd->u.remainChlCmd.duration = duration; pRemainChlCmd->u.remainChlCmd.isP2PProbeReqAllowed = isP2PProbeReqAllowed; pRemainChlCmd->u.remainChlCmd.callback = callback; pRemainChlCmd->u.remainChlCmd.callbackCtx = pContext; pRemainChlCmd->u.remainChlCmd.scan_id = scan_id; /* Put it at the head of the Q if we just finish finding the peer and ready to send a frame */ status = csr_queue_sme_command(pMac, pRemainChlCmd, false); } while (0); sms_log(pMac, LOGW, "exiting function %s", __func__); return (status); }
CDF_STATUS p2p_set_ps(tHalHandle hHal, tP2pPsConfig *pNoA) { tpP2pPsConfig pNoAParam; tSirMsgQ msg; CDF_STATUS status = CDF_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); pNoAParam = cdf_mem_malloc(sizeof(tP2pPsConfig)); if (NULL == pNoAParam) status = CDF_STATUS_E_NOMEM; else { cdf_mem_set(pNoAParam, sizeof(tP2pPsConfig), 0); cdf_mem_copy(pNoAParam, pNoA, sizeof(tP2pPsConfig)); msg.type = eWNI_SME_UPDATE_NOA; msg.bodyval = 0; msg.bodyptr = pNoAParam; lim_post_msg_api(pMac, &msg); } return status; }
/****************************************************************************** * Function: sme_NanEvent * * Description: * This callback function will be called when SME received eWNI_SME_NAN_EVENT * event from WMA * * Args: * hHal - HAL handle for device * pMsg - Message body passed from WDA; includes NAN header * * Returns: * VOS_STATUS ******************************************************************************/ VOS_STATUS sme_NanEvent(tHalHandle hHal, void* pMsg) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); VOS_STATUS status = VOS_STATUS_SUCCESS; if (NULL == pMsg) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("msg ptr is NULL")); status = VOS_STATUS_E_FAILURE; } else { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_MED, FL("SME: Received sme_NanEvent")); if (pMac->sme.nanCallback) { pMac->sme.nanCallback(pMac->hHdd, (tSirNanEvent *)pMsg); } } return status; }
eHalStatus ccmClose(tHalHandle hHal) { tHddHandle hHdd = halHandle2HddHandle(hHal); tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); tANI_U32 i ; tCfgReq *req ; ccmStop(hHal); /* Go thru comp[] to free all saved requests */ for (i = 0 ; i < CFG_PARAM_MAX_NUM ; ++i) { if ((req = pMac->ccm.comp[i]) != NULL) { freeCfgReq(hHdd, req); } } return palSpinLockFree(hHdd, pMac->ccm.lock); }
/*-------------------------------------------------------------------------- Cleanup the SME FT Global context. ------------------------------------------------------------------------*/ void sme_FTClose(tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); if (pMac->ft.ftSmeContext.auth_ft_ies != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOGE, FL(" Freeing %p and setting to NULL\n"), pMac->ft.ftSmeContext.auth_ft_ies); #endif vos_mem_free(pMac->ft.ftSmeContext.auth_ft_ies); pMac->ft.ftSmeContext.auth_ft_ies = NULL; } pMac->ft.ftSmeContext.auth_ft_ies_length = 0; if (pMac->ft.ftSmeContext.reassoc_ft_ies != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOGE, FL(" Freeing %p and setting to NULL\n"), pMac->ft.ftSmeContext.reassoc_ft_ies); #endif vos_mem_free(pMac->ft.ftSmeContext.reassoc_ft_ies); pMac->ft.ftSmeContext.reassoc_ft_ies = NULL; } pMac->ft.ftSmeContext.reassoc_ft_ies_length = 0; pMac->ft.ftSmeContext.FTState = eFT_START_READY; vos_mem_zero(pMac->ft.ftSmeContext.preAuthbssId, ANI_MAC_ADDR_SIZE); if (pMac->ft.ftSmeContext.psavedFTPreAuthRsp != NULL) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOGE, FL("%s: Freeing %p and setting to NULL\n"), pMac->ft.ftSmeContext.psavedFTPreAuthRsp); #endif vos_mem_free(pMac->ft.ftSmeContext.psavedFTPreAuthRsp); pMac->ft.ftSmeContext.psavedFTPreAuthRsp = NULL; } palTimerFree(pMac->hHdd, pMac->ft.ftSmeContext.preAuthReassocIntvlTimer); }
eHalStatus sme_FTUpdateKey( tHalHandle hHal, tCsrRoamSetKey * pFTKeyInfo ) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_FAILURE; status = sme_AcquireGlobalLock( &pMac->sme ); if (!( HAL_STATUS_SUCCESS( status ))) { return eHAL_STATUS_FAILURE; } if (pFTKeyInfo == NULL) { smsLog( pMac, LOGE, "%s: pFTKeyInfo is NULL\n", __FUNCTION__); sme_ReleaseGlobalLock( &pMac->sme ); return eHAL_STATUS_FAILURE; } #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOGE, "sme_FTUpdateKey is received in state %d\n", pMac->ft.ftSmeContext.FTState); #endif // Global Station FT State switch(pMac->ft.ftSmeContext.FTState) { case eFT_SET_KEY_WAIT: status = sme_FTSendUpdateKeyInd( hHal, pFTKeyInfo ); pMac->ft.ftSmeContext.FTState = eFT_START_READY; break; default: smsLog( pMac, LOGE, "%s: Unhandled state=%d\n", __FUNCTION__, pMac->ft.ftSmeContext.FTState); status = eHAL_STATUS_FAILURE; break; } sme_ReleaseGlobalLock( &pMac->sme ); return status; }
/*========================================================================== FUNCTION sapChanSelInit DESCRIPTION Function sapChanSelInit allocates the memory, intializes the structures used by the channel selection algorithm DEPENDENCIES NA. PARAMETERS IN *pSpectInfoParams : Pointer to tSapChSelSpectInfo structure RETURN VALUE v_BOOL_t: Success or FAIL SIDE EFFECTS ============================================================================*/ v_BOOL_t sapChanSelInit(tHalHandle halHandle, tSapChSelSpectInfo *pSpectInfoParams) { tSapSpectChInfo *pSpectCh = NULL; v_U8_t *pChans = NULL; v_U16_t channelnum = 0; tpAniSirGlobal pMac = PMAC_STRUCT(halHandle); VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s", __FUNCTION__); // Channels for that 2.4GHz band //Considered only for 2.4GHz need to change in future to support 5GHz support pSpectInfoParams->numSpectChans = pMac->scan.base20MHzChannels.numChannels; // Allocate memory for weight computation of 2.4GHz pSpectCh = (tSapSpectChInfo *)vos_mem_malloc((pSpectInfoParams->numSpectChans) * sizeof(*pSpectCh)); if(pSpectCh == NULL) { VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "In %s, VOS_MALLOC_ERR", __FUNCTION__); return eSAP_FALSE; } vos_mem_zero(pSpectCh, (pSpectInfoParams->numSpectChans) * sizeof(*pSpectCh)); // Initialize the pointers in the DfsParams to the allocated memory pSpectInfoParams->pSpectCh = pSpectCh; pChans = pMac->scan.base20MHzChannels.channelList; // Fill the channel number in the spectrum in the operating freq band for (channelnum = 0; channelnum < pSpectInfoParams->numSpectChans; channelnum++) { if(*pChans == 14 ) //OFDM rates are not supported on channel 14 continue; pSpectCh->chNum = *pChans; pSpectCh->valid = eSAP_TRUE; pSpectCh->rssiAgr = SOFTAP_MIN_RSSI;// Initialise for all channels pSpectCh++; pChans++; } return eSAP_TRUE; }
eHalStatus p2pSetPs(tHalHandle hHal, tP2pPsConfig *pNoA) { tpP2pPsConfig pNoAParam; tSirMsgQ msg; eHalStatus status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); pNoAParam = vos_mem_malloc(sizeof(tP2pPsConfig)); if ( NULL == pNoAParam ) status = eHAL_STATUS_FAILURE; else { vos_mem_set(pNoAParam, sizeof(tP2pPsConfig), 0); vos_mem_copy(pNoAParam, pNoA, sizeof(tP2pPsConfig)); msg.type = eWNI_SME_UPDATE_NOA; msg.bodyval = 0; msg.bodyptr = pNoAParam; limPostMsgApi(pMac, &msg); } return status; }