debugfs.c (cf9ce948f47640797bd19980e1d99c6d17d0bdc3) debugfs.c (e7d323243f567b8f3ff1324dc8a6f17dd36b4106)
1/*
2 * This file is part of wl18xx
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Copyright (C) 2011-2012 Texas Instruments
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

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

17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 */
22
23#include "../wlcore/debugfs.h"
24#include "../wlcore/wlcore.h"
1/*
2 * This file is part of wl18xx
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Copyright (C) 2011-2012 Texas Instruments
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License

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

17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 */
22
23#include "../wlcore/debugfs.h"
24#include "../wlcore/wlcore.h"
25#include "../wlcore/debug.h"
26#include "../wlcore/ps.h"
25
26#include "wl18xx.h"
27#include "acx.h"
27
28#include "wl18xx.h"
29#include "acx.h"
30#include "cmd.h"
28#include "debugfs.h"
29
30#define WL18XX_DEBUGFS_FWSTATS_FILE(a, b, c) \
31 DEBUGFS_FWSTATS_FILE(a, b, c, wl18xx_acx_statistics)
32#define WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c) \
33 DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c, wl18xx_acx_statistics)
34
35

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

234}
235
236static const struct file_operations clear_fw_stats_ops = {
237 .write = clear_fw_stats_write,
238 .open = simple_open,
239 .llseek = default_llseek,
240};
241
31#include "debugfs.h"
32
33#define WL18XX_DEBUGFS_FWSTATS_FILE(a, b, c) \
34 DEBUGFS_FWSTATS_FILE(a, b, c, wl18xx_acx_statistics)
35#define WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c) \
36 DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c, wl18xx_acx_statistics)
37
38

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

237}
238
239static const struct file_operations clear_fw_stats_ops = {
240 .write = clear_fw_stats_write,
241 .open = simple_open,
242 .llseek = default_llseek,
243};
244
245static ssize_t radar_detection_write(struct file *file,
246 const char __user *user_buf,
247 size_t count, loff_t *ppos)
248{
249 struct wl1271 *wl = file->private_data;
250 int ret;
251 u8 channel;
252
253 ret = kstrtou8_from_user(user_buf, count, 10, &channel);
254 if (ret < 0) {
255 wl1271_warning("illegal channel");
256 return -EINVAL;
257 }
258
259 mutex_lock(&wl->mutex);
260
261 if (unlikely(wl->state != WLCORE_STATE_ON))
262 goto out;
263
264 ret = wl1271_ps_elp_wakeup(wl);
265 if (ret < 0)
266 goto out;
267
268 ret = wl18xx_cmd_radar_detection_debug(wl, channel);
269 if (ret < 0)
270 count = ret;
271
272 wl1271_ps_elp_sleep(wl);
273out:
274 mutex_unlock(&wl->mutex);
275 return count;
276}
277
278static const struct file_operations radar_detection_ops = {
279 .write = radar_detection_write,
280 .open = simple_open,
281 .llseek = default_llseek,
282};
283
242int wl18xx_debugfs_add_files(struct wl1271 *wl,
243 struct dentry *rootdir)
244{
245 int ret = 0;
246 struct dentry *entry, *stats, *moddir;
247
248 moddir = debugfs_create_dir(KBUILD_MODNAME, rootdir);
249 if (!moddir || IS_ERR(moddir)) {

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

385 DEBUGFS_FWSTATS_ADD(pipeline, pipeline_fifo_full);
386
387 DEBUGFS_FWSTATS_ADD(mem, rx_free_mem_blks);
388 DEBUGFS_FWSTATS_ADD(mem, tx_free_mem_blks);
389 DEBUGFS_FWSTATS_ADD(mem, fwlog_free_mem_blks);
390 DEBUGFS_FWSTATS_ADD(mem, fw_gen_free_mem_blks);
391
392 DEBUGFS_ADD(conf, moddir);
284int wl18xx_debugfs_add_files(struct wl1271 *wl,
285 struct dentry *rootdir)
286{
287 int ret = 0;
288 struct dentry *entry, *stats, *moddir;
289
290 moddir = debugfs_create_dir(KBUILD_MODNAME, rootdir);
291 if (!moddir || IS_ERR(moddir)) {

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

427 DEBUGFS_FWSTATS_ADD(pipeline, pipeline_fifo_full);
428
429 DEBUGFS_FWSTATS_ADD(mem, rx_free_mem_blks);
430 DEBUGFS_FWSTATS_ADD(mem, tx_free_mem_blks);
431 DEBUGFS_FWSTATS_ADD(mem, fwlog_free_mem_blks);
432 DEBUGFS_FWSTATS_ADD(mem, fw_gen_free_mem_blks);
433
434 DEBUGFS_ADD(conf, moddir);
435 DEBUGFS_ADD(radar_detection, moddir);
393
394 return 0;
395
396err:
397 if (IS_ERR(entry))
398 ret = PTR_ERR(entry);
399 else
400 ret = -ENOMEM;
401
402 return ret;
403}
436
437 return 0;
438
439err:
440 if (IS_ERR(entry))
441 ret = PTR_ERR(entry);
442 else
443 ret = -ENOMEM;
444
445 return ret;
446}