diff options
| author | Chandrasekaran, Manishekar <cmshekar@qti.qualcomm.com> | 2014-02-04 16:36:25 +0530 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-02-13 21:04:07 -0800 |
| commit | 7dbf309e8a430f727f1fbe5dc173659bd05a0532 (patch) | |
| tree | 3faafe225484dafad908da03fc6c060d70a6a8ff | |
| parent | 5d4f450a226ae480f29c9c778ec04fba0ab53d7b (diff) | |
qcacld: Avoid cross layer context reference during check for max interfaces
During the check to prevent the Host from configuring more than maximum
number of interfaces than that are allowed by the Firmware, the station
management entity is deferencing cross layer context information. This
fix provides an alternative solution to avoid this issue.
CRs-Fixed: 611191
Change-Id: I8a34bdb3389ce9d8240990e4f6e90b47cbfd0031
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 3 | ||||
| -rw-r--r-- | CORE/SME/inc/smeInternal.h | 2 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 1 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 35 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 4 |
5 files changed, 13 insertions, 32 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index ee4ec3e5d0bf..8f5b54dc0ea2 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -5154,6 +5154,9 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) smeConfig.pnoOffload = pHddCtx->cfg_ini->PnoOffload; #endif + /* Update maximum interfaces information */ + smeConfig.max_intf_count = pHddCtx->max_intf_count; + smeConfig.fEnableDebugLog = pHddCtx->cfg_ini->gEnableDebugLog; halStatus = sme_UpdateConfig( pHddCtx->hHal, &smeConfig); if ( !HAL_STATUS_SUCCESS( halStatus ) ) diff --git a/CORE/SME/inc/smeInternal.h b/CORE/SME/inc/smeInternal.h index 06481618164d..e1ab3f9ea7e5 100644 --- a/CORE/SME/inc/smeInternal.h +++ b/CORE/SME/inc/smeInternal.h @@ -143,6 +143,8 @@ typedef struct tagSmeStruct #ifdef FEATURE_WLAN_CH_AVOID void (*pChAvoidNotificationCb) (void *hdd_context, void *indi_param); #endif /* FEATURE_WLAN_CH_AVOID */ + /* Maximum interfaces allowed by the host */ + tANI_U8 max_intf_count; } tSmeStruct, *tpSmeStruct; diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index cfc3af48b448..a003eee923ed 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -130,6 +130,7 @@ typedef struct _smeConfigParams tANI_BOOLEAN fP2pListenOffload; tANI_BOOLEAN pnoOffload; tANI_U8 fEnableDebugLog; + tANI_U8 max_intf_count; } tSmeConfigParams, *tpSmeConfigParams; typedef enum diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 3b5f5db25f46..ea5ddf556bc8 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -62,7 +62,6 @@ #include "csrApi.h" #include "pmc.h" #include "vos_nvitem.h" -#include "wlan_hdd_main.h" #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING #include "csrNeighborRoam.h" #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */ @@ -14120,36 +14119,6 @@ eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pComman &pCommand->u.addStaSessionCmd, pCommand->sessionId); } - -/* Function: csr_check_max_interfaces - * Return: 0 - Success, 1 - Failure - */ -tANI_U8 csr_check_max_interfaces(tpAniSirGlobal pMac,tANI_U32 i) -{ - hdd_context_t *pHddCtx; - v_CONTEXT_t vosContext; - - vosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL ); - if (NULL == vosContext) { - smsLog(pMac, LOGE, "%s: Failed to get vos context", __func__); - return 1; - } - - pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, vosContext); - if (NULL == pHddCtx) { - smsLog(pMac, LOGE, "%s: Failed to get hdd context", __func__); - return 1; - } - - if ((v_U8_t)i >= pHddCtx->max_intf_count){ - smsLog(pMac, LOGE, "%s: Max interfaces! Session creation will fail", __func__); - return 1; - } - else { - return 0; - } -} - eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext, @@ -14167,8 +14136,10 @@ eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac, for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ ) { - if (csr_check_max_interfaces( pMac, i)) + if ((v_U8_t)i >= pMac->sme.max_intf_count) { + smsLog(pMac, LOGE, "%s: Reached max interfaces! Session creation will fail", __func__); break; + } if( !CSR_IS_SESSION_VALID( pMac, i ) ) { diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 1bf6090fa141..112b2de5cde6 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -1633,6 +1633,9 @@ eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) pMac->fEnableDebugLog = pSmeConfigParams->fEnableDebugLog; + /* update interface configuration */ + pMac->sme.max_intf_count = pSmeConfigParams->max_intf_count; + return status; } @@ -3946,6 +3949,7 @@ eHalStatus sme_GetConfigParam(tHalHandle hHal, tSmeConfigParams *pParam) #endif pParam->fScanOffload = pMac->fScanOffload; pParam->fP2pListenOffload = pMac->fP2pListenOffload; + pParam->max_intf_count = pMac->sme.max_intf_count; sme_ReleaseGlobalLock( &pMac->sme ); } |
