Sfoglia il codice sorgente

qcacld-3.0: Init channel avoidance in policy manager

Currenly only hdd initializes channel avoidance from platform.
Policy manager should also initialize channel avoidance from platform.

Change-Id: Iefcaae5ff4789d7d334ab2cab693f5dedfd2ca46
CRs-Fixed: 2645512
bings 5 anni fa
parent
commit
9e2de44e7f

+ 12 - 0
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -637,6 +637,18 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc,
 			      uint32_t *pcl_channels, uint32_t *len,
 			      uint8_t *pcl_weight, uint32_t weight_len);
 
+/**
+ * policy_mgr_init_chan_avoidance() - init channel avoidance in policy manager.
+ * @psoc: PSOC object information
+ * @chan_freq_list: channel frequency list
+ * @chan_cnt: channel count
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS policy_mgr_init_chan_avoidance(struct wlan_objmgr_psoc *psoc,
+					  qdf_freq_t *chan_freq_list,
+					  uint16_t chan_cnt);
+
 /**
  * policy_mgr_update_with_safe_channel_list() - provides the safe
  * channel list

+ 15 - 1
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_ucfg.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -254,6 +254,20 @@ bool
 ucfg_policy_mgr_get_dfs_master_dynamic_enabled(struct wlan_objmgr_psoc *psoc,
 					       uint8_t vdev_id);
 
+/**
+ * ucfg_policy_mgr_init_chan_avoidance() - init channel avoidance in policy
+ *					   manager
+ * @psoc: pointer to psoc
+ * @chan_freq_list: channel frequency list
+ * @chan_cnt: channel count
+ *
+ * Return: QDF_STATUS_SUCCESS up on success and any other status for failure.
+ */
+QDF_STATUS
+ucfg_policy_mgr_init_chan_avoidance(struct wlan_objmgr_psoc *psoc,
+				    qdf_freq_t *chan_freq_list,
+				    uint16_t chan_cnt);
+
 /**
  * ucfg_policy_mgr_get_sap_mandt_chnl() - to find out if SAP mandatory channel
  *					  support is enabled

+ 25 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -212,6 +212,31 @@ policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc,
 			 pm_ctx->unsafe_channel_count);
 }
 
+QDF_STATUS policy_mgr_init_chan_avoidance(struct wlan_objmgr_psoc *psoc,
+					  qdf_freq_t *chan_freq_list,
+					  uint16_t chan_cnt)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	uint32_t i;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	pm_ctx->unsafe_channel_count = chan_cnt >= NUM_CHANNELS ?
+			NUM_CHANNELS : chan_cnt;
+
+	for (i = 0; i < pm_ctx->unsafe_channel_count; i++)
+		pm_ctx->unsafe_channel_list[i] = chan_freq_list[i];
+
+	policy_mgr_debug("Channel list init, received %d avoided channels",
+			 pm_ctx->unsafe_channel_count);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 void policy_mgr_update_with_safe_channel_list(struct wlan_objmgr_psoc *psoc,
 					      uint32_t *pcl_channels,
 					      uint32_t *len,

+ 9 - 1
components/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -206,6 +206,14 @@ ucfg_policy_mgr_get_sta_sap_scc_lte_coex_chnl(struct wlan_objmgr_psoc *psoc,
 							sta_sap_scc_lte_coex);
 }
 
+QDF_STATUS
+ucfg_policy_mgr_init_chan_avoidance(struct wlan_objmgr_psoc *psoc,
+				    qdf_freq_t *chan_freq_list,
+				    uint16_t chan_cnt)
+{
+	return policy_mgr_init_chan_avoidance(psoc, chan_freq_list, chan_cnt);
+}
+
 QDF_STATUS ucfg_policy_mgr_get_sap_mandt_chnl(struct wlan_objmgr_psoc *psoc,
 					      uint8_t *sap_mandt_chnl)
 {

+ 4 - 0
core/hdd/src/wlan_hdd_main.c

@@ -9871,6 +9871,10 @@ static void hdd_init_channel_avoidance(struct hdd_context *hdd_ctx)
 
 	}
 
+	ucfg_policy_mgr_init_chan_avoidance(
+		hdd_ctx->psoc,
+		(qdf_freq_t *)hdd_ctx->unsafe_channel_list,
+		hdd_ctx->unsafe_channel_count);
 }
 
 static void hdd_lte_coex_restart_sap(struct hdd_adapter *adapter,