Browse Source

qcacld-3.0: change mac for policy manager restructuring

Modify mac code to cope with the policy manager moving to host
common.

Change-Id: I2fa5f7ed1a597b4fa5cea6aa87f5ed9f849a1cd7
CRs-Fixed: 2009818
Tushnim Bhattacharyya 8 years ago
parent
commit
66348bd6ba

+ 1 - 1
core/mac/src/pe/lim/lim_api.c

@@ -69,7 +69,7 @@
 #include "cds_utils.h"
 #include "sys_startup.h"
 #include "cds_api.h"
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 #include "nan_datapath.h"
 #include "wma.h"
 #include "wlan_mgmt_txrx_utils_api.h"

+ 4 - 4
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -54,7 +54,7 @@
 #include "lim_send_messages.h"
 #include "rrm_api.h"
 #include "lim_session_utils.h"
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 #include "wma_types.h"
 #include "wma.h"
 #include <cdp_txrx_cmn.h>
@@ -404,10 +404,10 @@ lim_process_ext_channel_switch_action_frame(tpAniSirGlobal mac_ctx,
 	 * and no concurrent session is running.
 	 */
 	if (!((session_entry->currentOperChannel != target_channel) &&
-	 ((cds_get_channel_state(target_channel)
+	((cds_get_channel_state(target_channel)
 				== CHANNEL_STATE_ENABLE) ||
-	 (cds_get_channel_state(target_channel) == CHANNEL_STATE_DFS &&
-	 !cds_concurrent_open_sessions_running())))) {
+	(cds_get_channel_state(target_channel) == CHANNEL_STATE_DFS &&
+	!policy_mgr_concurrent_open_sessions_running(mac_ctx->psoc))))) {
 		lim_log(mac_ctx, LOGE, FL("Channel %d is not valid"),
 							target_channel);
 		return;

+ 1 - 1
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -62,7 +62,7 @@
 #include "qdf_types.h"
 #include "cds_packet.h"
 #include "qdf_mem.h"
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 #include "nan_datapath.h"
 
 void lim_log_session_states(tpAniSirGlobal pMac);

+ 7 - 5
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -48,7 +48,7 @@
 #include "wma_types.h"
 #include "cds_utils.h"
 #include "lim_types.h"
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 #include "nan_datapath.h"
 
 #define MAX_SUPPORTED_PEERS_WEP 16
@@ -3241,7 +3241,8 @@ void lim_process_switch_channel_rsp(tpAniSirGlobal pMac, void *body)
 		/* If MCC upgrade/DBS downgrade happended during channel switch,
 		 * the policy manager connection table needs to be updated.
 		 */
-		cds_update_connection_info(psessionEntry->smeSessionId);
+		policy_mgr_update_connection_info(pMac->psoc,
+			psessionEntry->smeSessionId);
 		if (psessionEntry->pePersona == QDF_P2P_CLIENT_MODE) {
 			lim_log(pMac, LOG1,
 				FL("Send p2p operating channel change conf action frame once first beacon is received on new channel"));
@@ -3259,12 +3260,13 @@ void lim_process_switch_channel_rsp(tpAniSirGlobal pMac, void *body)
 		 * SAP.
 		 */
 		lim_send_sme_ap_channel_switch_resp(pMac, psessionEntry,
-						    pChnlParams);
+						pChnlParams);
 		/* If MCC upgrade/DBS downgrade happended during channel switch,
 		 * the policy manager connection table needs to be updated.
 		 */
-		cds_update_connection_info(psessionEntry->smeSessionId);
-		cds_set_do_hw_mode_change_flag(true);
+		policy_mgr_update_connection_info(pMac->psoc,
+						psessionEntry->smeSessionId);
+		policy_mgr_set_do_hw_mode_change_flag(pMac->psoc, true);
 	}
 	break;
 	default:

+ 1 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -135,7 +135,7 @@ static QDF_STATUS lim_process_set_hw_mode(tpAniSirGlobal mac, uint32_t *msg)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct scheduler_msg message;
-	struct sir_hw_mode *req_msg;
+	struct policy_mgr_hw_mode *req_msg;
 	uint32_t len;
 	struct s_sir_set_hw_mode *buf;
 	struct scheduler_msg resp_msg;

+ 1 - 1
core/sap/src/sap_api_link_cntl.c

@@ -53,7 +53,7 @@
 #include "sme_api.h"
 /* SAP Internal API header file */
 #include "sap_internal.h"
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 #include "wma.h"
 #include <wlan_objmgr_vdev_obj.h>
 #include <wlan_objmgr_pdev_obj.h>

+ 33 - 9
core/sap/src/sap_fsm.c

@@ -50,7 +50,7 @@
 #include "cds_ieee80211_common_i.h"
 #include "cds_reg_service.h"
 #include "qdf_util.h"
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 #include <wlan_objmgr_pdev_obj.h>
 #include <wlan_objmgr_vdev_obj.h>
 #include <wlan_utility.h>
@@ -2238,7 +2238,7 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (cds_concurrent_beaconing_sessions_running()) {
+	if (policy_mgr_concurrent_beaconing_sessions_running(mac_ctx->psoc)) {
 		con_ch =
 			sme_get_concurrent_operation_channel(h_hal);
 #ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
@@ -2282,7 +2282,8 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
 #endif
 	}
 
-	if (cds_get_concurrency_mode() == (QDF_STA_MASK | QDF_SAP_MASK)) {
+	if (policy_mgr_get_concurrency_mode(mac_ctx->psoc) ==
+		(QDF_STA_MASK | QDF_SAP_MASK)) {
 #ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
 		if (sap_context->channel == AUTO_CHANNEL_SELECT)
 			sap_context->dfs_ch_disable = true;
@@ -2482,7 +2483,9 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
 			/* This wait happens in the hostapd context. The event
 			 * is set in the MC thread context.
 			 */
-			qdf_status = cds_update_and_wait_for_connection_update(
+			qdf_status =
+			policy_mgr_update_and_wait_for_connection_update(
+					mac_ctx->psoc,
 					sap_context->sessionId,
 					sap_context->channel,
 					SIR_UPDATE_REASON_START_AP);
@@ -3755,7 +3758,8 @@ static QDF_STATUS sap_fsm_state_ch_select(ptSapContext sap_ctx,
 		 * ACS check if AP1 ACS resulting channel is DFS and if yes
 		 * override AP2 ACS scan result with AP1 DFS channel
 		 */
-		if (cds_concurrent_beaconing_sessions_running()) {
+		if (policy_mgr_concurrent_beaconing_sessions_running(
+			mac_ctx->psoc)) {
 			uint16_t con_ch;
 
 			con_ch = sme_get_concurrent_operation_channel(hal);
@@ -4831,7 +4835,25 @@ static QDF_STATUS sap_get_5ghz_channel_list(ptSapContext sapContext)
 	struct sir_pcl_list pcl;
 	QDF_STATUS status;
 	enum channel_state ch_state;
+	tpAniSirGlobal mac_ctx;
+	tHalHandle h_hal;
+
 	pcl.pcl_len = 0;
+	h_hal = cds_get_context(QDF_MODULE_ID_SME);
+	if (NULL == h_hal) {
+		/* we have a serious problem */
+		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_FATAL,
+		FL("invalid h_hal"));
+		return QDF_STATUS_E_FAULT;
+	}
+
+	mac_ctx = PMAC_STRUCT(h_hal);
+	if (NULL == mac_ctx) {
+		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
+		FL("Invalid MAC context"));
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	if (NULL == sapContext) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			  "Invalid sapContext pointer on sap_get_channel_list");
@@ -4851,13 +4873,15 @@ static QDF_STATUS sap_get_5ghz_channel_list(ptSapContext sapContext)
 			  " Memory Allocation failed sap_get_channel_list");
 		return QDF_STATUS_E_NOMEM;
 	}
-	if (cds_mode_specific_connection_count(CDS_SAP_MODE, NULL) == 0) {
-		status = cds_get_pcl(CDS_SAP_MODE,
+	if (policy_mgr_mode_specific_connection_count(mac_ctx->psoc,
+		PM_SAP_MODE, NULL) == 0) {
+		status = policy_mgr_get_pcl(mac_ctx->psoc, PM_SAP_MODE,
 				pcl.pcl_list, &pcl.pcl_len, pcl.weight_list,
 				QDF_ARRAY_SIZE(pcl.weight_list));
 	} else  {
-		status = cds_get_pcl_for_existing_conn(CDS_SAP_MODE,
-				pcl.pcl_list, &pcl.pcl_len, pcl.weight_list,
+		status = policy_mgr_get_pcl_for_existing_conn(mac_ctx->psoc,
+				PM_SAP_MODE, pcl.pcl_list, &pcl.pcl_len,
+				pcl.weight_list,
 				QDF_ARRAY_SIZE(pcl.weight_list));
 	}
 	if (status != QDF_STATUS_SUCCESS) {

+ 6 - 5
core/sap/src/sap_module.c

@@ -54,7 +54,7 @@
 #include "sme_inside.h"
 #include "cds_ieee80211_common_i.h"
 #include "cds_regdomain.h"
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 
 /*----------------------------------------------------------------------------
  * Preprocessor Definitions and Constants
@@ -1748,8 +1748,8 @@ wlansap_set_channel_change_with_csa(void *p_cds_gctx, uint32_t targetChannel,
 	QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
 		"%s: sap chan:%d target:%d conn on 5GHz:%d",
 		__func__, sapContext->channel, targetChannel,
-		cds_is_any_mode_active_on_band_along_with_session(
-					sapContext->sessionId, CDS_BAND_5));
+		policy_mgr_is_any_mode_active_on_band_along_with_session(
+			pMac->psoc, sapContext->sessionId, POLICY_MGR_BAND_5));
 
 	/*
 	 * Now, validate if the passed channel is valid in the
@@ -1760,8 +1760,9 @@ wlansap_set_channel_change_with_csa(void *p_cds_gctx, uint32_t targetChannel,
 			CHANNEL_STATE_ENABLE) ||
 		(cds_get_channel_state(targetChannel) ==
 			CHANNEL_STATE_DFS &&
-		!cds_is_any_mode_active_on_band_along_with_session(
-			sapContext->sessionId, CDS_BAND_5)))) {
+		!policy_mgr_is_any_mode_active_on_band_along_with_session(
+			pMac->psoc, sapContext->sessionId,
+			POLICY_MGR_BAND_5)))) {
 		/*
 		 * validate target channel switch w.r.t various concurrency
 		 * rules set.