소스 검색

qcacld-3.0: Initialize signal field in hdd_sinfo with default value

When aggregated mlo station stats are requested, driver
will get vdev station stats for all the ml links and updates
hdd_sinfo struct, which is then sent to userspace.

But, in the current implementation of the driver, if a vdev
is inactive, we return from the function wlan_hdd_update_mlo_sinfo
without updating the hdd_sinfo struct, and when active vdev tries
to update the signal field it fails because the initial value
for the signal is 0dBm which is very high compared to the link's RSSI.

So to resolve the issue, initialize the signal field with a default
value of -128dBm.

Change-Id: I7b584bf431bda38ed9154f2945c9c81fdfd96902
CRs-Fixed: 3562515
Aditya Kodukula 1 년 전
부모
커밋
ef0cb63958
1개의 변경된 파일10개의 추가작업 그리고 10개의 파일을 삭제
  1. 10 10
      core/hdd/src/wlan_hdd_stats.c

+ 10 - 10
core/hdd/src/wlan_hdd_stats.c

@@ -7370,6 +7370,7 @@ static int wlan_hdd_get_sta_stats(struct wlan_hdd_link_info *link_info,
 }
 
 #if defined(WLAN_FEATURE_11BE_MLO)
+#define WLAN_INVALID_RSSI_VALUE -128
 /**
  * wlan_hdd_copy_hdd_stats_to_sinfo() - Copy hdd station stats info to sinfo
  * @sinfo: Pointer to kernel station info struct
@@ -7446,15 +7447,8 @@ wlan_hdd_update_mlo_sinfo(struct wlan_hdd_link_info *link_info,
 		return;
 	}
 
-	if (!hdd_adapter_is_link_adapter(link_info->adapter))
-		/* Send Assoc Link's Signal and Rates to userspace */
-		wlan_hdd_update_mlo_rate_info(hdd_sinfo, sinfo);
-
-	/* If Partner link RSSI is better then update
-	 * Partner Link's Signal and Rates to userspace
-	 */
-	if (hdd_adapter_is_link_adapter(link_info->adapter) &&
-	    sinfo->signal > hdd_sinfo->signal) {
+	/* Update the rate info for link with best RSSI */
+	if (sinfo->signal > hdd_sinfo->signal) {
 		hdd_nofl_debug("Updating rates for vdev_id[%d]",
 			       link_info->vdev_id);
 		wlan_hdd_update_mlo_rate_info(hdd_sinfo, sinfo);
@@ -7491,6 +7485,9 @@ static int wlan_hdd_get_mlo_sta_stats(struct hdd_adapter *adapter,
 	struct wlan_hdd_station_stats_info hdd_sinfo = {0};
 	uint8_t i;
 
+	/* Initialize the signal value to a default RSSI of -128dBm */
+	hdd_sinfo.signal = WLAN_INVALID_RSSI_VALUE;
+
 	ml_adapter = adapter;
 	if (hdd_adapter_is_link_adapter(ml_adapter))
 		ml_adapter = hdd_adapter_get_mlo_adapter_from_link(adapter);
@@ -7522,6 +7519,9 @@ static int wlan_hdd_get_mlo_sta_stats(struct hdd_adapter *adapter,
 	struct wlan_hdd_link_info *link_info;
 	struct wlan_hdd_station_stats_info hdd_sinfo = {0};
 
+	/* Initialize the signal value to a default RSSI of -128dBm */
+	hdd_sinfo.signal = WLAN_INVALID_RSSI_VALUE;
+
 	hdd_adapter_for_each_active_link_info(adapter, link_info) {
 		wlan_hdd_get_sta_stats(link_info, mac, sinfo);
 		wlan_hdd_update_mlo_sinfo(link_info, &hdd_sinfo, sinfo);
@@ -7654,7 +7654,7 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 
 		if (!wlan_hdd_send_mlo_aggregated_stats(link_info, mac)) {
 			hdd_debug("Sending Assoc Link stats");
-			return wlan_hdd_get_sta_stats(adapter->deflink,
+			return wlan_hdd_get_sta_stats(link_info,
 						      mac, sinfo);
 		}