debugfs.c (f2b551fad8d8f2ac5e1f810ad595298381e0b0c5) debugfs.c (b6459415b384cb829f0b2a4268f211c789f6cf0b)
1// SPDX-License-Identifier: BSD-3-Clause-Clear
2/*
3 * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
4 */
5
6#include <linux/vmalloc.h>
7
8#include "debugfs.h"

--- 114 unchanged lines hidden (view full) ---

123 spin_lock_bh(&ar->data_lock);
124
125 if (stats.stats_id == WMI_REQUEST_PDEV_STAT) {
126 list_splice_tail_init(&stats.pdevs, &ar->debug.fw_stats.pdevs);
127 ar->debug.fw_stats_done = true;
128 goto complete;
129 }
130
1// SPDX-License-Identifier: BSD-3-Clause-Clear
2/*
3 * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
4 */
5
6#include <linux/vmalloc.h>
7
8#include "debugfs.h"

--- 114 unchanged lines hidden (view full) ---

123 spin_lock_bh(&ar->data_lock);
124
125 if (stats.stats_id == WMI_REQUEST_PDEV_STAT) {
126 list_splice_tail_init(&stats.pdevs, &ar->debug.fw_stats.pdevs);
127 ar->debug.fw_stats_done = true;
128 goto complete;
129 }
130
131 if (stats.stats_id == WMI_REQUEST_RSSI_PER_CHAIN_STAT) {
132 ar->debug.fw_stats_done = true;
133 goto complete;
134 }
135
136 if (stats.stats_id == WMI_REQUEST_VDEV_STAT) {
137 if (list_empty(&stats.vdevs)) {
138 ath11k_warn(ab, "empty vdev stats");
139 goto complete;
140 }
141 /* FW sends all the active VDEV stats irrespective of PDEV,
142 * hence limit until the count of all VDEVs started
143 */

--- 87 unchanged lines hidden (view full) ---

231 spin_unlock_bh(&ar->data_lock);
232 break;
233 }
234 spin_unlock_bh(&ar->data_lock);
235 }
236 return 0;
237}
238
131 if (stats.stats_id == WMI_REQUEST_VDEV_STAT) {
132 if (list_empty(&stats.vdevs)) {
133 ath11k_warn(ab, "empty vdev stats");
134 goto complete;
135 }
136 /* FW sends all the active VDEV stats irrespective of PDEV,
137 * hence limit until the count of all VDEVs started
138 */

--- 87 unchanged lines hidden (view full) ---

226 spin_unlock_bh(&ar->data_lock);
227 break;
228 }
229 spin_unlock_bh(&ar->data_lock);
230 }
231 return 0;
232}
233
239int ath11k_debugfs_get_fw_stats(struct ath11k *ar, u32 pdev_id,
240 u32 vdev_id, u32 stats_id)
241{
242 struct ath11k_base *ab = ar->ab;
243 struct stats_request_params req_param;
244 int ret;
245
246 mutex_lock(&ar->conf_mutex);
247
248 if (ar->state != ATH11K_STATE_ON) {
249 ret = -ENETDOWN;
250 goto err_unlock;
251 }
252
253 req_param.pdev_id = pdev_id;
254 req_param.vdev_id = vdev_id;
255 req_param.stats_id = stats_id;
256
257 ret = ath11k_debugfs_fw_stats_request(ar, &req_param);
258 if (ret)
259 ath11k_warn(ab, "failed to request fw stats: %d\n", ret);
260
261 ath11k_dbg(ab, ATH11K_DBG_WMI,
262 "debug get fw stat pdev id %d vdev id %d stats id 0x%x\n",
263 pdev_id, vdev_id, stats_id);
264
265err_unlock:
266 mutex_unlock(&ar->conf_mutex);
267
268 return ret;
269}
270
271static int ath11k_open_pdev_stats(struct inode *inode, struct file *file)
272{
273 struct ath11k *ar = inode->i_private;
274 struct ath11k_base *ab = ar->ab;
275 struct stats_request_params req_param;
276 void *buf = NULL;
277 int ret;
278

--- 876 unchanged lines hidden ---
234static int ath11k_open_pdev_stats(struct inode *inode, struct file *file)
235{
236 struct ath11k *ar = inode->i_private;
237 struct ath11k_base *ab = ar->ab;
238 struct stats_request_params req_param;
239 void *buf = NULL;
240 int ret;
241

--- 876 unchanged lines hidden ---