diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index d5253a179dec..36cfeccfafbc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * GPL LICENSE SUMMARY | 3 | * GPL LICENSE SUMMARY |
4 | * | 4 | * |
5 | * Copyright(c) 2008 Intel Corporation. All rights reserved. | 5 | * Copyright(c) 2008 - 2009 Intel Corporation. All rights reserved. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of version 2 of the GNU General Public License as | 8 | * it under the terms of version 2 of the GNU General Public License as |
@@ -63,6 +63,14 @@ | |||
63 | goto err; \ | 63 | goto err; \ |
64 | } while (0) | 64 | } while (0) |
65 | 65 | ||
66 | #define DEBUGFS_ADD_X32(name, parent, ptr) do { \ | ||
67 | dbgfs->dbgfs_##parent##_files.file_##name = \ | ||
68 | debugfs_create_x32(#name, 0444, dbgfs->dir_##parent, ptr); \ | ||
69 | if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name) \ | ||
70 | || !dbgfs->dbgfs_##parent##_files.file_##name) \ | ||
71 | goto err; \ | ||
72 | } while (0) | ||
73 | |||
66 | #define DEBUGFS_REMOVE(name) do { \ | 74 | #define DEBUGFS_REMOVE(name) do { \ |
67 | debugfs_remove(name); \ | 75 | debugfs_remove(name); \ |
68 | name = NULL; \ | 76 | name = NULL; \ |
@@ -164,9 +172,6 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, | |||
164 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 172 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
165 | const size_t bufsz = sizeof(buf); | 173 | const size_t bufsz = sizeof(buf); |
166 | 174 | ||
167 | printk(KERN_DEBUG "offset is: 0x%x\tlen is: 0x%x\n", | ||
168 | priv->dbgfs->sram_offset, priv->dbgfs->sram_len); | ||
169 | |||
170 | iwl_grab_nic_access(priv); | 175 | iwl_grab_nic_access(priv); |
171 | for (i = priv->dbgfs->sram_len; i > 0; i -= 4) { | 176 | for (i = priv->dbgfs->sram_len; i > 0; i -= 4) { |
172 | val = iwl_read_targ_mem(priv, priv->dbgfs->sram_offset + \ | 177 | val = iwl_read_targ_mem(priv, priv->dbgfs->sram_offset + \ |
@@ -301,14 +306,14 @@ static ssize_t iwl_dbgfs_eeprom_read(struct file *file, | |||
301 | buf_size = 4 * eeprom_len + 256; | 306 | buf_size = 4 * eeprom_len + 256; |
302 | 307 | ||
303 | if (eeprom_len % 16) { | 308 | if (eeprom_len % 16) { |
304 | IWL_ERROR("EEPROM size is not multiple of 16.\n"); | 309 | IWL_ERR(priv, "EEPROM size is not multiple of 16.\n"); |
305 | return -ENODATA; | 310 | return -ENODATA; |
306 | } | 311 | } |
307 | 312 | ||
308 | /* 4 characters for byte 0xYY */ | 313 | /* 4 characters for byte 0xYY */ |
309 | buf = kzalloc(buf_size, GFP_KERNEL); | 314 | buf = kzalloc(buf_size, GFP_KERNEL); |
310 | if (!buf) { | 315 | if (!buf) { |
311 | IWL_ERROR("Can not allocate Buffer\n"); | 316 | IWL_ERR(priv, "Can not allocate Buffer\n"); |
312 | return -ENOMEM; | 317 | return -ENOMEM; |
313 | } | 318 | } |
314 | 319 | ||
@@ -365,7 +370,7 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, | |||
365 | 370 | ||
366 | buf = kzalloc(bufsz, GFP_KERNEL); | 371 | buf = kzalloc(bufsz, GFP_KERNEL); |
367 | if (!buf) { | 372 | if (!buf) { |
368 | IWL_ERROR("Can not allocate Buffer\n"); | 373 | IWL_ERR(priv, "Can not allocate Buffer\n"); |
369 | return -ENOMEM; | 374 | return -ENOMEM; |
370 | } | 375 | } |
371 | 376 | ||
@@ -420,7 +425,6 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, | |||
420 | return ret; | 425 | return ret; |
421 | } | 426 | } |
422 | 427 | ||
423 | |||
424 | DEBUGFS_READ_WRITE_FILE_OPS(sram); | 428 | DEBUGFS_READ_WRITE_FILE_OPS(sram); |
425 | DEBUGFS_WRITE_FILE_OPS(log_event); | 429 | DEBUGFS_WRITE_FILE_OPS(log_event); |
426 | DEBUGFS_READ_FILE_OPS(eeprom); | 430 | DEBUGFS_READ_FILE_OPS(eeprom); |
@@ -462,6 +466,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
462 | DEBUGFS_ADD_FILE(rx_statistics, data); | 466 | DEBUGFS_ADD_FILE(rx_statistics, data); |
463 | DEBUGFS_ADD_FILE(tx_statistics, data); | 467 | DEBUGFS_ADD_FILE(tx_statistics, data); |
464 | DEBUGFS_ADD_FILE(channels, data); | 468 | DEBUGFS_ADD_FILE(channels, data); |
469 | DEBUGFS_ADD_X32(status, data, (u32 *)&priv->status); | ||
465 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); | 470 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); |
466 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, | 471 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, |
467 | &priv->disable_chain_noise_cal); | 472 | &priv->disable_chain_noise_cal); |
@@ -469,7 +474,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
469 | return 0; | 474 | return 0; |
470 | 475 | ||
471 | err: | 476 | err: |
472 | IWL_ERROR("Can't open the debugfs directory\n"); | 477 | IWL_ERR(priv, "Can't open the debugfs directory\n"); |
473 | iwl_dbgfs_unregister(priv); | 478 | iwl_dbgfs_unregister(priv); |
474 | return ret; | 479 | return ret; |
475 | } | 480 | } |