aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c b/drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c
index 954aed4e7b34..b767979c5dbb 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c
@@ -29,22 +29,22 @@
29#include "iwl-3945-debugfs.h" 29#include "iwl-3945-debugfs.h"
30 30
31 31
32static int il3945_statistics_flag(struct il_priv *priv, char *buf, int bufsz) 32static int il3945_statistics_flag(struct il_priv *il, char *buf, int bufsz)
33{ 33{
34 int p = 0; 34 int p = 0;
35 35
36 p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", 36 p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n",
37 le32_to_cpu(priv->_3945.statistics.flag)); 37 le32_to_cpu(il->_3945.statistics.flag));
38 if (le32_to_cpu(priv->_3945.statistics.flag) & 38 if (le32_to_cpu(il->_3945.statistics.flag) &
39 UCODE_STATISTICS_CLEAR_MSK) 39 UCODE_STATISTICS_CLEAR_MSK)
40 p += scnprintf(buf + p, bufsz - p, 40 p += scnprintf(buf + p, bufsz - p,
41 "\tStatistics have been cleared\n"); 41 "\tStatistics have been cleared\n");
42 p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", 42 p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n",
43 (le32_to_cpu(priv->_3945.statistics.flag) & 43 (le32_to_cpu(il->_3945.statistics.flag) &
44 UCODE_STATISTICS_FREQUENCY_MSK) 44 UCODE_STATISTICS_FREQUENCY_MSK)
45 ? "2.4 GHz" : "5.2 GHz"); 45 ? "2.4 GHz" : "5.2 GHz");
46 p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", 46 p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n",
47 (le32_to_cpu(priv->_3945.statistics.flag) & 47 (le32_to_cpu(il->_3945.statistics.flag) &
48 UCODE_STATISTICS_NARROW_BAND_MSK) 48 UCODE_STATISTICS_NARROW_BAND_MSK)
49 ? "enabled" : "disabled"); 49 ? "enabled" : "disabled");
50 return p; 50 return p;
@@ -54,7 +54,7 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,
54 char __user *user_buf, 54 char __user *user_buf,
55 size_t count, loff_t *ppos) 55 size_t count, loff_t *ppos)
56{ 56{
57 struct il_priv *priv = file->private_data; 57 struct il_priv *il = file->private_data;
58 int pos = 0; 58 int pos = 0;
59 char *buf; 59 char *buf;
60 int bufsz = sizeof(struct iwl39_statistics_rx_phy) * 40 + 60 int bufsz = sizeof(struct iwl39_statistics_rx_phy) * 40 +
@@ -66,12 +66,12 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,
66 struct iwl39_statistics_rx_non_phy *general, *accum_general; 66 struct iwl39_statistics_rx_non_phy *general, *accum_general;
67 struct iwl39_statistics_rx_non_phy *delta_general, *max_general; 67 struct iwl39_statistics_rx_non_phy *delta_general, *max_general;
68 68
69 if (!il_is_alive(priv)) 69 if (!il_is_alive(il))
70 return -EAGAIN; 70 return -EAGAIN;
71 71
72 buf = kzalloc(bufsz, GFP_KERNEL); 72 buf = kzalloc(bufsz, GFP_KERNEL);
73 if (!buf) { 73 if (!buf) {
74 IL_ERR(priv, "Can not allocate Buffer\n"); 74 IL_ERR(il, "Can not allocate Buffer\n");
75 return -ENOMEM; 75 return -ENOMEM;
76 } 76 }
77 77
@@ -80,20 +80,20 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,
80 * the last statistics notification from uCode 80 * the last statistics notification from uCode
81 * might not reflect the current uCode activity 81 * might not reflect the current uCode activity
82 */ 82 */
83 ofdm = &priv->_3945.statistics.rx.ofdm; 83 ofdm = &il->_3945.statistics.rx.ofdm;
84 cck = &priv->_3945.statistics.rx.cck; 84 cck = &il->_3945.statistics.rx.cck;
85 general = &priv->_3945.statistics.rx.general; 85 general = &il->_3945.statistics.rx.general;
86 accum_ofdm = &priv->_3945.accum_statistics.rx.ofdm; 86 accum_ofdm = &il->_3945.accum_statistics.rx.ofdm;
87 accum_cck = &priv->_3945.accum_statistics.rx.cck; 87 accum_cck = &il->_3945.accum_statistics.rx.cck;
88 accum_general = &priv->_3945.accum_statistics.rx.general; 88 accum_general = &il->_3945.accum_statistics.rx.general;
89 delta_ofdm = &priv->_3945.delta_statistics.rx.ofdm; 89 delta_ofdm = &il->_3945.delta_statistics.rx.ofdm;
90 delta_cck = &priv->_3945.delta_statistics.rx.cck; 90 delta_cck = &il->_3945.delta_statistics.rx.cck;
91 delta_general = &priv->_3945.delta_statistics.rx.general; 91 delta_general = &il->_3945.delta_statistics.rx.general;
92 max_ofdm = &priv->_3945.max_delta.rx.ofdm; 92 max_ofdm = &il->_3945.max_delta.rx.ofdm;
93 max_cck = &priv->_3945.max_delta.rx.cck; 93 max_cck = &il->_3945.max_delta.rx.cck;
94 max_general = &priv->_3945.max_delta.rx.general; 94 max_general = &il->_3945.max_delta.rx.general;
95 95
96 pos += il3945_statistics_flag(priv, buf, bufsz); 96 pos += il3945_statistics_flag(il, buf, bufsz);
97 pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" 97 pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
98 "acumulative delta max\n", 98 "acumulative delta max\n",
99 "Statistics_Rx - OFDM:"); 99 "Statistics_Rx - OFDM:");
@@ -329,19 +329,19 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file,
329 char __user *user_buf, 329 char __user *user_buf,
330 size_t count, loff_t *ppos) 330 size_t count, loff_t *ppos)
331{ 331{
332 struct il_priv *priv = file->private_data; 332 struct il_priv *il = file->private_data;
333 int pos = 0; 333 int pos = 0;
334 char *buf; 334 char *buf;
335 int bufsz = (sizeof(struct iwl39_statistics_tx) * 48) + 250; 335 int bufsz = (sizeof(struct iwl39_statistics_tx) * 48) + 250;
336 ssize_t ret; 336 ssize_t ret;
337 struct iwl39_statistics_tx *tx, *accum_tx, *delta_tx, *max_tx; 337 struct iwl39_statistics_tx *tx, *accum_tx, *delta_tx, *max_tx;
338 338
339 if (!il_is_alive(priv)) 339 if (!il_is_alive(il))
340 return -EAGAIN; 340 return -EAGAIN;
341 341
342 buf = kzalloc(bufsz, GFP_KERNEL); 342 buf = kzalloc(bufsz, GFP_KERNEL);
343 if (!buf) { 343 if (!buf) {
344 IL_ERR(priv, "Can not allocate Buffer\n"); 344 IL_ERR(il, "Can not allocate Buffer\n");
345 return -ENOMEM; 345 return -ENOMEM;
346 } 346 }
347 347
@@ -350,11 +350,11 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file,
350 * the last statistics notification from uCode 350 * the last statistics notification from uCode
351 * might not reflect the current uCode activity 351 * might not reflect the current uCode activity
352 */ 352 */
353 tx = &priv->_3945.statistics.tx; 353 tx = &il->_3945.statistics.tx;
354 accum_tx = &priv->_3945.accum_statistics.tx; 354 accum_tx = &il->_3945.accum_statistics.tx;
355 delta_tx = &priv->_3945.delta_statistics.tx; 355 delta_tx = &il->_3945.delta_statistics.tx;
356 max_tx = &priv->_3945.max_delta.tx; 356 max_tx = &il->_3945.max_delta.tx;
357 pos += il3945_statistics_flag(priv, buf, bufsz); 357 pos += il3945_statistics_flag(il, buf, bufsz);
358 pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" 358 pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
359 "acumulative delta max\n", 359 "acumulative delta max\n",
360 "Statistics_Tx:"); 360 "Statistics_Tx:");
@@ -425,7 +425,7 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,
425 char __user *user_buf, 425 char __user *user_buf,
426 size_t count, loff_t *ppos) 426 size_t count, loff_t *ppos)
427{ 427{
428 struct il_priv *priv = file->private_data; 428 struct il_priv *il = file->private_data;
429 int pos = 0; 429 int pos = 0;
430 char *buf; 430 char *buf;
431 int bufsz = sizeof(struct iwl39_statistics_general) * 10 + 300; 431 int bufsz = sizeof(struct iwl39_statistics_general) * 10 + 300;
@@ -435,12 +435,12 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,
435 struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg; 435 struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
436 struct iwl39_statistics_div *div, *accum_div, *delta_div, *max_div; 436 struct iwl39_statistics_div *div, *accum_div, *delta_div, *max_div;
437 437
438 if (!il_is_alive(priv)) 438 if (!il_is_alive(il))
439 return -EAGAIN; 439 return -EAGAIN;
440 440
441 buf = kzalloc(bufsz, GFP_KERNEL); 441 buf = kzalloc(bufsz, GFP_KERNEL);
442 if (!buf) { 442 if (!buf) {
443 IL_ERR(priv, "Can not allocate Buffer\n"); 443 IL_ERR(il, "Can not allocate Buffer\n");
444 return -ENOMEM; 444 return -ENOMEM;
445 } 445 }
446 446
@@ -449,19 +449,19 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,
449 * the last statistics notification from uCode 449 * the last statistics notification from uCode
450 * might not reflect the current uCode activity 450 * might not reflect the current uCode activity
451 */ 451 */
452 general = &priv->_3945.statistics.general; 452 general = &il->_3945.statistics.general;
453 dbg = &priv->_3945.statistics.general.dbg; 453 dbg = &il->_3945.statistics.general.dbg;
454 div = &priv->_3945.statistics.general.div; 454 div = &il->_3945.statistics.general.div;
455 accum_general = &priv->_3945.accum_statistics.general; 455 accum_general = &il->_3945.accum_statistics.general;
456 delta_general = &priv->_3945.delta_statistics.general; 456 delta_general = &il->_3945.delta_statistics.general;
457 max_general = &priv->_3945.max_delta.general; 457 max_general = &il->_3945.max_delta.general;
458 accum_dbg = &priv->_3945.accum_statistics.general.dbg; 458 accum_dbg = &il->_3945.accum_statistics.general.dbg;
459 delta_dbg = &priv->_3945.delta_statistics.general.dbg; 459 delta_dbg = &il->_3945.delta_statistics.general.dbg;
460 max_dbg = &priv->_3945.max_delta.general.dbg; 460 max_dbg = &il->_3945.max_delta.general.dbg;
461 accum_div = &priv->_3945.accum_statistics.general.div; 461 accum_div = &il->_3945.accum_statistics.general.div;
462 delta_div = &priv->_3945.delta_statistics.general.div; 462 delta_div = &il->_3945.delta_statistics.general.div;
463 max_div = &priv->_3945.max_delta.general.div; 463 max_div = &il->_3945.max_delta.general.div;
464 pos += il3945_statistics_flag(priv, buf, bufsz); 464 pos += il3945_statistics_flag(il, buf, bufsz);
465 pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" 465 pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
466 "acumulative delta max\n", 466 "acumulative delta max\n",
467 "Statistics_General:"); 467 "Statistics_General:");