Prechádzať zdrojové kódy

qcacmn: Optimize congestion calculation logic

In current code logic, in case of channel utilization value is 0, the
congestion value treated as “not present” and give it a medium score.
This will cause a very clean channel get a medium score.
To fix the issue, need calculated congestion score from 1-100 and
not 0-100.

Change-Id: Iff030cf4a682d6e585d6f812a522cb8b6683cc44
CRs-Fixed: 2812978
gaolez 4 rokov pred
rodič
commit
76469c8aee

+ 4 - 2
umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, 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 above
@@ -415,7 +415,9 @@ static int32_t cm_get_congestion_pct(struct scan_cache_entry *entry)
 		 */
 		congestion = CM_MAX_CHANNEL_UTILIZATION -
 					est_air_time_percentage;
-	} else if (entry->qbss_chan_load) {
+		if (!congestion)
+			congestion = 1;
+	} else if (util_scan_entry_qbssload(entry)) {
 		ap_load = (entry->qbss_chan_load * CM_MAX_PCT_SCORE);
 		/*
 		 * Calculate ap_load in % from qbss channel load from