浏览代码

qcacld-3.0: Avoid target wake up for multiple get stats req

If get stats request has been fetched recently then avoid target
wake up for next subsequent get stats req by returning cached
station stats.

Change-Id: I3aba4fdc7966a5e9e4ff38003bb80ebd7a3178f1
CRs-Fixed: 2833838
Rajeev Kumar 4 年之前
父节点
当前提交
21c27f3b2e
共有 1 个文件被更改,包括 16 次插入14 次删除
  1. 16 14
      core/hdd/src/wlan_hdd_stats.c

+ 16 - 14
core/hdd/src/wlan_hdd_stats.c

@@ -307,6 +307,20 @@ out:
 	return ret;
 }
 
+#ifdef FEATURE_CLUB_LL_STATS_AND_GET_STATION
+static void
+hdd_update_station_stats_cached_timestamp(struct hdd_adapter *adapter)
+{
+	adapter->hdd_stats.sta_stats_cached_timestamp =
+				qdf_system_ticks_to_msecs(qdf_system_ticks());
+}
+#else
+static void
+hdd_update_station_stats_cached_timestamp(struct hdd_adapter *adapter)
+{
+}
+#endif /* FEATURE_CLUB_LL_STATS_AND_GET_STATION */
+
 #ifdef WLAN_FEATURE_LINK_LAYER_STATS
 
 /**
@@ -1701,20 +1715,6 @@ static void wlan_hdd_dealloc_ll_stats(void *priv)
 	qdf_list_destroy(&ll_stats_priv->ll_stats_q);
 }
 
-#ifdef FEATURE_CLUB_LL_STATS_AND_GET_STATION
-static void
-hdd_update_station_stats_cached_timestamp(struct hdd_adapter *adapter)
-{
-	adapter->hdd_stats.sta_stats_cached_timestamp =
-				qdf_system_ticks_to_msecs(qdf_system_ticks());
-}
-#else
-static void
-hdd_update_station_stats_cached_timestamp(struct hdd_adapter *adapter)
-{
-}
-#endif /* FEATURE_CLUB_LL_STATS_AND_GET_STATION */
-
 #ifdef FEATURE_CLUB_LL_STATS_AND_GET_STATION
 /**
  * cache_station_stats_cb() - cache_station_stats_cb callback function
@@ -6462,6 +6462,8 @@ int wlan_hdd_get_station_stats(struct hdd_adapter *adapter)
 		goto out;
 	}
 
+	/* update get stats cached time stamp */
+	hdd_update_station_stats_cached_timestamp(adapter);
 	copy_station_stats_to_adapter(adapter, stats);
 	wlan_cfg80211_mc_cp_stats_free_stats_event(stats);