Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * GPL LICENSE SUMMARY |
| 4 | * |
Reinette Chatre | 01f8162 | 2009-01-08 10:20:02 -0800 | [diff] [blame] | 5 | * Copyright(c) 2008 - 2009 Intel Corporation. All rights reserved. |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 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: |
Winkler, Tomas | 759ef89 | 2008-12-09 11:28:58 -0800 | [diff] [blame] | 25 | * Intel Linux Wireless <ilw@linux.intel.com> |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 26 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 27 | *****************************************************************************/ |
| 28 | |
| 29 | #include <linux/kernel.h> |
| 30 | #include <linux/module.h> |
| 31 | #include <linux/debugfs.h> |
| 32 | |
| 33 | #include <linux/ieee80211.h> |
| 34 | #include <net/mac80211.h> |
| 35 | |
| 36 | |
Tomas Winkler | 3e0d4cb | 2008-04-24 11:55:38 -0700 | [diff] [blame] | 37 | #include "iwl-dev.h" |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 38 | #include "iwl-debug.h" |
Tomas Winkler | fee1247 | 2008-04-03 16:05:21 -0700 | [diff] [blame] | 39 | #include "iwl-core.h" |
Tomas Winkler | 3395f6e | 2008-03-25 16:33:37 -0700 | [diff] [blame] | 40 | #include "iwl-io.h" |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 41 | |
| 42 | |
| 43 | /* create and remove of files */ |
| 44 | #define DEBUGFS_ADD_DIR(name, parent) do { \ |
| 45 | dbgfs->dir_##name = debugfs_create_dir(#name, parent); \ |
| 46 | if (!(dbgfs->dir_##name)) \ |
| 47 | goto err; \ |
| 48 | } while (0) |
| 49 | |
| 50 | #define DEBUGFS_ADD_FILE(name, parent) do { \ |
| 51 | dbgfs->dbgfs_##parent##_files.file_##name = \ |
| 52 | debugfs_create_file(#name, 0644, dbgfs->dir_##parent, priv, \ |
| 53 | &iwl_dbgfs_##name##_ops); \ |
| 54 | if (!(dbgfs->dbgfs_##parent##_files.file_##name)) \ |
| 55 | goto err; \ |
| 56 | } while (0) |
| 57 | |
Tomas Winkler | 445c2df | 2008-05-15 13:54:16 +0800 | [diff] [blame] | 58 | #define DEBUGFS_ADD_BOOL(name, parent, ptr) do { \ |
| 59 | dbgfs->dbgfs_##parent##_files.file_##name = \ |
| 60 | debugfs_create_bool(#name, 0644, dbgfs->dir_##parent, ptr); \ |
Zhaolei | 9b24001 | 2008-10-22 17:06:12 +0800 | [diff] [blame] | 61 | if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name) \ |
| 62 | || !dbgfs->dbgfs_##parent##_files.file_##name) \ |
Tomas Winkler | 445c2df | 2008-05-15 13:54:16 +0800 | [diff] [blame] | 63 | goto err; \ |
| 64 | } while (0) |
| 65 | |
Winkler, Tomas | 2ddfa12 | 2008-12-22 11:31:20 +0800 | [diff] [blame] | 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 | |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 74 | #define DEBUGFS_REMOVE(name) do { \ |
| 75 | debugfs_remove(name); \ |
| 76 | name = NULL; \ |
| 77 | } while (0); |
| 78 | |
| 79 | /* file operation */ |
| 80 | #define DEBUGFS_READ_FUNC(name) \ |
| 81 | static ssize_t iwl_dbgfs_##name##_read(struct file *file, \ |
| 82 | char __user *user_buf, \ |
| 83 | size_t count, loff_t *ppos); |
| 84 | |
| 85 | #define DEBUGFS_WRITE_FUNC(name) \ |
| 86 | static ssize_t iwl_dbgfs_##name##_write(struct file *file, \ |
| 87 | const char __user *user_buf, \ |
| 88 | size_t count, loff_t *ppos); |
| 89 | |
| 90 | |
| 91 | static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file) |
| 92 | { |
| 93 | file->private_data = inode->i_private; |
| 94 | return 0; |
| 95 | } |
| 96 | |
| 97 | #define DEBUGFS_READ_FILE_OPS(name) \ |
| 98 | DEBUGFS_READ_FUNC(name); \ |
| 99 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ |
| 100 | .read = iwl_dbgfs_##name##_read, \ |
| 101 | .open = iwl_dbgfs_open_file_generic, \ |
| 102 | }; |
| 103 | |
Ester Kummer | 189a2b5 | 2008-05-15 13:54:18 +0800 | [diff] [blame] | 104 | #define DEBUGFS_WRITE_FILE_OPS(name) \ |
| 105 | DEBUGFS_WRITE_FUNC(name); \ |
| 106 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ |
| 107 | .write = iwl_dbgfs_##name##_write, \ |
| 108 | .open = iwl_dbgfs_open_file_generic, \ |
| 109 | }; |
| 110 | |
| 111 | |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 112 | #define DEBUGFS_READ_WRITE_FILE_OPS(name) \ |
| 113 | DEBUGFS_READ_FUNC(name); \ |
| 114 | DEBUGFS_WRITE_FUNC(name); \ |
| 115 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ |
| 116 | .write = iwl_dbgfs_##name##_write, \ |
| 117 | .read = iwl_dbgfs_##name##_read, \ |
| 118 | .open = iwl_dbgfs_open_file_generic, \ |
| 119 | }; |
| 120 | |
| 121 | |
| 122 | static ssize_t iwl_dbgfs_tx_statistics_read(struct file *file, |
| 123 | char __user *user_buf, |
| 124 | size_t count, loff_t *ppos) { |
| 125 | |
| 126 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
| 127 | char buf[256]; |
| 128 | int pos = 0; |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 129 | const size_t bufsz = sizeof(buf); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 130 | |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 131 | pos += scnprintf(buf + pos, bufsz - pos, "mgmt: %u\n", |
| 132 | priv->tx_stats[0].cnt); |
| 133 | pos += scnprintf(buf + pos, bufsz - pos, "ctrl: %u\n", |
| 134 | priv->tx_stats[1].cnt); |
| 135 | pos += scnprintf(buf + pos, bufsz - pos, "data: %u\n", |
| 136 | priv->tx_stats[2].cnt); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 137 | |
| 138 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
| 139 | } |
| 140 | |
| 141 | static ssize_t iwl_dbgfs_rx_statistics_read(struct file *file, |
| 142 | char __user *user_buf, |
| 143 | size_t count, loff_t *ppos) { |
| 144 | |
| 145 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
| 146 | char buf[256]; |
| 147 | int pos = 0; |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 148 | const size_t bufsz = sizeof(buf); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 149 | |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 150 | pos += scnprintf(buf + pos, bufsz - pos, "mgmt: %u\n", |
| 151 | priv->rx_stats[0].cnt); |
| 152 | pos += scnprintf(buf + pos, bufsz - pos, "ctrl: %u\n", |
| 153 | priv->rx_stats[1].cnt); |
| 154 | pos += scnprintf(buf + pos, bufsz - pos, "data: %u\n", |
| 155 | priv->rx_stats[2].cnt); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 156 | |
| 157 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
| 158 | } |
| 159 | |
| 160 | #define BYTE1_MASK 0x000000ff; |
| 161 | #define BYTE2_MASK 0x0000ffff; |
| 162 | #define BYTE3_MASK 0x00ffffff; |
| 163 | static ssize_t iwl_dbgfs_sram_read(struct file *file, |
| 164 | char __user *user_buf, |
| 165 | size_t count, loff_t *ppos) |
| 166 | { |
| 167 | u32 val; |
| 168 | char buf[1024]; |
| 169 | ssize_t ret; |
| 170 | int i; |
| 171 | int pos = 0; |
| 172 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 173 | const size_t bufsz = sizeof(buf); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 174 | |
Tomas Winkler | 3395f6e | 2008-03-25 16:33:37 -0700 | [diff] [blame] | 175 | iwl_grab_nic_access(priv); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 176 | for (i = priv->dbgfs->sram_len; i > 0; i -= 4) { |
Tomas Winkler | 3395f6e | 2008-03-25 16:33:37 -0700 | [diff] [blame] | 177 | val = iwl_read_targ_mem(priv, priv->dbgfs->sram_offset + \ |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 178 | priv->dbgfs->sram_len - i); |
| 179 | if (i < 4) { |
| 180 | switch (i) { |
| 181 | case 1: |
| 182 | val &= BYTE1_MASK; |
| 183 | break; |
| 184 | case 2: |
| 185 | val &= BYTE2_MASK; |
| 186 | break; |
| 187 | case 3: |
| 188 | val &= BYTE3_MASK; |
| 189 | break; |
| 190 | } |
| 191 | } |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 192 | pos += scnprintf(buf + pos, bufsz - pos, "0x%08x ", val); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 193 | } |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 194 | pos += scnprintf(buf + pos, bufsz - pos, "\n"); |
Tomas Winkler | 3395f6e | 2008-03-25 16:33:37 -0700 | [diff] [blame] | 195 | iwl_release_nic_access(priv); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 196 | |
| 197 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
| 198 | return ret; |
| 199 | } |
| 200 | |
| 201 | static ssize_t iwl_dbgfs_sram_write(struct file *file, |
| 202 | const char __user *user_buf, |
| 203 | size_t count, loff_t *ppos) |
| 204 | { |
| 205 | struct iwl_priv *priv = file->private_data; |
| 206 | char buf[64]; |
| 207 | int buf_size; |
| 208 | u32 offset, len; |
| 209 | |
| 210 | memset(buf, 0, sizeof(buf)); |
| 211 | buf_size = min(count, sizeof(buf) - 1); |
| 212 | if (copy_from_user(buf, user_buf, buf_size)) |
| 213 | return -EFAULT; |
| 214 | |
| 215 | if (sscanf(buf, "%x,%x", &offset, &len) == 2) { |
| 216 | priv->dbgfs->sram_offset = offset; |
| 217 | priv->dbgfs->sram_len = len; |
| 218 | } else { |
| 219 | priv->dbgfs->sram_offset = 0; |
| 220 | priv->dbgfs->sram_len = 0; |
| 221 | } |
| 222 | |
| 223 | return count; |
| 224 | } |
| 225 | |
| 226 | static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, |
| 227 | size_t count, loff_t *ppos) |
| 228 | { |
| 229 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
Tomas Winkler | 6def976 | 2008-05-05 10:22:31 +0800 | [diff] [blame] | 230 | struct iwl_station_entry *station; |
Tomas Winkler | 5425e49 | 2008-04-15 16:01:38 -0700 | [diff] [blame] | 231 | int max_sta = priv->hw_params.max_stations; |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 232 | char *buf; |
| 233 | int i, j, pos = 0; |
| 234 | ssize_t ret; |
| 235 | /* Add 30 for initial string */ |
| 236 | const size_t bufsz = 30 + sizeof(char) * 500 * (priv->num_stations); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 237 | |
| 238 | buf = kmalloc(bufsz, GFP_KERNEL); |
Tomas Winkler | 3ac7f14 | 2008-07-21 02:40:14 +0300 | [diff] [blame] | 239 | if (!buf) |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 240 | return -ENOMEM; |
| 241 | |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 242 | pos += scnprintf(buf + pos, bufsz - pos, "num of stations: %d\n\n", |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 243 | priv->num_stations); |
| 244 | |
| 245 | for (i = 0; i < max_sta; i++) { |
| 246 | station = &priv->stations[i]; |
| 247 | if (station->used) { |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 248 | pos += scnprintf(buf + pos, bufsz - pos, |
| 249 | "station %d:\ngeneral data:\n", i+1); |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 250 | pos += scnprintf(buf + pos, bufsz - pos, "id: %u\n", |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 251 | station->sta.sta.sta_id); |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 252 | pos += scnprintf(buf + pos, bufsz - pos, "mode: %u\n", |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 253 | station->sta.mode); |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 254 | pos += scnprintf(buf + pos, bufsz - pos, |
| 255 | "flags: 0x%x\n", |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 256 | station->sta.station_flags_msk); |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 257 | pos += scnprintf(buf + pos, bufsz - pos, |
| 258 | "ps_status: %u\n", station->ps_status); |
| 259 | pos += scnprintf(buf + pos, bufsz - pos, "tid data:\n"); |
| 260 | pos += scnprintf(buf + pos, bufsz - pos, |
David S. Miller | 344234d | 2008-04-19 18:09:39 -0700 | [diff] [blame] | 261 | "seq_num\t\ttxq_id"); |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 262 | pos += scnprintf(buf + pos, bufsz - pos, |
David S. Miller | 344234d | 2008-04-19 18:09:39 -0700 | [diff] [blame] | 263 | "\tframe_count\twait_for_ba\t"); |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 264 | pos += scnprintf(buf + pos, bufsz - pos, |
| 265 | "start_idx\tbitmap0\t"); |
| 266 | pos += scnprintf(buf + pos, bufsz - pos, |
David S. Miller | 344234d | 2008-04-19 18:09:39 -0700 | [diff] [blame] | 267 | "bitmap1\trate_n_flags"); |
David S. Miller | 344234d | 2008-04-19 18:09:39 -0700 | [diff] [blame] | 268 | pos += scnprintf(buf + pos, bufsz - pos, "\n"); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 269 | |
| 270 | for (j = 0; j < MAX_TID_COUNT; j++) { |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 271 | pos += scnprintf(buf + pos, bufsz - pos, |
David S. Miller | 344234d | 2008-04-19 18:09:39 -0700 | [diff] [blame] | 272 | "[%d]:\t\t%u", j, |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 273 | station->tid[j].seq_number); |
| 274 | pos += scnprintf(buf + pos, bufsz - pos, |
David S. Miller | 344234d | 2008-04-19 18:09:39 -0700 | [diff] [blame] | 275 | "\t%u\t\t%u\t\t%u\t\t", |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 276 | station->tid[j].agg.txq_id, |
| 277 | station->tid[j].agg.frame_count, |
| 278 | station->tid[j].agg.wait_for_ba); |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 279 | pos += scnprintf(buf + pos, bufsz - pos, |
David S. Miller | 344234d | 2008-04-19 18:09:39 -0700 | [diff] [blame] | 280 | "%u\t%llu\t%u", |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 281 | station->tid[j].agg.start_idx, |
John W. Linville | 1678859 | 2008-04-01 20:59:32 -0400 | [diff] [blame] | 282 | (unsigned long long)station->tid[j].agg.bitmap, |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 283 | station->tid[j].agg.rate_n_flags); |
David S. Miller | 344234d | 2008-04-19 18:09:39 -0700 | [diff] [blame] | 284 | pos += scnprintf(buf + pos, bufsz - pos, "\n"); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 285 | } |
Abhijeet Kolekar | db0589f | 2008-04-14 21:16:04 -0700 | [diff] [blame] | 286 | pos += scnprintf(buf + pos, bufsz - pos, "\n"); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 287 | } |
| 288 | } |
| 289 | |
| 290 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
| 291 | kfree(buf); |
| 292 | return ret; |
| 293 | } |
| 294 | |
Tomas Winkler | 8dd266e | 2008-05-05 10:22:32 +0800 | [diff] [blame] | 295 | static ssize_t iwl_dbgfs_eeprom_read(struct file *file, |
| 296 | char __user *user_buf, |
| 297 | size_t count, |
| 298 | loff_t *ppos) |
| 299 | { |
| 300 | ssize_t ret; |
| 301 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
| 302 | int pos = 0, ofs = 0, buf_size = 0; |
| 303 | const u8 *ptr; |
| 304 | char *buf; |
| 305 | size_t eeprom_len = priv->cfg->eeprom_size; |
| 306 | buf_size = 4 * eeprom_len + 256; |
| 307 | |
| 308 | if (eeprom_len % 16) { |
Winkler, Tomas | 15b1687 | 2008-12-19 10:37:33 +0800 | [diff] [blame] | 309 | IWL_ERR(priv, "EEPROM size is not multiple of 16.\n"); |
Tomas Winkler | 8dd266e | 2008-05-05 10:22:32 +0800 | [diff] [blame] | 310 | return -ENODATA; |
| 311 | } |
| 312 | |
| 313 | /* 4 characters for byte 0xYY */ |
| 314 | buf = kzalloc(buf_size, GFP_KERNEL); |
| 315 | if (!buf) { |
Winkler, Tomas | 15b1687 | 2008-12-19 10:37:33 +0800 | [diff] [blame] | 316 | IWL_ERR(priv, "Can not allocate Buffer\n"); |
Tomas Winkler | 8dd266e | 2008-05-05 10:22:32 +0800 | [diff] [blame] | 317 | return -ENOMEM; |
| 318 | } |
| 319 | |
| 320 | ptr = priv->eeprom; |
| 321 | for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { |
| 322 | pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs); |
| 323 | hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos, |
| 324 | buf_size - pos, 0); |
| 325 | pos += strlen(buf); |
| 326 | if (buf_size - pos > 0) |
| 327 | buf[pos++] = '\n'; |
| 328 | } |
| 329 | |
| 330 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
| 331 | kfree(buf); |
| 332 | return ret; |
| 333 | } |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 334 | |
Ester Kummer | 189a2b5 | 2008-05-15 13:54:18 +0800 | [diff] [blame] | 335 | static ssize_t iwl_dbgfs_log_event_write(struct file *file, |
| 336 | const char __user *user_buf, |
| 337 | size_t count, loff_t *ppos) |
| 338 | { |
| 339 | struct iwl_priv *priv = file->private_data; |
| 340 | u32 event_log_flag; |
| 341 | char buf[8]; |
| 342 | int buf_size; |
| 343 | |
| 344 | memset(buf, 0, sizeof(buf)); |
| 345 | buf_size = min(count, sizeof(buf) - 1); |
| 346 | if (copy_from_user(buf, user_buf, buf_size)) |
| 347 | return -EFAULT; |
| 348 | if (sscanf(buf, "%d", &event_log_flag) != 1) |
| 349 | return -EFAULT; |
| 350 | if (event_log_flag == 1) |
| 351 | iwl_dump_nic_event_log(priv); |
| 352 | |
| 353 | return count; |
| 354 | } |
| 355 | |
Winkler, Tomas | d366df5 | 2008-12-02 12:14:01 -0800 | [diff] [blame] | 356 | |
| 357 | |
| 358 | static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, |
| 359 | size_t count, loff_t *ppos) |
| 360 | { |
| 361 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
| 362 | struct ieee80211_channel *channels = NULL; |
| 363 | const struct ieee80211_supported_band *supp_band = NULL; |
| 364 | int pos = 0, i, bufsz = PAGE_SIZE; |
| 365 | char *buf; |
| 366 | ssize_t ret; |
| 367 | |
| 368 | if (!test_bit(STATUS_GEO_CONFIGURED, &priv->status)) |
| 369 | return -EAGAIN; |
| 370 | |
| 371 | buf = kzalloc(bufsz, GFP_KERNEL); |
| 372 | if (!buf) { |
Winkler, Tomas | 15b1687 | 2008-12-19 10:37:33 +0800 | [diff] [blame] | 373 | IWL_ERR(priv, "Can not allocate Buffer\n"); |
Winkler, Tomas | d366df5 | 2008-12-02 12:14:01 -0800 | [diff] [blame] | 374 | return -ENOMEM; |
| 375 | } |
| 376 | |
| 377 | supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_2GHZ); |
| 378 | channels = supp_band->channels; |
| 379 | |
| 380 | pos += scnprintf(buf + pos, bufsz - pos, |
| 381 | "Displaying %d channels in 2.4GHz band 802.11bg):\n", |
| 382 | supp_band->n_channels); |
| 383 | |
| 384 | for (i = 0; i < supp_band->n_channels; i++) |
| 385 | pos += scnprintf(buf + pos, bufsz - pos, |
| 386 | "%d: %ddBm: BSS%s%s, %s.\n", |
| 387 | ieee80211_frequency_to_channel( |
| 388 | channels[i].center_freq), |
| 389 | channels[i].max_power, |
| 390 | channels[i].flags & IEEE80211_CHAN_RADAR ? |
| 391 | " (IEEE 802.11h required)" : "", |
Mohamed Abbas | 1620108 | 2009-04-08 11:39:31 -0700 | [diff] [blame] | 392 | ((channels[i].flags & IEEE80211_CHAN_NO_IBSS) |
Winkler, Tomas | d366df5 | 2008-12-02 12:14:01 -0800 | [diff] [blame] | 393 | || (channels[i].flags & |
| 394 | IEEE80211_CHAN_RADAR)) ? "" : |
| 395 | ", IBSS", |
| 396 | channels[i].flags & |
| 397 | IEEE80211_CHAN_PASSIVE_SCAN ? |
| 398 | "passive only" : "active/passive"); |
| 399 | |
| 400 | supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_5GHZ); |
| 401 | channels = supp_band->channels; |
| 402 | |
| 403 | pos += scnprintf(buf + pos, bufsz - pos, |
| 404 | "Displaying %d channels in 5.2GHz band (802.11a)\n", |
| 405 | supp_band->n_channels); |
| 406 | |
| 407 | for (i = 0; i < supp_band->n_channels; i++) |
| 408 | pos += scnprintf(buf + pos, bufsz - pos, |
| 409 | "%d: %ddBm: BSS%s%s, %s.\n", |
| 410 | ieee80211_frequency_to_channel( |
| 411 | channels[i].center_freq), |
| 412 | channels[i].max_power, |
| 413 | channels[i].flags & IEEE80211_CHAN_RADAR ? |
| 414 | " (IEEE 802.11h required)" : "", |
| 415 | ((channels[i].flags & IEEE80211_CHAN_NO_IBSS) |
| 416 | || (channels[i].flags & |
| 417 | IEEE80211_CHAN_RADAR)) ? "" : |
| 418 | ", IBSS", |
| 419 | channels[i].flags & |
| 420 | IEEE80211_CHAN_PASSIVE_SCAN ? |
| 421 | "passive only" : "active/passive"); |
| 422 | |
| 423 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
| 424 | kfree(buf); |
| 425 | return ret; |
| 426 | } |
| 427 | |
Wey-Yi Guy | 08df05a | 2009-03-24 10:02:54 -0700 | [diff] [blame] | 428 | static ssize_t iwl_dbgfs_status_read(struct file *file, |
| 429 | char __user *user_buf, |
| 430 | size_t count, loff_t *ppos) { |
| 431 | |
| 432 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
| 433 | char buf[512]; |
| 434 | int pos = 0; |
| 435 | const size_t bufsz = sizeof(buf); |
| 436 | |
| 437 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_HCMD_ACTIVE:\t %d\n", |
| 438 | test_bit(STATUS_HCMD_ACTIVE, &priv->status)); |
| 439 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_HCMD_SYNC_ACTIVE: %d\n", |
| 440 | test_bit(STATUS_HCMD_SYNC_ACTIVE, &priv->status)); |
| 441 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_INT_ENABLED:\t %d\n", |
| 442 | test_bit(STATUS_INT_ENABLED, &priv->status)); |
| 443 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_RF_KILL_HW:\t %d\n", |
| 444 | test_bit(STATUS_RF_KILL_HW, &priv->status)); |
| 445 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_RF_KILL_SW:\t %d\n", |
| 446 | test_bit(STATUS_RF_KILL_SW, &priv->status)); |
| 447 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_INIT:\t\t %d\n", |
| 448 | test_bit(STATUS_INIT, &priv->status)); |
| 449 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_ALIVE:\t\t %d\n", |
| 450 | test_bit(STATUS_ALIVE, &priv->status)); |
| 451 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_READY:\t\t %d\n", |
| 452 | test_bit(STATUS_READY, &priv->status)); |
| 453 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_TEMPERATURE:\t %d\n", |
| 454 | test_bit(STATUS_TEMPERATURE, &priv->status)); |
| 455 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_GEO_CONFIGURED:\t %d\n", |
| 456 | test_bit(STATUS_GEO_CONFIGURED, &priv->status)); |
| 457 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_EXIT_PENDING:\t %d\n", |
| 458 | test_bit(STATUS_EXIT_PENDING, &priv->status)); |
Wey-Yi Guy | 08df05a | 2009-03-24 10:02:54 -0700 | [diff] [blame] | 459 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_STATISTICS:\t %d\n", |
| 460 | test_bit(STATUS_STATISTICS, &priv->status)); |
| 461 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCANNING:\t %d\n", |
| 462 | test_bit(STATUS_SCANNING, &priv->status)); |
| 463 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCAN_ABORTING:\t %d\n", |
| 464 | test_bit(STATUS_SCAN_ABORTING, &priv->status)); |
| 465 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCAN_HW:\t\t %d\n", |
| 466 | test_bit(STATUS_SCAN_HW, &priv->status)); |
| 467 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_POWER_PMI:\t %d\n", |
| 468 | test_bit(STATUS_POWER_PMI, &priv->status)); |
| 469 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_FW_ERROR:\t %d\n", |
| 470 | test_bit(STATUS_FW_ERROR, &priv->status)); |
| 471 | pos += scnprintf(buf + pos, bufsz - pos, "STATUS_MODE_PENDING:\t %d\n", |
| 472 | test_bit(STATUS_MODE_PENDING, &priv->status)); |
| 473 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
| 474 | } |
| 475 | |
Wey-Yi Guy | a83b914 | 2009-04-08 11:39:32 -0700 | [diff] [blame] | 476 | static ssize_t iwl_dbgfs_interrupt_read(struct file *file, |
| 477 | char __user *user_buf, |
| 478 | size_t count, loff_t *ppos) { |
| 479 | |
| 480 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; |
| 481 | int pos = 0; |
| 482 | int cnt = 0; |
| 483 | char *buf; |
| 484 | int bufsz = 24 * 64; /* 24 items * 64 char per item */ |
| 485 | ssize_t ret; |
| 486 | |
| 487 | buf = kzalloc(bufsz, GFP_KERNEL); |
| 488 | if (!buf) { |
| 489 | IWL_ERR(priv, "Can not allocate Buffer\n"); |
| 490 | return -ENOMEM; |
| 491 | } |
| 492 | |
| 493 | pos += scnprintf(buf + pos, bufsz - pos, |
| 494 | "Interrupt Statistics Report:\n"); |
| 495 | |
| 496 | pos += scnprintf(buf + pos, bufsz - pos, "HW Error:\t\t\t %u\n", |
| 497 | priv->isr_stats.hw); |
| 498 | pos += scnprintf(buf + pos, bufsz - pos, "SW Error:\t\t\t %u\n", |
| 499 | priv->isr_stats.sw); |
| 500 | if (priv->isr_stats.sw > 0) { |
| 501 | pos += scnprintf(buf + pos, bufsz - pos, |
| 502 | "\tLast Restarting Code: 0x%X\n", |
| 503 | priv->isr_stats.sw_err); |
| 504 | } |
| 505 | #ifdef CONFIG_IWLWIFI_DEBUG |
| 506 | pos += scnprintf(buf + pos, bufsz - pos, "Frame transmitted:\t\t %u\n", |
| 507 | priv->isr_stats.sch); |
| 508 | pos += scnprintf(buf + pos, bufsz - pos, "Alive interrupt:\t\t %u\n", |
| 509 | priv->isr_stats.alive); |
| 510 | #endif |
| 511 | pos += scnprintf(buf + pos, bufsz - pos, |
| 512 | "HW RF KILL switch toggled:\t %u\n", |
| 513 | priv->isr_stats.rfkill); |
| 514 | |
| 515 | pos += scnprintf(buf + pos, bufsz - pos, "CT KILL:\t\t\t %u\n", |
| 516 | priv->isr_stats.ctkill); |
| 517 | |
| 518 | pos += scnprintf(buf + pos, bufsz - pos, "Wakeup Interrupt:\t\t %u\n", |
| 519 | priv->isr_stats.wakeup); |
| 520 | |
| 521 | pos += scnprintf(buf + pos, bufsz - pos, |
| 522 | "Rx command responses:\t\t %u\n", |
| 523 | priv->isr_stats.rx); |
| 524 | for (cnt = 0; cnt < REPLY_MAX; cnt++) { |
| 525 | if (priv->isr_stats.rx_handlers[cnt] > 0) |
| 526 | pos += scnprintf(buf + pos, bufsz - pos, |
| 527 | "\tRx handler[%36s]:\t\t %u\n", |
| 528 | get_cmd_string(cnt), |
| 529 | priv->isr_stats.rx_handlers[cnt]); |
| 530 | } |
| 531 | |
| 532 | pos += scnprintf(buf + pos, bufsz - pos, "Tx/FH interrupt:\t\t %u\n", |
| 533 | priv->isr_stats.tx); |
| 534 | |
| 535 | pos += scnprintf(buf + pos, bufsz - pos, "Unexpected INTA:\t\t %u\n", |
| 536 | priv->isr_stats.unhandled); |
| 537 | |
| 538 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
| 539 | kfree(buf); |
| 540 | return ret; |
| 541 | } |
| 542 | |
| 543 | static ssize_t iwl_dbgfs_interrupt_write(struct file *file, |
| 544 | const char __user *user_buf, |
| 545 | size_t count, loff_t *ppos) |
| 546 | { |
| 547 | struct iwl_priv *priv = file->private_data; |
| 548 | char buf[8]; |
| 549 | int buf_size; |
| 550 | u32 reset_flag; |
| 551 | |
| 552 | memset(buf, 0, sizeof(buf)); |
| 553 | buf_size = min(count, sizeof(buf) - 1); |
| 554 | if (copy_from_user(buf, user_buf, buf_size)) |
| 555 | return -EFAULT; |
| 556 | if (sscanf(buf, "%x", &reset_flag) != 1) |
| 557 | return -EFAULT; |
| 558 | if (reset_flag == 0) |
| 559 | iwl_clear_isr_stats(priv); |
| 560 | |
| 561 | return count; |
| 562 | } |
| 563 | |
| 564 | |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 565 | DEBUGFS_READ_WRITE_FILE_OPS(sram); |
Ester Kummer | 189a2b5 | 2008-05-15 13:54:18 +0800 | [diff] [blame] | 566 | DEBUGFS_WRITE_FILE_OPS(log_event); |
Tomas Winkler | 8dd266e | 2008-05-05 10:22:32 +0800 | [diff] [blame] | 567 | DEBUGFS_READ_FILE_OPS(eeprom); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 568 | DEBUGFS_READ_FILE_OPS(stations); |
| 569 | DEBUGFS_READ_FILE_OPS(rx_statistics); |
| 570 | DEBUGFS_READ_FILE_OPS(tx_statistics); |
Winkler, Tomas | d366df5 | 2008-12-02 12:14:01 -0800 | [diff] [blame] | 571 | DEBUGFS_READ_FILE_OPS(channels); |
Wey-Yi Guy | 08df05a | 2009-03-24 10:02:54 -0700 | [diff] [blame] | 572 | DEBUGFS_READ_FILE_OPS(status); |
Wey-Yi Guy | a83b914 | 2009-04-08 11:39:32 -0700 | [diff] [blame] | 573 | DEBUGFS_READ_WRITE_FILE_OPS(interrupt); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 574 | |
| 575 | /* |
| 576 | * Create the debugfs files and directories |
| 577 | * |
| 578 | */ |
| 579 | int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) |
| 580 | { |
| 581 | struct iwl_debugfs *dbgfs; |
Zhu Yi | 95b1a82 | 2008-05-29 16:34:50 +0800 | [diff] [blame] | 582 | struct dentry *phyd = priv->hw->wiphy->debugfsdir; |
Tomas Winkler | 3ac7f14 | 2008-07-21 02:40:14 +0300 | [diff] [blame] | 583 | int ret = 0; |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 584 | |
| 585 | dbgfs = kzalloc(sizeof(struct iwl_debugfs), GFP_KERNEL); |
| 586 | if (!dbgfs) { |
Tomas Winkler | 3ac7f14 | 2008-07-21 02:40:14 +0300 | [diff] [blame] | 587 | ret = -ENOMEM; |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 588 | goto err; |
| 589 | } |
| 590 | |
| 591 | priv->dbgfs = dbgfs; |
| 592 | dbgfs->name = name; |
Zhu Yi | 95b1a82 | 2008-05-29 16:34:50 +0800 | [diff] [blame] | 593 | dbgfs->dir_drv = debugfs_create_dir(name, phyd); |
Tomas Winkler | 3ac7f14 | 2008-07-21 02:40:14 +0300 | [diff] [blame] | 594 | if (!dbgfs->dir_drv || IS_ERR(dbgfs->dir_drv)) { |
| 595 | ret = -ENOENT; |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 596 | goto err; |
| 597 | } |
| 598 | |
| 599 | DEBUGFS_ADD_DIR(data, dbgfs->dir_drv); |
Tomas Winkler | 445c2df | 2008-05-15 13:54:16 +0800 | [diff] [blame] | 600 | DEBUGFS_ADD_DIR(rf, dbgfs->dir_drv); |
Tomas Winkler | 8dd266e | 2008-05-05 10:22:32 +0800 | [diff] [blame] | 601 | DEBUGFS_ADD_FILE(eeprom, data); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 602 | DEBUGFS_ADD_FILE(sram, data); |
Ester Kummer | 189a2b5 | 2008-05-15 13:54:18 +0800 | [diff] [blame] | 603 | DEBUGFS_ADD_FILE(log_event, data); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 604 | DEBUGFS_ADD_FILE(stations, data); |
| 605 | DEBUGFS_ADD_FILE(rx_statistics, data); |
| 606 | DEBUGFS_ADD_FILE(tx_statistics, data); |
Winkler, Tomas | d366df5 | 2008-12-02 12:14:01 -0800 | [diff] [blame] | 607 | DEBUGFS_ADD_FILE(channels, data); |
Wey-Yi Guy | 08df05a | 2009-03-24 10:02:54 -0700 | [diff] [blame] | 608 | DEBUGFS_ADD_FILE(status, data); |
Wey-Yi Guy | a83b914 | 2009-04-08 11:39:32 -0700 | [diff] [blame] | 609 | DEBUGFS_ADD_FILE(interrupt, data); |
Tomas Winkler | 445c2df | 2008-05-15 13:54:16 +0800 | [diff] [blame] | 610 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); |
| 611 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, |
| 612 | &priv->disable_chain_noise_cal); |
Emmanuel Grumbach | 203566f | 2008-06-12 09:46:54 +0800 | [diff] [blame] | 613 | DEBUGFS_ADD_BOOL(disable_tx_power, rf, &priv->disable_tx_power_cal); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 614 | return 0; |
| 615 | |
| 616 | err: |
Winkler, Tomas | 15b1687 | 2008-12-19 10:37:33 +0800 | [diff] [blame] | 617 | IWL_ERR(priv, "Can't open the debugfs directory\n"); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 618 | iwl_dbgfs_unregister(priv); |
Tomas Winkler | 3ac7f14 | 2008-07-21 02:40:14 +0300 | [diff] [blame] | 619 | return ret; |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 620 | } |
| 621 | EXPORT_SYMBOL(iwl_dbgfs_register); |
| 622 | |
| 623 | /** |
| 624 | * Remove the debugfs files and directories |
| 625 | * |
| 626 | */ |
| 627 | void iwl_dbgfs_unregister(struct iwl_priv *priv) |
| 628 | { |
Tomas Winkler | 3ac7f14 | 2008-07-21 02:40:14 +0300 | [diff] [blame] | 629 | if (!priv->dbgfs) |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 630 | return; |
| 631 | |
Tomas Winkler | 8dd266e | 2008-05-05 10:22:32 +0800 | [diff] [blame] | 632 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_eeprom); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 633 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_rx_statistics); |
| 634 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_tx_statistics); |
| 635 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_sram); |
Ester Kummer | 189a2b5 | 2008-05-15 13:54:18 +0800 | [diff] [blame] | 636 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_log_event); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 637 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_stations); |
Winkler, Tomas | d366df5 | 2008-12-02 12:14:01 -0800 | [diff] [blame] | 638 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_channels); |
Wey-Yi Guy | 08df05a | 2009-03-24 10:02:54 -0700 | [diff] [blame] | 639 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_status); |
Wey-Yi Guy | a83b914 | 2009-04-08 11:39:32 -0700 | [diff] [blame] | 640 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_interrupt); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 641 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); |
Tomas Winkler | 445c2df | 2008-05-15 13:54:16 +0800 | [diff] [blame] | 642 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); |
| 643 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); |
Emmanuel Grumbach | 203566f | 2008-06-12 09:46:54 +0800 | [diff] [blame] | 644 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_tx_power); |
Tomas Winkler | 445c2df | 2008-05-15 13:54:16 +0800 | [diff] [blame] | 645 | DEBUGFS_REMOVE(priv->dbgfs->dir_rf); |
Tomas Winkler | 712b6cf | 2008-03-12 16:58:52 -0700 | [diff] [blame] | 646 | DEBUGFS_REMOVE(priv->dbgfs->dir_drv); |
| 647 | kfree(priv->dbgfs); |
| 648 | priv->dbgfs = NULL; |
| 649 | } |
| 650 | EXPORT_SYMBOL(iwl_dbgfs_unregister); |
| 651 | |
| 652 | |
Tomas Winkler | 445c2df | 2008-05-15 13:54:16 +0800 | [diff] [blame] | 653 | |