Explorar o código

qcacld-3.0: Add and use vdev id from ll stats request

Currently host relies on fw for vdev id for ll_stats
response but FW does not send the vdev id in response
of radio stats and peer stats as response of the ll_stats
request. Host needs this vdev id to get the adapter on
which the ll_stats request is received so that is can process
and send the response back to user space.

To address above issue add vdev id in request private
structure and when receives response from the FW, extract
this vdev id from private structure.

Change-Id: I28c411aea852b36cd1a13174e87adfa7972fc077
CRs-Fixed: 2964782
Ashish Kumar Dhanotiya %!s(int64=3) %!d(string=hai) anos
pai
achega
c3690a1690
Modificáronse 1 ficheiros con 9 adicións e 9 borrados
  1. 9 9
      core/hdd/src/wlan_hdd_stats.c

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

@@ -395,12 +395,14 @@ struct hdd_ll_stats {
  * @request_id: userspace-assigned link layer stats request id
  * @request_bitmap: userspace-assigned link layer stats request bitmap
  * @ll_stats_lock: Lock to serially access request_bitmap
+ * @vdev_id: id of vdev handle
  */
 struct hdd_ll_stats_priv {
 	qdf_list_t ll_stats_q;
 	uint32_t request_id;
 	uint32_t request_bitmap;
 	qdf_spinlock_t ll_stats_lock;
+	uint8_t vdev_id;
 };
 
 /*
@@ -1457,15 +1459,6 @@ void wlan_hdd_cfg80211_link_layer_stats_callback(hdd_handle_t hdd_handle,
 	if (status)
 		return;
 
-	adapter = hdd_get_adapter_by_vdev(hdd_ctx,
-					   results->ifaceId);
-
-	if (!adapter) {
-		hdd_err("vdev_id %d does not exist with host",
-			results->ifaceId);
-		return;
-	}
-
 	switch (indication_type) {
 	case SIR_HAL_LL_STATS_RESULTS_RSP:
 	{
@@ -1491,6 +1484,12 @@ void wlan_hdd_cfg80211_link_layer_stats_callback(hdd_handle_t hdd_handle,
 			return;
 		}
 
+		adapter = hdd_get_adapter_by_vdev(hdd_ctx, priv->vdev_id);
+		if (!adapter) {
+			hdd_err("invalid vdev %d", priv->vdev_id);
+			return;
+		}
+
 		if (results->rspId == DEBUGFS_LLSTATS_REQID) {
 			hdd_debugfs_process_ll_stats(adapter, results, request);
 		 } else {
@@ -1951,6 +1950,7 @@ static int wlan_hdd_send_ll_stats_req(struct hdd_adapter *adapter,
 
 	priv->request_id = req->reqId;
 	priv->request_bitmap = req->paramIdMask;
+	priv->vdev_id = adapter->vdev_id;
 	qdf_spinlock_create(&priv->ll_stats_lock);
 	qdf_list_create(&priv->ll_stats_q, HDD_LINK_STATS_MAX);