瀏覽代碼

qcacld-3.0: Get weight of selected frequencies list

Get weight of selected frequencies list of LL_LT_SAP. This will
be used by caller api to select the best frequency for LL_LT_SAP.

Change-Id: I066aea0591f8e65a61c53586d68aa753b081e3db
CRs-Fixed: 3640864
Jyoti Kumari 1 年之前
父節點
當前提交
10264ba73a

+ 30 - 8
components/umac/mlme/sap/ll_sap/core/src/wlan_ll_lt_sap_main.c

@@ -162,31 +162,40 @@ QDF_STATUS ll_lt_sap_deinit(struct wlan_objmgr_vdev *vdev)
 static
 void ll_lt_sap_update_mac_freq(struct wlan_ll_lt_sap_mac_freq *freq_list,
 			       qdf_freq_t sbs_cut_off_freq,
-			       qdf_freq_t given_freq)
+			       qdf_freq_t given_freq, uint32_t given_weight)
 {
 	if (WLAN_REG_IS_5GHZ_CH_FREQ(given_freq) &&
 	    ((sbs_cut_off_freq && given_freq < sbs_cut_off_freq) ||
 	    !sbs_cut_off_freq) && !freq_list->freq_5GHz_low) {
 		freq_list->freq_5GHz_low = given_freq;
+		freq_list->weight_5GHz_low = given_weight;
+
 		/*
 		 * Update same freq in 5GHz high freq if sbs_cut_off_freq
 		 * is not present
 		 */
-		if (!sbs_cut_off_freq)
+		if (!sbs_cut_off_freq) {
 			freq_list->freq_5GHz_high = given_freq;
+			freq_list->weight_5GHz_high = given_weight;
+		}
 	} else if (WLAN_REG_IS_5GHZ_CH_FREQ(given_freq) &&
 		   ((sbs_cut_off_freq && given_freq > sbs_cut_off_freq) ||
 		   !sbs_cut_off_freq) && !freq_list->freq_5GHz_high) {
 			freq_list->freq_5GHz_high = given_freq;
+			freq_list->weight_5GHz_high = given_weight;
+
 		/*
 		 * Update same freq for 5GHz low freq if sbs_cut_off_freq
 		 * is not present
 		 */
-		if (!sbs_cut_off_freq)
+		if (!sbs_cut_off_freq) {
 			freq_list->freq_5GHz_low = given_freq;
+			freq_list->weight_5GHz_low = given_weight;
+		}
 	} else if (WLAN_REG_IS_6GHZ_CHAN_FREQ(given_freq) &&
 		   !freq_list->freq_6GHz) {
 		freq_list->freq_6GHz = given_freq;
+		freq_list->weight_6GHz = given_weight;
 	}
 }
 
@@ -204,6 +213,7 @@ void ll_lt_sap_update_freq_list(struct wlan_objmgr_psoc *psoc,
 	qdf_freq_t freq, sbs_cut_off_freq;
 	qdf_freq_t same_mac_freq, standalone_mac_freq;
 	uint8_t i = 0, count;
+	uint32_t weight;
 	enum policy_mgr_con_mode con_mode = PM_MAX_NUM_OF_MODE;
 
 	sbs_cut_off_freq = policy_mgr_get_sbs_cut_off_freq(psoc);
@@ -213,6 +223,7 @@ void ll_lt_sap_update_freq_list(struct wlan_objmgr_psoc *psoc,
 			continue;
 
 		freq = ch_param->ch_info[i].chan_freq;
+		weight = ch_param->ch_info[i].weight;
 
 		/*
 		 * Do not select same channel where LL_LT_SAP was
@@ -230,8 +241,10 @@ void ll_lt_sap_update_freq_list(struct wlan_objmgr_psoc *psoc,
 		 * This will be used if there is no valid freq present
 		 * within threshold value or no concurrency present
 		 */
-		if (!freq_list->best_freq)
+		if (!freq_list->best_freq) {
 			freq_list->best_freq = freq;
+			freq_list->weight_best_freq = weight;
+		}
 
 		if (!connection_count)
 			break;
@@ -243,7 +256,7 @@ void ll_lt_sap_update_freq_list(struct wlan_objmgr_psoc *psoc,
 		 * to get the best channel compartively and avoid multiple
 		 * times of channel switch.
 		 */
-		if (ch_param->ch_info[i].weight > CHANNEL_WEIGHT_THRESHOLD_VALUE)
+		if (weight > CHANNEL_WEIGHT_THRESHOLD_VALUE)
 			continue;
 
 		same_mac_freq = 0;
@@ -319,11 +332,13 @@ void ll_lt_sap_update_freq_list(struct wlan_objmgr_psoc *psoc,
 		if (same_mac_freq)
 			ll_lt_sap_update_mac_freq(&freq_list->shared_mac,
 						  sbs_cut_off_freq,
-						  same_mac_freq);
+						  same_mac_freq,
+						  weight);
 		else if (standalone_mac_freq)
 			ll_lt_sap_update_mac_freq(&freq_list->standalone_mac,
 						  sbs_cut_off_freq,
-						  standalone_mac_freq);
+						  standalone_mac_freq,
+						  weight);
 
 		if (freq_list->shared_mac.freq_5GHz_low &&
 		    freq_list->shared_mac.freq_5GHz_high &&
@@ -334,14 +349,21 @@ void ll_lt_sap_update_freq_list(struct wlan_objmgr_psoc *psoc,
 			break;
 	}
 
-	ll_sap_debug("vdev %d, best %d Shared: low %d high %d 6Ghz %d, Standalone: low %d high %d 6Ghz %d, prev %d, existing connection cnt %d",
+	ll_sap_debug("vdev %d, best %d[%d] Shared: low %d[%d] high %d[%d] 6Ghz %d[%d], Standalone: low %d[%d] high %d[%d] 6Ghz %d[%d], prev %d, existing connection cnt %d",
 		     vdev_id, freq_list->best_freq,
+		     freq_list->weight_best_freq,
 		     freq_list->shared_mac.freq_5GHz_low,
+		     freq_list->shared_mac.weight_5GHz_low,
 		     freq_list->shared_mac.freq_5GHz_high,
+		     freq_list->shared_mac.weight_5GHz_high,
 		     freq_list->shared_mac.freq_6GHz,
+		     freq_list->shared_mac.weight_6GHz,
 		     freq_list->standalone_mac.freq_5GHz_low,
+		     freq_list->standalone_mac.weight_5GHz_low,
 		     freq_list->standalone_mac.freq_5GHz_high,
+		     freq_list->standalone_mac.weight_5GHz_high,
 		     freq_list->standalone_mac.freq_6GHz,
+		     freq_list->standalone_mac.weight_6GHz,
 		     freq_list->prev_freq, connection_count);
 }
 

+ 8 - 0
components/umac/mlme/sap/ll_sap/dispatcher/inc/wlan_ll_sap_public_structs.h

@@ -73,11 +73,17 @@ enum bearer_switch_req_source {
  * @freq_5GHz_low: Low 5GHz frequency
  * @freq_5GHz_high: High 5GHz frequency
  * @freq_6GHz: 6GHz frequency
+ * @weight_5GHz_low: Weight of 5GHz low frequency
+ * @weight_5GHz_high: Weight of 5GHz high frequency
+ * @weight_6GHz: Weight of 6GHz frequency
  */
 struct wlan_ll_lt_sap_mac_freq {
 	qdf_freq_t freq_5GHz_low;
 	qdf_freq_t freq_5GHz_high;
 	qdf_freq_t freq_6GHz;
+	uint32_t weight_5GHz_low;
+	uint32_t weight_5GHz_high;
+	uint32_t weight_6GHz;
 };
 
 /**
@@ -91,12 +97,14 @@ struct wlan_ll_lt_sap_mac_freq {
  * @prev_freq: Previous/current freq on which LL_LT_SAP is present.
  * This will be use to avoid SCC channel selection while updating this
  * list. This freq should be filled by user.
+ * @weight_best_freq: Weight of best frequency
  */
 struct wlan_ll_lt_sap_freq_list {
 	struct wlan_ll_lt_sap_mac_freq standalone_mac;
 	struct wlan_ll_lt_sap_mac_freq shared_mac;
 	qdf_freq_t best_freq;
 	qdf_freq_t prev_freq;
+	uint32_t weight_best_freq;
 };
 
 /**