From 43e25b17d1a2d6167cb89dfb136518a4f4f4cd73 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Fri, 15 Apr 2016 16:26:36 -0700 Subject: [PATCH] qcacld-3.0: Fix layer violation in SME Some of the SME APIs are using lim APIs, remove those violation. CRs-Fixed: 992939 Change-Id: I0f29b5ab3a4c5df9881b5af556d155a22acfd392 --- core/cds/inc/cds_regdomain.h | 2 ++ core/mac/src/pe/lim/lim_utils.h | 3 --- core/sme/inc/csr_api.h | 1 - core/sme/inc/sme_api.h | 2 ++ core/sme/inc/sme_ft_api.h | 2 -- core/sme/src/csr/csr_api_roam.c | 18 ++++++----------- core/sme/src/csr/csr_api_scan.c | 11 +++++----- core/sme/src/csr/csr_util.c | 36 +++++++++++++++++++++++++++++++++ core/sme/src/nan/nan_api.c | 2 +- core/sme/src/p2p/p2p_api.c | 1 - 10 files changed, 52 insertions(+), 26 deletions(-) diff --git a/core/cds/inc/cds_regdomain.h b/core/cds/inc/cds_regdomain.h index 336a20d89869..447eec39821a 100644 --- a/core/cds/inc/cds_regdomain.h +++ b/core/cds/inc/cds_regdomain.h @@ -76,6 +76,8 @@ #define CTRY_DEFAULT 0 #define COUNTRY_ERD_FLAG 0x8000 #define WORLDWIDE_ROAMING_FLAG 0x4000 +#define MIN_TX_PWR_CAP 8 +#define MAX_TX_PWR_CAP 22 enum country_code { CTRY_AFGHANISTAN = 4, diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 7c961dec3c41..1f0ffbbc23e1 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -50,9 +50,6 @@ typedef enum { TWO_BYTE = 2 } eSizeOfLenField; -#define MIN_TX_PWR_CAP 8 -#define MAX_TX_PWR_CAP 22 - #define LIM_STA_ID_MASK 0x00FF #define LIM_AID_MASK 0xC000 #define LIM_SPECTRUM_MANAGEMENT_BIT_MASK 0x0100 diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 8a05500d717d..e2f1fcf03b6a 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -142,7 +142,6 @@ typedef enum { } eCsrPhyMode; typedef enum { - eCSR_BSS_TYPE_NONE, eCSR_BSS_TYPE_INFRASTRUCTURE, eCSR_BSS_TYPE_INFRA_AP, /* SoftAP AP */ eCSR_BSS_TYPE_IBSS, /* IBSS network we'll NOT start */ diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 3d3f8c8f7394..fb6f569170cf 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -801,6 +801,8 @@ QDF_STATUS sme_update_add_ie(tHalHandle hHal, tSirUpdateIE *pUpdateIE, eUpdateIEsType updateType); QDF_STATUS sme_update_connect_debug(tHalHandle hHal, uint32_t set_value); const char *sme_request_type_to_string(const uint8_t request_type); +const char *sme_scan_type_to_string(const uint8_t scan_type); +const char *sme_bss_type_to_string(const uint8_t bss_type); QDF_STATUS sme_ap_disable_intra_bss_fwd(tHalHandle hHal, uint8_t sessionId, bool disablefwd); uint32_t sme_get_channel_bonding_mode5_g(tHalHandle hHal); diff --git a/core/sme/inc/sme_ft_api.h b/core/sme/inc/sme_ft_api.h index 57fb60655bb7..3b0ff3aaf19c 100644 --- a/core/sme/inc/sme_ft_api.h +++ b/core/sme/inc/sme_ft_api.h @@ -28,8 +28,6 @@ #if !defined(__SME_FTAPI_H) #define __SME_FTAPI_H -#include - typedef enum eFTIEState { eFT_START_READY, /* Start before and after 11r assoc */ eFT_AUTH_REQ_READY, /* When we have recvd the 1st or nth auth req */ diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 3950e624bdf2..bb812b1747cf 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -35,7 +35,6 @@ #include "ani_global.h" /* for tpAniSirGlobal */ #include "wma_types.h" #include "wma_if.h" /* for STA_INVALID_IDX. */ -#include "lim_utils.h" #include "cds_mq.h" #include "csr_inside_api.h" #include "sms_debug.h" @@ -91,9 +90,6 @@ static bool b_roam_scan_offload_started; ------------------------------------------------------------------------*/ static tCsrRoamSession csr_roam_roam_session[CSR_ROAM_SESSION_MAX]; -/*-------------------------------------------------------------------------- - Type declarations - ------------------------------------------------------------------------*/ #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR int diag_auth_type_from_csr_type(eCsrAuthType authType) { @@ -7330,7 +7326,7 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId, pSession->join_bssid_count = 0; sms_log(pMac, LOG1, FL("called BSSType = %s (%d) authtype = %d encryType = %d"), - lim_bss_type_to_string(pProfile->BSSType), + sme_bss_type_to_string(pProfile->BSSType), pProfile->BSSType, pProfile->AuthType.authType[0], pProfile->EncryptionType.encryptionType[0]); csr_roam_cancel_roaming(pMac, sessionId); @@ -7526,7 +7522,7 @@ csr_roam_reassoc(tpAniSirGlobal mac_ctx, uint32_t session_id, } sms_log(mac_ctx, LOG1, FL("called BSSType = %s (%d) authtype = %d encryType = %d"), - lim_bss_type_to_string(profile->BSSType), + sme_bss_type_to_string(profile->BSSType), profile->BSSType, profile->AuthType.authType[0], profile->EncryptionType.encryptionType[0]); csr_roam_cancel_roaming(mac_ctx, session_id); @@ -14782,7 +14778,7 @@ QDF_STATUS csr_process_add_sta_session_command(tpAniSirGlobal pMac, add_sta_self_req = qdf_mem_malloc(sizeof(struct add_sta_self_params)); if (NULL == add_sta_self_req) { - lim_log(pMac, LOGP, + sms_log(pMac, LOGP, FL ("Unable to allocate memory for tAddSelfStaParams")); return status; @@ -14800,15 +14796,14 @@ QDF_STATUS csr_process_add_sta_session_command(tpAniSirGlobal pMac, msg.bodyptr = add_sta_self_req; msg.bodyval = 0; - lim_log(pMac, LOG1, + sms_log(pMac, LOG1, FL ("Send WMA_ADD_STA_SELF_REQ for selfMac=" MAC_ADDRESS_STR), MAC_ADDR_ARRAY(add_sta_self_req->self_mac_addr)); - MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msg.type)); status = wma_post_ctrl_msg(pMac, &msg); if (status != QDF_STATUS_SUCCESS) { - lim_log(pMac, LOGP, FL("wma_post_ctrl_msg failed")); + sms_log(pMac, LOGP, FL("wma_post_ctrl_msg failed")); qdf_mem_free(add_sta_self_req); add_sta_self_req = NULL; } @@ -14999,7 +14994,7 @@ QDF_STATUS csr_process_del_sta_session_command(tpAniSirGlobal pMac, QDF_STATUS status = QDF_STATUS_E_FAILURE; del_sta_self_req = qdf_mem_malloc(sizeof(struct del_sta_self_params)); if (NULL == del_sta_self_req) { - lim_log(pMac, LOGP, + sms_log(pMac, LOGP, FL(" mem alloc failed for tDelStaSelfParams")); return QDF_STATUS_E_NOMEM; } @@ -15016,7 +15011,6 @@ QDF_STATUS csr_process_del_sta_session_command(tpAniSirGlobal pMac, sms_log(pMac, LOG1, FL("sending WMA_DEL_STA_SELF_REQ")); - MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msg.type)); status = wma_post_ctrl_msg(pMac, &msg); if (status != QDF_STATUS_SUCCESS) { sms_log(pMac, LOGP, FL("wma_post_ctrl_msg failed")); diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 12a6c8094870..a7cd0987b30c 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -49,7 +49,6 @@ #include "wma_types.h" #include "cds_utils.h" #include "cfg_api.h" -#include "lim_api.h" #include "wma.h" #include "cds_concurrency.h" @@ -4867,10 +4866,10 @@ QDF_STATUS csr_send_mb_scan_req(tpAniSirGlobal pMac, uint16_t sessionId, pScanReqParam->hiddenSsid); sms_log(pMac, LOG1, FL("scanType = %s (%u) BSSType = %s (%u) numOfSSIDs = %d" - " numOfChannels = %d requestType = %s (%d) p2pSearch = %d\n"), - lim_scan_type_to_string(pScanReq->scanType), + " numOfChannels = %d requestType = %s (%d) p2pSearch = %d\n"), + sme_scan_type_to_string(pScanReq->scanType), pScanReq->scanType, - lim_bss_type_to_string(pScanReq->BSSType), + sme_bss_type_to_string(pScanReq->BSSType), pScanReq->BSSType, pScanReq->SSIDs.numOfSSIDs, pScanReq->ChannelInfo.numOfChannels, @@ -5017,8 +5016,8 @@ send_scan_req: sms_log(pMac, LOG1, FL("scanId %d domainIdCurrent %d scanType %s (%d) bssType %s (%d) requestType %s (%d) numChannels %d"), pMsg->scan_id, pMac->scan.domainIdCurrent, - lim_scan_type_to_string(pMsg->scanType), pMsg->scanType, - lim_bss_type_to_string(pMsg->bssType), pMsg->bssType, + sme_scan_type_to_string(pMsg->scanType), pMsg->scanType, + sme_bss_type_to_string(pMsg->bssType), pMsg->bssType, sme_request_type_to_string(pScanReq->requestType), pScanReq->requestType, pMsg->channelList.numChannels); diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 720e7c4ff20a..1a3a2b67d7fb 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -5591,6 +5591,42 @@ const char *sme_request_type_to_string(const uint8_t request_type) } } +/** + * sme_bsstype_to_string() - converts bss type to string. + * @bss_type: bss type enum + * + * Return: printable string for bss type + */ +const char *sme_bss_type_to_string(const uint8_t bss_type) +{ + switch (bss_type) { + CASE_RETURN_STRING(eCSR_BSS_TYPE_INFRASTRUCTURE); + CASE_RETURN_STRING(eCSR_BSS_TYPE_INFRA_AP); + CASE_RETURN_STRING(eCSR_BSS_TYPE_IBSS); + CASE_RETURN_STRING(eCSR_BSS_TYPE_START_IBSS); + CASE_RETURN_STRING(eCSR_BSS_TYPE_ANY); + default: + return "unknown bss type"; + } +} + +/** + * sme_scantype_to_string() - converts scan type to string. + * @scan_type: scan type enum + * + * Return: printable string for scan type + */ +const char *sme_scan_type_to_string(const uint8_t scan_type) +{ + switch (scan_type) { + CASE_RETURN_STRING(eSIR_PASSIVE_SCAN); + CASE_RETURN_STRING(eSIR_ACTIVE_SCAN); + CASE_RETURN_STRING(eSIR_BEACON_TABLE); + default: + return "unknown scan type"; + } +} + QDF_STATUS csr_add_to_channel_list_front(uint8_t *pChannelList, int numChannels, uint8_t channel) { diff --git a/core/sme/src/nan/nan_api.c b/core/sme/src/nan/nan_api.c index 7fc71e0f944e..5398ffa3398c 100644 --- a/core/sme/src/nan/nan_api.c +++ b/core/sme/src/nan/nan_api.c @@ -30,8 +30,8 @@ #include "csr_inside_api.h" #include "sme_inside.h" #include "nan_api.h" -#include "lim_api.h" #include "cfg_api.h" +#include "wma_types.h" /****************************************************************************** * Function: sme_nan_register_callback diff --git a/core/sme/src/p2p/p2p_api.c b/core/sme/src/p2p/p2p_api.c index 9deb1678b48d..43cf2c0075a0 100644 --- a/core/sme/src/p2p/p2p_api.c +++ b/core/sme/src/p2p/p2p_api.c @@ -30,7 +30,6 @@ #include "csr_inside_api.h" #include "sme_inside.h" #include "p2p_api.h" -#include "lim_api.h" #include "cfg_api.h" #include "wma.h"