/*---------------------------------------------------------------------------- @brief Function to resume the wlan driver. This function will get called by platform driver Resume on System Resume @param dev platform_func_device @return None ----------------------------------------------------------------------------*/ int hddDevResumeHdlr(struct device *dev) { hdd_context_t* pHddCtx = NULL; pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_INFO, "%s: WLAN being resumed by Android OS",__func__); if(pHddCtx->isWlanSuspended != TRUE) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: WLAN is already in resumed state",__func__); return 0; } /* Resume the wlan driver */ wlan_resume(pHddCtx); #ifdef HAVE_WCNSS_SUSPEND_RESUME_NOTIFY if(suspend_notify_sent == true) { wcnss_resume_notify(); suspend_notify_sent = false; } #endif return 0; }
/*---------------------------------------------------------------------------- @brief Function to suspend the wlan driver. This function will get called by platform driver Suspend on System Suspend @param dev platform_func_device @return None ----------------------------------------------------------------------------*/ int hddDevSuspendHdlr(struct device *dev) { int ret = 0; hdd_context_t* pHddCtx = NULL; pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: WLAN suspended by platform driver",__func__); /* Get the HDD context */ if(!pHddCtx) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: HDD context is Null",__func__); return 0; } if(pHddCtx->isWlanSuspended == TRUE) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: WLAN is already in suspended state",__func__); return 0; } /* Suspend the wlan driver */ ret = wlan_suspend(pHddCtx); if(ret != 0) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: Not able to suspend wlan",__func__); return ret; } return 0; }
/*---------------------------------------------------------------------------- @brief TM Level Change handler Received Tm Level changed notification @param dev : Device context changedTmLevel : Changed new TM level @return ----------------------------------------------------------------------------*/ void hddDevTmLevelChangedHandler(struct device *dev, int changedTmLevel) { hdd_context_t *pHddCtx = NULL; WLAN_TmLevelEnumType newTmLevel = changedTmLevel; hdd_adapter_t *staAdapater; pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); if((pHddCtx->tmInfo.currentTmLevel == newTmLevel) || (!pHddCtx->cfg_ini->thermalMitigationEnable)) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_WARN, "%s: TM Not enabled %d or Level does not changed %d", __func__, pHddCtx->cfg_ini->thermalMitigationEnable, newTmLevel); /* TM Level does not changed, * Or feature does not enabled * do nothing */ return; } sme_SetTmLevel(pHddCtx->hHal, changedTmLevel, 0); if(mutex_lock_interruptible(&pHddCtx->tmInfo.tmOperationLock)) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_ERROR, "%s: Aquire lock fail", __func__); return; } pHddCtx->tmInfo.currentTmLevel = changedTmLevel; pHddCtx->tmInfo.txFrameCount = 0; vos_mem_copy(&pHddCtx->tmInfo.tmAction, &thermalMigrationAction[newTmLevel], sizeof(hdd_tmLevelAction_t)); if(pHddCtx->tmInfo.tmAction.enterImps) { staAdapater = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION); if(staAdapater) { if(hdd_connIsConnected(WLAN_HDD_GET_STATION_CTX_PTR(staAdapater))) { sme_RoamDisconnect(pHddCtx->hHal, staAdapater->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); } } } mutex_unlock(&pHddCtx->tmInfo.tmOperationLock); return; }
/*---------------------------------------------------------------------------- @brief Function to resume the wlan driver. This function will get called by platform driver Resume on System Resume @param dev platform_func_device @return None ----------------------------------------------------------------------------*/ int hddDevResumeHdlr(struct device *dev) { hdd_context_t* pHddCtx = NULL; pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_INFO, "%s: WLAN being resumed by Android OS",__func__); if(pHddCtx->isWlanSuspended != TRUE) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: WLAN is already in resumed state",__func__); return 0; } /* Resume the wlan driver */ wlan_resume(pHddCtx); return 0; }
/*---------------------------------------------------------------------------- @brief Function to suspend the wlan driver. This function will get called by platform driver Suspend on System Suspend @param dev platform_func_device @return None ----------------------------------------------------------------------------*/ int hddDevSuspendHdlr(struct device *dev) { int ret = 0; hdd_context_t* pHddCtx = NULL; pHddCtx = (hdd_context_t*)wcnss_wlan_get_drvdata(dev); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: WLAN suspended by platform driver",__func__); /* Get the HDD context */ if(!pHddCtx) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: HDD context is Null",__func__); return 0; } if(pHddCtx->isWlanSuspended == TRUE) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: WLAN is already in suspended state",__func__); return 0; } /* Suspend the wlan driver */ ret = wlan_suspend(pHddCtx); if(ret != 0) { VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_FATAL,"%s: Not able to suspend wlan",__func__); return ret; } #ifdef HAVE_WCNSS_SUSPEND_RESUME_NOTIFY if(hdd_is_suspend_notify_allowed(pHddCtx)) { wcnss_suspend_notify(); suspend_notify_sent = true; } #endif return 0; }