Преглед изворни кода

qcacld-3.0: HDD change for policy manager restructuring part 1

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

CRs-Fixed: 2009818
Change-Id: I6972216f56abdaa28c012449926f640074d4acb5
Tushnim Bhattacharyya пре 8 година
родитељ
комит
8716158e35

+ 9 - 7
core/hdd/inc/wlan_hdd_conc_ut.h

@@ -31,20 +31,21 @@
 /* Include files */
 
 #include "wlan_hdd_main.h"
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 #ifdef MPC_UT_FRAMEWORK
 void clean_report(hdd_context_t *hdd_ctx);
 void fill_report(hdd_context_t *hdd_ctx, char *title,
 	uint32_t first_persona, uint32_t second_persona, uint32_t third_persona,
 	uint32_t chnl_1st_conn, uint32_t chnl_2nd_conn, uint32_t chnl_3rd_conn,
-	bool status, enum cds_pcl_type pcl_type, char *reason, uint8_t *pcl);
+	bool status, enum policy_mgr_pcl_type pcl_type, char *reason,
+	uint8_t *pcl);
 void print_report(hdd_context_t *hdd_ctx);
 void wlan_hdd_one_connection_scenario(hdd_context_t *hdd_ctx);
 void wlan_hdd_two_connections_scenario(hdd_context_t *hdd_ctx,
-	uint8_t first_chnl, enum cds_chain_mode first_chain_mask);
+	uint8_t first_chnl, enum policy_mgr_chain_mode first_chain_mask);
 void wlan_hdd_three_connections_scenario(hdd_context_t *hdd_ctx,
 	uint8_t first_chnl, uint8_t second_chnl,
-	enum cds_chain_mode chain_mask, uint8_t use_same_mac);
+	enum policy_mgr_chain_mode chain_mask, uint8_t use_same_mac);
 #else
 static inline void clean_report(hdd_context_t *hdd_ctx)
 {
@@ -53,7 +54,8 @@ static inline void clean_report(hdd_context_t *hdd_ctx)
 static inline void fill_report(hdd_context_t *hdd_ctx, char *title,
 	uint32_t first_persona, uint32_t second_persona, uint32_t third_persona,
 	uint32_t chnl_1st_conn, uint32_t chnl_2nd_conn, uint32_t chnl_3rd_conn,
-	bool status, enum cds_pcl_type pcl_type, char *reason, uint8_t *pcl)
+	bool status, enum policy_mgr_pcl_type pcl_type, char *reason,
+	uint8_t *pcl)
 {
 }
 
@@ -66,13 +68,13 @@ static inline void wlan_hdd_one_connection_scenario(hdd_context_t *hdd_ctx)
 }
 
 static inline void wlan_hdd_two_connections_scenario(hdd_context_t *hdd_ctx,
-		uint8_t first_chnl, enum cds_chain_mode first_chain_mask)
+		uint8_t first_chnl, enum policy_mgr_chain_mode first_chain_mask)
 {
 }
 
 static inline void wlan_hdd_three_connections_scenario(hdd_context_t *hdd_ctx,
 		uint8_t first_chnl, uint8_t second_chnl,
-		enum cds_chain_mode chain_mask, uint8_t use_same_mac)
+		enum policy_mgr_chain_mode chain_mask, uint8_t use_same_mac)
 {
 }
 #endif

+ 0 - 15
core/hdd/inc/wlan_hdd_main.h

@@ -278,21 +278,6 @@
 
 #define SCAN_REJECT_THRESHOLD_TIME 300000 /* Time is in msec, equal to 5 mins */
 
-/*
- * @eHDD_SCAN_REJECT_DEFAULT: default value
- * @eHDD_CONNECTION_IN_PROGRESS: connection is in progress
- * @eHDD_REASSOC_IN_PROGRESS: reassociation is in progress
- * @eHDD_EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
- * @eHDD_SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
- */
-enum scan_reject_states {
-	eHDD_SCAN_REJECT_DEFAULT = 0,
-	eHDD_CONNECTION_IN_PROGRESS,
-	eHDD_REASSOC_IN_PROGRESS,
-	eHDD_EAPOL_IN_PROGRESS,
-	eHDD_SAP_EAPOL_IN_PROGRESS,
-};
-
 /* Default Psoc id */
 #define DEFAULT_PSOC_ID 1
 

+ 33 - 21
core/hdd/src/wlan_hdd_assoc.c

@@ -51,7 +51,7 @@
 #include "wlan_hdd_lpass.h"
 #include <wlan_logging_sock_svc.h>
 #include <cds_sched.h>
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 #include <cds_utils.h>
 #include "sme_power_save_api.h"
 #include "wlan_hdd_napi.h"
@@ -1215,8 +1215,8 @@ static void hdd_send_association_event(struct net_device *dev,
 		}
 
 		if (!hdd_is_roam_sync_in_progress(pCsrRoamInfo))
-			cds_incr_active_session(pAdapter->device_mode,
-					pAdapter->sessionId);
+			policy_mgr_incr_active_session(pHddCtx->hdd_psoc,
+				pAdapter->device_mode, pAdapter->sessionId);
 		memcpy(wrqu.ap_addr.sa_data, pCsrRoamInfo->pBssDesc->bssId,
 		       sizeof(pCsrRoamInfo->pBssDesc->bssId));
 
@@ -1311,11 +1311,12 @@ static void hdd_send_association_event(struct net_device *dev,
 #endif
 	} else if (eConnectionState_IbssConnected ==    /* IBss Associated */
 			pHddStaCtx->conn_info.connState) {
-		cds_update_connection_info(pAdapter->sessionId);
+		policy_mgr_update_connection_info(pHddCtx->hdd_psoc,
+				pAdapter->sessionId);
 		memcpy(wrqu.ap_addr.sa_data, pHddStaCtx->conn_info.bssId.bytes,
-		       ETH_ALEN);
+				ETH_ALEN);
 		hdd_err("wlan: new IBSS connection to " MAC_ADDRESS_STR,
-			 MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId.bytes));
+			MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId.bytes));
 
 		ret = hdd_objmgr_add_peer_object(pAdapter->hdd_vdev,
 						 QDF_IBSS_MODE,
@@ -1332,8 +1333,8 @@ static void hdd_send_association_event(struct net_device *dev,
 	} else {                /* Not Associated */
 		hdd_err("wlan: disconnected");
 		memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN);
-		cds_decr_session_set_pcl(pAdapter->device_mode,
-					pAdapter->sessionId);
+		policy_mgr_decr_session_set_pcl(pHddCtx->hdd_psoc,
+				pAdapter->device_mode, pAdapter->sessionId);
 
 #ifdef FEATURE_WLAN_AUTO_SHUTDOWN
 		wlan_hdd_auto_shutdown_enable(pHddCtx, true);
@@ -1960,6 +1961,7 @@ static void hdd_send_re_assoc_event(struct net_device *dev,
 	uint8_t *final_req_ie = NULL;
 	tCsrRoamConnectedProfile roam_profile;
 	tHalHandle hal_handle = WLAN_HDD_GET_HAL_CTX(pAdapter);
+	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
 
 	qdf_mem_zero(&roam_profile, sizeof(roam_profile));
 
@@ -2008,8 +2010,8 @@ static void hdd_send_re_assoc_event(struct net_device *dev,
 	 * successful reassoc decrement the active session count here.
 	 */
 	if (!hdd_is_roam_sync_in_progress(pCsrRoamInfo))
-		cds_decr_session_set_pcl(pAdapter->device_mode,
-					pAdapter->sessionId);
+		policy_mgr_decr_session_set_pcl(hdd_ctx->hdd_psoc,
+				pAdapter->device_mode, pAdapter->sessionId);
 
 	/* Send the Assoc Resp, the supplicant needs this for initial Auth */
 	len = pCsrRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET;
@@ -2428,9 +2430,10 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
 		/* Indicate 'connect' status to user space */
 		hdd_send_association_event(dev, pRoamInfo);
 
-		if (cds_is_mcc_in_24G()) {
+		if (policy_mgr_is_mcc_in_24G(pHddCtx->hdd_psoc)) {
 			if (pHddCtx->miracast_value)
-				cds_set_mas(pAdapter, pHddCtx->miracast_value);
+				wlan_hdd_set_mas(pAdapter,
+					pHddCtx->miracast_value);
 		}
 
 		/* Initialize the Linkup event completion variable */
@@ -2494,7 +2497,8 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
 #endif
 
 		hdd_info("check for SAP restart");
-		cds_check_concurrent_intf_and_restart_sap(pAdapter);
+		policy_mgr_check_concurrent_intf_and_restart_sap(
+			pHddCtx->hdd_psoc);
 
 		DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD,
 			pAdapter->sessionId,
@@ -2619,9 +2623,10 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
 						 */
 						if (!hdd_is_roam_sync_in_progress
 								(pRoamInfo))
-							cds_decr_session_set_pcl
-								(pAdapter->device_mode,
-								 pAdapter->sessionId);
+						policy_mgr_decr_session_set_pcl(
+							pHddCtx->hdd_psoc,
+							pAdapter->device_mode,
+							pAdapter->sessionId);
 						hdd_info("ft_carrier_on is %d, sending roamed indication",
 							 ft_carrier_on);
 						chan =
@@ -3006,6 +3011,8 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter,
 					     eRoamCmdStatus roamStatus,
 					     eCsrRoamResult roamResult)
 {
+	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
+
 	hdd_info("%s: id %d, status %d, result %d",
 		 pAdapter->dev->name, roamId,
 		 roamStatus, roamResult);
@@ -3102,11 +3109,12 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter,
 				bss);
 		}
 		if (eCSR_ROAM_RESULT_IBSS_STARTED == roamResult) {
-			cds_incr_active_session(pAdapter->device_mode,
-					pAdapter->sessionId);
+			policy_mgr_incr_active_session(hdd_ctx->hdd_psoc,
+				pAdapter->device_mode, pAdapter->sessionId);
 		} else if (eCSR_ROAM_RESULT_IBSS_JOIN_SUCCESS == roamResult ||
 				eCSR_ROAM_RESULT_IBSS_COALESCED == roamResult) {
-			cds_update_connection_info(pAdapter->sessionId);
+			policy_mgr_update_connection_info(hdd_ctx->hdd_psoc,
+					pAdapter->sessionId);
 		}
 		break;
 	}
@@ -4665,6 +4673,7 @@ static void hdd_roam_channel_switch_handler(hdd_adapter_t *adapter,
 	struct wireless_dev *wdev = dev->ieee80211_ptr;
 	struct wiphy *wiphy = wdev->wiphy;
 	QDF_STATUS status;
+	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
 	hdd_info("channel switch for session:%d to channel:%d",
 		adapter->sessionId, roam_info->chan_info.chan_id);
@@ -4689,7 +4698,8 @@ static void hdd_roam_channel_switch_handler(hdd_adapter_t *adapter,
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_err("channel change notification failed");
 
-	status = cds_set_hw_mode_on_channel_switch(adapter->sessionId);
+	status = policy_mgr_set_hw_mode_on_channel_switch(hdd_ctx->hdd_psoc,
+		adapter->sessionId);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_info("set hw mode change not done");
 }
@@ -4714,6 +4724,7 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
 	hdd_station_ctx_t *pHddStaCtx = NULL;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct cfg80211_bss *bss_status;
+	hdd_context_t *hdd_ctx;
 
 	hdd_info("CSR Callback: status= %d result= %d roamID=%d",
 		 roamStatus, roamResult, roamId);
@@ -4726,6 +4737,7 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
 
 	pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
 	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
+	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
 
 	/* Omitting eCSR_ROAM_UPDATE_SCAN_RESULT as this is too frequent */
 	if (eCSR_ROAM_UPDATE_SCAN_RESULT != roamStatus)
@@ -5043,7 +5055,7 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
 		hdd_napi_serialize(1);
 		hdd_set_connection_in_progress(true);
 		hdd_set_roaming_in_progress(true);
-		cds_restart_opportunistic_timer(true);
+		policy_mgr_restart_opportunistic_timer(hdd_ctx->hdd_psoc, true);
 		break;
 	case eCSR_ROAM_ABORT:
 		hdd_info("Firmware aborted roaming operation, previous connection is still valid");

+ 73 - 58
core/hdd/src/wlan_hdd_cfg80211.c

@@ -88,7 +88,7 @@
 #include "wlan_hdd_stats.h"
 #endif
 #include "cds_api.h"
-#include "cds_concurrency.h"
+#include "wlan_policy_mgr_api.h"
 #include "qwlan_version.h"
 #include "wlan_hdd_memdump.h"
 
@@ -1214,12 +1214,14 @@ int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter)
 	hdd_adapter_t *con_sap_adapter;
 	tsap_Config_t *sap_config, *con_sap_config;
 	int con_ch;
+	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
 	/*
 	 * Check if AP+AP case, once primary AP chooses a DFS
 	 * channel secondary AP should always follow primary APs channel
 	 */
-	if (!cds_concurrent_beaconing_sessions_running())
+	if (!policy_mgr_concurrent_beaconing_sessions_running(
+		hdd_ctx->hdd_psoc))
 		return 0;
 
 	con_sap_adapter = hdd_get_con_sap_adapter(adapter, true);
@@ -2001,7 +2003,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 	hdd_debug("get pcl for DO_ACS vendor command");
 
 	/* consult policy manager to get PCL */
-	status = cds_get_pcl(CDS_SAP_MODE,
+	status = policy_mgr_get_pcl(hdd_ctx->hdd_psoc, PM_SAP_MODE,
 				sap_config->acs_cfg.pcl_channels,
 				&sap_config->acs_cfg.pcl_ch_count,
 				sap_config->acs_cfg.pcl_channels_weight_list,
@@ -2690,7 +2692,7 @@ __wlan_hdd_cfg80211_get_features(struct wiphy *wiphy,
 
 	wlan_hdd_cfg80211_set_feature(feature_flags,
 				QCA_WLAN_VENDOR_FEATURE_SUPPORT_HW_MODE_ANY);
-	if (wma_is_scan_simultaneous_capable())
+	if (policy_mgr_is_scan_simultaneous_capable(hdd_ctx_ptr->hdd_psoc))
 		wlan_hdd_cfg80211_set_feature(feature_flags,
 			QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS);
 
@@ -2710,7 +2712,8 @@ __wlan_hdd_cfg80211_get_features(struct wiphy *wiphy,
 			sizeof(feature_flags), feature_flags))
 		goto nla_put_failure;
 
-	ret = wma_get_dbs_hw_modes(&one_by_one_dbs, &two_by_two_dbs);
+	ret = policy_mgr_get_dbs_hw_modes(hdd_ctx_ptr->hdd_psoc,
+		&one_by_one_dbs, &two_by_two_dbs);
 	if (QDF_STATUS_SUCCESS == ret) {
 		if (one_by_one_dbs)
 			dbs_capability = DRV_DBS_CAPABILITY_1X1;
@@ -5794,7 +5797,7 @@ static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy,
 	uint8_t pcl[QDF_MAX_NUM_CHAN], weight_list[QDF_MAX_NUM_CHAN];
 	uint32_t pcl_len = 0;
 	uint32_t freq_list[QDF_MAX_NUM_CHAN];
-	enum cds_con_mode intf_mode;
+	enum policy_mgr_con_mode intf_mode;
 	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX + 1];
 	struct sk_buff *reply_skb;
 
@@ -5818,14 +5821,15 @@ static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy,
 	intf_mode = nla_get_u32(tb
 		    [QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_IFACE_TYPE]);
 
-	if (intf_mode < CDS_STA_MODE || intf_mode >= CDS_MAX_NUM_OF_MODE) {
+	if (intf_mode < PM_STA_MODE || intf_mode >= PM_MAX_NUM_OF_MODE) {
 		hdd_err("Invalid interface type");
 		return -EINVAL;
 	}
 
 	hdd_debug("Userspace requested pref freq list");
 
-	status = cds_get_pcl(intf_mode, pcl, &pcl_len,
+	status = policy_mgr_get_pcl(hdd_ctx->hdd_psoc,
+				intf_mode, pcl, &pcl_len,
 				weight_list, QDF_ARRAY_SIZE(weight_list));
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("Get pcl failed");
@@ -5914,7 +5918,7 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
 	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(ndev);
 	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
 	int ret = 0;
-	enum cds_con_mode intf_mode;
+	enum policy_mgr_con_mode intf_mode;
 	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX + 1];
 	uint32_t channel_hint;
 
@@ -5938,7 +5942,7 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
 	intf_mode = nla_get_u32(tb
 		    [QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_IFACE_TYPE]);
 
-	if (intf_mode < CDS_STA_MODE || intf_mode >= CDS_MAX_NUM_OF_MODE) {
+	if (intf_mode < PM_STA_MODE || intf_mode >= PM_MAX_NUM_OF_MODE) {
 		hdd_err("Invalid interface type");
 		return -EINVAL;
 	}
@@ -5952,7 +5956,7 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
 			[QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_FREQ]));
 
 	/* check pcl table */
-	if (!cds_allow_concurrency(intf_mode,
+	if (!policy_mgr_allow_concurrency(hdd_ctx->hdd_psoc, intf_mode,
 					channel_hint, HW_MODE_20_MHZ)) {
 		hdd_err("Set channel hint failed due to concurrency check");
 		return -EINVAL;
@@ -5961,12 +5965,12 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
 	if (0 != wlan_hdd_check_remain_on_channel(adapter))
 		hdd_warn("Remain On Channel Pending");
 
-	ret = qdf_reset_connection_update();
+	ret = policy_mgr_reset_connection_update(hdd_ctx->hdd_psoc);
 	if (!QDF_IS_STATUS_SUCCESS(ret))
 		hdd_err("clearing event failed");
 
-	ret = cds_current_connections_update(adapter->sessionId,
-				channel_hint,
+	ret = policy_mgr_current_connections_update(hdd_ctx->hdd_psoc,
+				adapter->sessionId, channel_hint,
 				SIR_UPDATE_REASON_SET_OPER_CHAN);
 	if (QDF_STATUS_E_FAILURE == ret) {
 		/* return in the failure case */
@@ -5981,7 +5985,7 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
 		 * For any other return value it should be a pass
 		 * through
 		 */
-		ret = qdf_wait_for_connection_update();
+		ret = policy_mgr_wait_for_connection_update(hdd_ctx->hdd_psoc);
 		if (!QDF_IS_STATUS_SUCCESS(ret)) {
 			hdd_err("ERROR: qdf wait for event failed!!");
 			return -EINVAL;
@@ -7365,12 +7369,13 @@ static int wlan_hdd_validate_and_get_pre_cac_ch(hdd_context_t *hdd_ctx,
 		 * 6. But, we are in need of a DFS channel. So, going with the
 		 * first channel from the valid channel list.
 		 */
-		status = cds_get_valid_chans(channel_list, &len);
+		status = policy_mgr_get_valid_chans(hdd_ctx->hdd_psoc,
+				channel_list, &len);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			hdd_err("Failed to get channel list");
 			return -EINVAL;
 		}
-		cds_update_with_safe_channel_list(channel_list, &len,
+		policy_mgr_update_with_safe_channel_list(channel_list, &len,
 				pcl_weights, weight_len);
 		ret = wlan_hdd_sap_get_nol(ap_adapter, nol, &nol_len);
 		for (i = 0; i < len; i++) {
@@ -7439,7 +7444,7 @@ int wlan_hdd_request_pre_cac(uint8_t channel)
 	if (0 != wlan_hdd_validate_context(hdd_ctx))
 		return -EINVAL;
 
-	if (cds_get_connection_count() > 1) {
+	if (policy_mgr_get_connection_count(hdd_ctx->hdd_psoc) > 1) {
 		hdd_err("pre cac not allowed in concurrency");
 		return -EINVAL;
 	}
@@ -7593,7 +7598,8 @@ int wlan_hdd_request_pre_cac(uint8_t channel)
 	 * Since current SAP is in 2.4GHz and pre CAC channel is in 5GHz, this
 	 * connection update should result in DBS mode
 	 */
-	status = cds_update_and_wait_for_connection_update(
+	status = policy_mgr_update_and_wait_for_connection_update(
+						hdd_ctx->hdd_psoc,
 						ap_adapter->sessionId,
 						pre_cac_chan,
 						SIR_UPDATE_REASON_PRE_CAC);
@@ -8130,7 +8136,8 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy,
 			hdd_debug("freq[%d]=%d", i, freq[i]);
 		}
 
-		status = cds_set_sap_mandatory_channels(chans, freq_len);
+		status = policy_mgr_set_sap_mandatory_channels(
+			hdd_ctx->hdd_psoc, chans, freq_len);
 		if (QDF_IS_STATUS_ERROR(status))
 			return -EINVAL;
 	}
@@ -11097,7 +11104,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	if (!cds_allow_concurrency(
+	if (!policy_mgr_allow_concurrency(pHddCtx->hdd_psoc,
 				wlan_hdd_convert_nl_iftype_to_hdd_type(type),
 				0, HW_MODE_20_MHZ)) {
 		hdd_debug("This concurrency combination is not allowed");
@@ -11108,7 +11115,8 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 	wdev = ndev->ieee80211_ptr;
 
 	/* Reset the current device mode bit mask */
-	cds_clear_concurrency_mode(pAdapter->device_mode);
+	policy_mgr_clear_concurrency_mode(pHddCtx->hdd_psoc,
+		pAdapter->device_mode);
 
 	hdd_update_tdls_ct_and_teardown_links(pHddCtx);
 	if ((pAdapter->device_mode == QDF_STA_MODE) ||
@@ -11244,7 +11252,8 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 	}
 done:
 	/* Set bitmask based on updated value */
-	cds_set_concurrency_mode(pAdapter->device_mode);
+	policy_mgr_set_concurrency_mode(pHddCtx->hdd_psoc,
+		pAdapter->device_mode);
 
 	hdd_lpass_notify_mode_change(pAdapter);
 
@@ -12873,7 +12882,7 @@ static bool wlan_hdd_handle_sap_sta_dfs_conc(hdd_adapter_t *adapter,
 	 * find out by looking in to scan cache where sta is going to
 	 * connect by passing its roam_profile.
 	 */
-	status = cds_get_channel_from_scan_result(adapter,
+	status = policy_mgr_get_channel_from_scan_result(hdd_ctx->hdd_psoc,
 			roam_profile, &channel);
 
 	/*
@@ -12892,8 +12901,8 @@ static bool wlan_hdd_handle_sap_sta_dfs_conc(hdd_adapter_t *adapter,
 	 * scenario.
 	 */
 	if ((0 == channel) || CDS_IS_DFS_CH(channel))
-		channel = cds_get_nondfs_preferred_channel(CDS_SAP_MODE,
-								true);
+		channel = policy_mgr_get_nondfs_preferred_channel(
+			hdd_ctx->hdd_psoc, PM_SAP_MODE, true);
 
 	hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
 	qdf_event_reset(&hostapd_state->qdf_event);
@@ -13003,7 +13012,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
 		goto ret_status;
 	}
 
-	if (true == cds_is_connection_in_progress(NULL, NULL)) {
+	if (true == hdd_is_connection_in_progress(NULL, NULL)) {
 		hdd_err("Connection refused: conn in progress");
 		status = -EINVAL;
 		goto ret_status;
@@ -13024,16 +13033,19 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
 		 *
 		 * Else set connect_in_progress as true and proceed.
 		 */
-		cds_restart_opportunistic_timer(false);
-		if (cds_is_hw_mode_change_in_progress()) {
-			status = qdf_wait_for_connection_update();
+		policy_mgr_restart_opportunistic_timer(
+			pHddCtx->hdd_psoc, false);
+		if (policy_mgr_is_hw_mode_change_in_progress(
+			pHddCtx->hdd_psoc)) {
+			status = policy_mgr_wait_for_connection_update(
+				pHddCtx->hdd_psoc);
 			if (!QDF_IS_STATUS_SUCCESS(status)) {
 				hdd_err("qdf wait for event failed!!");
 				status = -EINVAL;
 				goto ret_status;
 			}
 		}
-		cds_set_connection_in_progress(true);
+		hdd_set_connection_in_progress(true);
 
 		if (HDD_WMM_USER_MODE_NO_QOS ==
 		    (WLAN_HDD_GET_CTX(pAdapter))->config->WmmMode) {
@@ -13197,8 +13209,8 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
 				pAdapter->scan_info.scanAddIE.length;
 		}
 
-		if ((wma_is_hw_dbs_capable() == true) &&
-			(false == wlan_hdd_handle_sap_sta_dfs_conc(pAdapter,
+		if ((policy_mgr_is_hw_dbs_capable(pHddCtx->hdd_psoc) == true)
+			&& (false == wlan_hdd_handle_sap_sta_dfs_conc(pAdapter,
 				pRoamProfile))) {
 			hdd_err("sap-sta conc will fail, can't allow sta");
 			hdd_conn_set_connection_state(pAdapter,
@@ -13273,20 +13285,22 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
 		}
 
 		/* Reset connect_in_progress */
-		cds_set_connection_in_progress(false);
+		hdd_set_connection_in_progress(false);
 
 		pRoamProfile->ChannelInfo.ChannelList = NULL;
 		pRoamProfile->ChannelInfo.numOfChannels = 0;
 
 		if ((QDF_STA_MODE == pAdapter->device_mode)
-		    && wma_is_current_hwmode_dbs() &&
-		    !wma_is_hw_dbs_2x2_capable()) {
-			cds_get_channel_from_scan_result(pAdapter,
-					pRoamProfile, &channel);
+			&& policy_mgr_is_current_hwmode_dbs(pHddCtx->hdd_psoc)
+			&& !policy_mgr_is_hw_dbs_2x2_capable(
+			pHddCtx->hdd_psoc)) {
+			policy_mgr_get_channel_from_scan_result(
+				pHddCtx->hdd_psoc,
+				pRoamProfile, &channel);
 			hdd_info("Move to single MAC mode(optimization) if applicable");
 			if (channel)
-				cds_checkn_update_hw_mode_single_mac_mode
-					(channel);
+				policy_mgr_checkn_update_hw_mode_single_mac_mode(
+					pHddCtx->hdd_psoc, channel);
 		}
 
 	} else {
@@ -13297,7 +13311,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
 
 conn_failure:
 	/* Reset connect_in_progress */
-	cds_set_connection_in_progress(false);
+	hdd_set_connection_in_progress(false);
 
 ret_status:
 	EXIT();
@@ -14182,16 +14196,16 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
 
 	/* Check for max concurrent connections after doing disconnect if any */
 	if (req->channel) {
-		if (!cds_allow_concurrency(
-				cds_convert_device_mode_to_qdf_type(
+		if (!policy_mgr_allow_concurrency(pHddCtx->hdd_psoc,
+				policy_mgr_convert_device_mode_to_qdf_type(
 				pAdapter->device_mode),
 				req->channel->hw_value, HW_MODE_20_MHZ)) {
 			hdd_err("This concurrency combination is not allowed");
 			return -ECONNREFUSED;
 		}
 	} else {
-		if (!cds_allow_concurrency(
-				cds_convert_device_mode_to_qdf_type(
+		if (!policy_mgr_allow_concurrency(pHddCtx->hdd_psoc,
+				policy_mgr_convert_device_mode_to_qdf_type(
 				pAdapter->device_mode), 0, HW_MODE_20_MHZ)) {
 			hdd_err("This concurrency combination is not allowed");
 			return -ECONNREFUSED;
@@ -14725,18 +14739,18 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
 		}
 	}
 
-	if (!cds_allow_concurrency(CDS_IBSS_MODE, channelNum,
-		HW_MODE_20_MHZ)) {
+	if (!policy_mgr_allow_concurrency(pHddCtx->hdd_psoc,
+		PM_IBSS_MODE, channelNum, HW_MODE_20_MHZ)) {
 		hdd_err("This concurrency combination is not allowed");
 		return -ECONNREFUSED;
 	}
 
-	status = qdf_reset_connection_update();
+	status = policy_mgr_reset_connection_update(pHddCtx->hdd_psoc);
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		hdd_err("ERR: clear event failed");
 
-	status = cds_current_connections_update(pAdapter->sessionId,
-					channelNum,
+	status = policy_mgr_current_connections_update(pHddCtx->hdd_psoc,
+					pAdapter->sessionId, channelNum,
 					SIR_UPDATE_REASON_JOIN_IBSS);
 	if (QDF_STATUS_E_FAILURE == status) {
 		hdd_err("ERROR: connections update failed!!");
@@ -14744,7 +14758,8 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
 	}
 
 	if (QDF_STATUS_SUCCESS == status) {
-		status = qdf_wait_for_connection_update();
+		status = policy_mgr_wait_for_connection_update(
+			pHddCtx->hdd_psoc);
 		if (!QDF_IS_STATUS_SUCCESS(status)) {
 			hdd_err("ERROR: qdf wait for event failed!!");
 			return -EINVAL;
@@ -16537,25 +16552,25 @@ static int wlan_hdd_cfg80211_channel_switch(struct wiphy *wiphy,
  *
  * Return: cds_con_mode enum
  */
-enum cds_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type(
+enum policy_mgr_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type(
 						enum nl80211_iftype type)
 {
-	enum cds_con_mode mode = CDS_MAX_NUM_OF_MODE;
+	enum policy_mgr_con_mode mode = PM_MAX_NUM_OF_MODE;
 	switch (type) {
 	case NL80211_IFTYPE_STATION:
-		mode = CDS_STA_MODE;
+		mode = PM_STA_MODE;
 		break;
 	case NL80211_IFTYPE_P2P_CLIENT:
-		mode = CDS_P2P_CLIENT_MODE;
+		mode = PM_P2P_CLIENT_MODE;
 		break;
 	case NL80211_IFTYPE_P2P_GO:
-		mode = CDS_P2P_GO_MODE;
+		mode = PM_P2P_GO_MODE;
 		break;
 	case NL80211_IFTYPE_AP:
-		mode = CDS_SAP_MODE;
+		mode = PM_SAP_MODE;
 		break;
 	case NL80211_IFTYPE_ADHOC:
-		mode = CDS_IBSS_MODE;
+		mode = PM_IBSS_MODE;
 		break;
 	default:
 		hdd_err("Unsupported interface type (%d)",

+ 1 - 1
core/hdd/src/wlan_hdd_cfg80211.h

@@ -328,7 +328,7 @@ int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter);
 int wlan_hdd_request_pre_cac(uint8_t channel);
 int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter);
 
-enum cds_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type(
+enum policy_mgr_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type(
 					enum nl80211_iftype type);
 
 int wlan_hdd_disable_dfs_chan_scan(hdd_context_t *hdd_ctx,