debugfs.c (8c57a5e7b2820f349c95b8c8393fec1e0f4070d2) | debugfs.c (fa2648a34e73fb7a17fd0a82e0335a9451d8f5c8) |
---|---|
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 --- 6 unchanged lines hidden (view full) --- 15 * 16 * You should have received a copy of the GNU General Public License 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 | 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 --- 6 unchanged lines hidden (view full) --- 15 * 16 * You should have received a copy of the GNU General Public License 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 <linux/pm_runtime.h> 24 |
|
23#include "../wlcore/debugfs.h" 24#include "../wlcore/wlcore.h" 25#include "../wlcore/debug.h" 26#include "../wlcore/ps.h" 27 28#include "wl18xx.h" 29#include "acx.h" 30#include "cmd.h" --- 240 unchanged lines hidden (view full) --- 271 return -EINVAL; 272 } 273 274 mutex_lock(&wl->mutex); 275 276 if (unlikely(wl->state != WLCORE_STATE_ON)) 277 goto out; 278 | 25#include "../wlcore/debugfs.h" 26#include "../wlcore/wlcore.h" 27#include "../wlcore/debug.h" 28#include "../wlcore/ps.h" 29 30#include "wl18xx.h" 31#include "acx.h" 32#include "cmd.h" --- 240 unchanged lines hidden (view full) --- 273 return -EINVAL; 274 } 275 276 mutex_lock(&wl->mutex); 277 278 if (unlikely(wl->state != WLCORE_STATE_ON)) 279 goto out; 280 |
279 ret = wl1271_ps_elp_wakeup(wl); 280 if (ret < 0) | 281 ret = pm_runtime_get_sync(wl->dev); 282 if (ret < 0) { 283 pm_runtime_put_noidle(wl->dev); |
281 goto out; | 284 goto out; |
285 } |
|
282 283 ret = wl18xx_cmd_radar_detection_debug(wl, channel); 284 if (ret < 0) 285 count = ret; 286 | 286 287 ret = wl18xx_cmd_radar_detection_debug(wl, channel); 288 if (ret < 0) 289 count = ret; 290 |
287 wl1271_ps_elp_sleep(wl); | 291 pm_runtime_put(wl->dev); |
288out: 289 mutex_unlock(&wl->mutex); 290 return count; 291} 292 293static const struct file_operations radar_detection_ops = { 294 .write = radar_detection_write, 295 .open = simple_open, --- 14 unchanged lines hidden (view full) --- 310 311 mutex_lock(&wl->mutex); 312 313 wl->dynamic_fw_traces = value; 314 315 if (unlikely(wl->state != WLCORE_STATE_ON)) 316 goto out; 317 | 292out: 293 mutex_unlock(&wl->mutex); 294 return count; 295} 296 297static const struct file_operations radar_detection_ops = { 298 .write = radar_detection_write, 299 .open = simple_open, --- 14 unchanged lines hidden (view full) --- 314 315 mutex_lock(&wl->mutex); 316 317 wl->dynamic_fw_traces = value; 318 319 if (unlikely(wl->state != WLCORE_STATE_ON)) 320 goto out; 321 |
318 ret = wl1271_ps_elp_wakeup(wl); 319 if (ret < 0) | 322 ret = pm_runtime_get_sync(wl->dev); 323 if (ret < 0) { 324 pm_runtime_put_noidle(wl->dev); |
320 goto out; | 325 goto out; |
326 } |
|
321 322 ret = wl18xx_acx_dynamic_fw_traces(wl); 323 if (ret < 0) 324 count = ret; 325 | 327 328 ret = wl18xx_acx_dynamic_fw_traces(wl); 329 if (ret < 0) 330 count = ret; 331 |
326 wl1271_ps_elp_sleep(wl); | 332 pm_runtime_put(wl->dev); |
327out: 328 mutex_unlock(&wl->mutex); 329 return count; 330} 331 332static ssize_t dynamic_fw_traces_read(struct file *file, 333 char __user *userbuf, 334 size_t count, loff_t *ppos) --- 34 unchanged lines hidden (view full) --- 369 370 mutex_lock(&wl->mutex); 371 372 wl->radar_debug_mode = value; 373 374 if (unlikely(wl->state != WLCORE_STATE_ON)) 375 goto out; 376 | 333out: 334 mutex_unlock(&wl->mutex); 335 return count; 336} 337 338static ssize_t dynamic_fw_traces_read(struct file *file, 339 char __user *userbuf, 340 size_t count, loff_t *ppos) --- 34 unchanged lines hidden (view full) --- 375 376 mutex_lock(&wl->mutex); 377 378 wl->radar_debug_mode = value; 379 380 if (unlikely(wl->state != WLCORE_STATE_ON)) 381 goto out; 382 |
377 ret = wl1271_ps_elp_wakeup(wl); 378 if (ret < 0) | 383 ret = pm_runtime_get_sync(wl->dev); 384 if (ret < 0) { 385 pm_runtime_put_noidle(wl->dev); |
379 goto out; | 386 goto out; |
387 } |
|
380 381 wl12xx_for_each_wlvif_ap(wl, wlvif) { 382 wlcore_cmd_generic_cfg(wl, wlvif, 383 WLCORE_CFG_FEATURE_RADAR_DEBUG, 384 wl->radar_debug_mode, 0); 385 } 386 | 388 389 wl12xx_for_each_wlvif_ap(wl, wlvif) { 390 wlcore_cmd_generic_cfg(wl, wlvif, 391 WLCORE_CFG_FEATURE_RADAR_DEBUG, 392 wl->radar_debug_mode, 0); 393 } 394 |
387 wl1271_ps_elp_sleep(wl); | 395 pm_runtime_put(wl->dev); |
388out: 389 mutex_unlock(&wl->mutex); 390 return count; 391} 392 393static ssize_t radar_debug_mode_read(struct file *file, 394 char __user *userbuf, 395 size_t count, loff_t *ppos) --- 195 unchanged lines hidden --- | 396out: 397 mutex_unlock(&wl->mutex); 398 return count; 399} 400 401static ssize_t radar_debug_mode_read(struct file *file, 402 char __user *userbuf, 403 size_t count, loff_t *ppos) --- 195 unchanged lines hidden --- |