diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/net/wireless/iwlegacy | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
53 files changed, 41037 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c b/drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c new file mode 100644 index 00000000000..cfabb38793a --- /dev/null +++ b/drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c | |||
| @@ -0,0 +1,523 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * | ||
| 3 | * GPL LICENSE SUMMARY | ||
| 4 | * | ||
| 5 | * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. | ||
| 6 | * | ||
| 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 | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, but | ||
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | * General Public License for more details. | ||
| 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 Street, Fifth Floor, Boston, MA 02110, | ||
| 19 | * USA | ||
| 20 | * | ||
| 21 | * The full GNU General Public License is included in this distribution | ||
| 22 | * in the file called LICENSE.GPL. | ||
| 23 | * | ||
| 24 | * Contact Information: | ||
| 25 | * Intel Linux Wireless <ilw@linux.intel.com> | ||
| 26 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
| 27 | *****************************************************************************/ | ||
| 28 | |||
| 29 | #include "iwl-3945-debugfs.h" | ||
| 30 | |||
| 31 | |||
| 32 | static int iwl3945_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz) | ||
| 33 | { | ||
| 34 | int p = 0; | ||
| 35 | |||
| 36 | p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", | ||
| 37 | le32_to_cpu(priv->_3945.statistics.flag)); | ||
| 38 | if (le32_to_cpu(priv->_3945.statistics.flag) & | ||
| 39 | UCODE_STATISTICS_CLEAR_MSK) | ||
| 40 | p += scnprintf(buf + p, bufsz - p, | ||
| 41 | "\tStatistics have been cleared\n"); | ||
| 42 | p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", | ||
| 43 | (le32_to_cpu(priv->_3945.statistics.flag) & | ||
| 44 | UCODE_STATISTICS_FREQUENCY_MSK) | ||
| 45 | ? "2.4 GHz" : "5.2 GHz"); | ||
| 46 | p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", | ||
| 47 | (le32_to_cpu(priv->_3945.statistics.flag) & | ||
| 48 | UCODE_STATISTICS_NARROW_BAND_MSK) | ||
| 49 | ? "enabled" : "disabled"); | ||
| 50 | return p; | ||
| 51 | } | ||
| 52 | |||
| 53 | ssize_t iwl3945_ucode_rx_stats_read(struct file *file, | ||
| 54 | char __user *user_buf, | ||
| 55 | size_t count, loff_t *ppos) | ||
| 56 | { | ||
| 57 | struct iwl_priv *priv = file->private_data; | ||
| 58 | int pos = 0; | ||
| 59 | char *buf; | ||
| 60 | int bufsz = sizeof(struct iwl39_statistics_rx_phy) * 40 + | ||
| 61 | sizeof(struct iwl39_statistics_rx_non_phy) * 40 + 400; | ||
| 62 | ssize_t ret; | ||
| 63 | struct iwl39_statistics_rx_phy *ofdm, *accum_ofdm, *delta_ofdm, | ||
| 64 | *max_ofdm; | ||
| 65 | struct iwl39_statistics_rx_phy *cck, *accum_cck, *delta_cck, *max_cck; | ||
| 66 | struct iwl39_statistics_rx_non_phy *general, *accum_general; | ||
| 67 | struct iwl39_statistics_rx_non_phy *delta_general, *max_general; | ||
| 68 | |||
| 69 | if (!iwl_legacy_is_alive(priv)) | ||
| 70 | return -EAGAIN; | ||
| 71 | |||
| 72 | buf = kzalloc(bufsz, GFP_KERNEL); | ||
| 73 | if (!buf) { | ||
| 74 | IWL_ERR(priv, "Can not allocate Buffer\n"); | ||
| 75 | return -ENOMEM; | ||
| 76 | } | ||
| 77 | |||
| 78 | /* | ||
| 79 | * The statistic information display here is based on | ||
| 80 | * the last statistics notification from uCode | ||
| 81 | * might not reflect the current uCode activity | ||
| 82 | */ | ||
| 83 | ofdm = &priv->_3945.statistics.rx.ofdm; | ||
| 84 | cck = &priv->_3945.statistics.rx.cck; | ||
| 85 | general = &priv->_3945.statistics.rx.general; | ||
| 86 | accum_ofdm = &priv->_3945.accum_statistics.rx.ofdm; | ||
| 87 | accum_cck = &priv->_3945.accum_statistics.rx.cck; | ||
| 88 | accum_general = &priv->_3945.accum_statistics.rx.general; | ||
| 89 | delta_ofdm = &priv->_3945.delta_statistics.rx.ofdm; | ||
| 90 | delta_cck = &priv->_3945.delta_statistics.rx.cck; | ||
| 91 | delta_general = &priv->_3945.delta_statistics.rx.general; | ||
| 92 | max_ofdm = &priv->_3945.max_delta.rx.ofdm; | ||
| 93 | max_cck = &priv->_3945.max_delta.rx.cck; | ||
| 94 | max_general = &priv->_3945.max_delta.rx.general; | ||
| 95 | |||
| 96 | pos += iwl3945_statistics_flag(priv, buf, bufsz); | ||
| 97 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" | ||
| 98 | "acumulative delta max\n", | ||
| 99 | "Statistics_Rx - OFDM:"); | ||
| 100 | pos += scnprintf(buf + pos, bufsz - pos, | ||
| 101 | " %-30s %10u %10u %10u %10u\n", | ||
| 102 | "ina_cnt:", le32_to_cpu(ofdm->ina_cnt), | ||
| 103 | accum_ofdm->ina_cnt, | ||
| 104 | delta_ofdm->ina_cnt, max_ofdm->ina_cnt); | ||
| 105 | pos += scnprintf(buf + pos, bufsz - pos, | ||
| 106 | " %-30s %10u %10u %10u %10u\n", | ||
| 107 | "fina_cnt:", | ||
| 108 | le32_to_cpu(ofdm->fina_cnt), accum_ofdm->fina_cnt, | ||
| 109 | delta_ofdm->fina_cnt, max_ofdm->fina_cnt); | ||
| 110 | pos += scnprintf(buf + pos, bufsz - pos, | ||
| 111 | " %-30s %10u %10u %10u %10u\n", "plcp_err:", | ||
| 112 | le32_to_cpu(ofdm->plcp_err), accum_ofdm->plcp_err, | ||
| 113 | delta_ofdm->plcp_err, max_ofdm->plcp_err); | ||
| 114 | pos += scnprintf(buf + pos, bufsz - pos, | ||
| 115 | " %-30s %10u %10u %10u %10u\n", "crc32_err:", | ||
| 116 | le32_to_cpu(ofdm->crc32_err), accum_ofdm->crc32_err, | ||
