소스 검색

qcacmn: Handle negative MLO prefer percentage

Currently type of score is unit32_t due to which
negative value calculated is tried to change
to uint32_t and MLO score is getting boost instead
of deteriorate.

Fix is to calculate score in int32_t type and then move
to unsigned value.

Change-Id: Id28f58b44e1a1246f491b28a86de1c78c5e97215
CRs-Fixed: 3525654
Sheenam Monga 2 년 전
부모
커밋
806cbc9936
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c

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

@@ -1284,6 +1284,7 @@ cm_calculate_etp_score(struct wlan_objmgr_psoc *psoc,
 	struct etp_params etp_param;
 	int8_t mlo_prefer_percentage = 0;
 	uint32_t score;
+	int32_t mlo_score = 0;
 
 	if (phy_config->he_cap && entry->ie_list.hecap)
 		is_he_intersect = true;
@@ -1341,8 +1342,12 @@ cm_calculate_etp_score(struct wlan_objmgr_psoc *psoc,
 	if (bss_mlo_type == SLO)
 		return score;
 	wlan_mlme_get_mlo_prefer_percentage(psoc, &mlo_prefer_percentage);
-	if (mlo_prefer_percentage)
-		score = score + (score * mlo_prefer_percentage) / 100;
+	if (mlo_prefer_percentage) {
+		mlo_score = score;
+		mlo_score = mlo_score +
+			   (mlo_score * mlo_prefer_percentage) / 100;
+		score = mlo_score;
+	}
 	return score;
 }
 #else