aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-01-22 17:22:54 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-25 16:36:24 -0500
commit4c84a8f1679f754d6080e49892f5cae2c88c91a8 (patch)
tree3dd28d0fe728843b2fec4f05ca53c0b0f45b6dfe /drivers/net
parent158bea07c6017fa67bc0c64815ce5c3a998083dc (diff)
iwlwifi: clean up debugfs code
The debugfs code can be made a whole lot more efficient by using debugfs_remove_recursive(), the large chunk of variables can completely go away and by moving two variables we no longer need to allocate an extra chunk of memory. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h64
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c239
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h3
3 files changed, 91 insertions, 215 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index aff1dc0756fc..1c7b53d511c7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -67,63 +67,6 @@ do { \
67 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ 67 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
68} while (0) 68} while (0)
69 69
70#ifdef CONFIG_IWLWIFI_DEBUGFS
71struct iwl_debugfs {
72 const char *name;
73 struct dentry *dir_drv;
74 struct dentry *dir_data;
75 struct dentry *dir_debug;
76 struct dentry *dir_rf;
77 struct dir_data_files {
78 struct dentry *file_sram;
79 struct dentry *file_nvm;
80 struct dentry *file_stations;
81 struct dentry *file_log_event;
82 struct dentry *file_channels;
83 struct dentry *file_status;
84 struct dentry *file_interrupt;
85 struct dentry *file_qos;
86 struct dentry *file_thermal_throttling;
87 struct dentry *file_led;
88 struct dentry *file_disable_ht40;
89 struct dentry *file_sleep_level_override;
90 struct dentry *file_current_sleep_command;
91 } dbgfs_data_files;
92 struct dir_rf_files {
93 struct dentry *file_disable_sensitivity;
94 struct dentry *file_disable_chain_noise;
95 struct dentry *file_disable_tx_power;
96 } dbgfs_rf_files;
97 struct dir_debug_files {
98 struct dentry *file_rx_statistics;
99 struct dentry *file_tx_statistics;
100 struct dentry *file_traffic_log;
101 struct dentry *file_rx_queue;
102 struct dentry *file_tx_queue;
103 struct dentry *file_ucode_rx_stats;
104 struct dentry *file_ucode_tx_stats;
105 struct dentry *file_ucode_general_stats;
106 struct dentry *file_sensitivity;
107 struct dentry *file_chain_noise;
108 struct dentry *file_tx_power;
109 struct dentry *file_power_save_status;
110 struct dentry *file_clear_ucode_statistics;
111 struct dentry *file_clear_traffic_statistics;
112 struct dentry *file_csr;
113 struct dentry *file_ucode_tracing;
114 struct dentry *file_fh_reg;
115 struct dentry *file_missed_beacon;
116 struct dentry *file_internal_scan;
117 struct dentry *file_plcp_delta;
118 } dbgfs_debug_files;
119 u32 sram_offset;
120 u32 sram_len;
121};
122
123int iwl_dbgfs_register(struct iwl_priv *priv, const char *name);
124void iwl_dbgfs_unregister(struct iwl_priv *priv);
125#endif
126
127#else 70#else
128#define IWL_DEBUG(__priv, level, fmt, args...) 71#define IWL_DEBUG(__priv, level, fmt, args...)
129#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) 72#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...)
@@ -132,9 +75,10 @@ static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
132{} 75{}
133#endif /* CONFIG_IWLWIFI_DEBUG */ 76#endif /* CONFIG_IWLWIFI_DEBUG */
134 77
135 78#ifdef CONFIG_IWLWIFI_DEBUGFS
136 79int iwl_dbgfs_register(struct iwl_priv *priv, const char *name);
137#ifndef CONFIG_IWLWIFI_DEBUGFS 80void iwl_dbgfs_unregister(struct iwl_priv *priv);
81#else
138static inline int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) 82static inline int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
139{ 83{
140 return 0; 84 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 3f9c03998491..5c8377b9ad9b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -41,43 +41,28 @@
41#include "iwl-calib.h" 41#include "iwl-calib.h"
42 42
43/* create and remove of files */ 43/* create and remove of files */
44#define DEBUGFS_ADD_DIR(name, parent) do { \ 44#define DEBUGFS_ADD_FILE(name, parent, mode) do { \
45 dbgfs->dir_##name = debugfs_create_dir(#name, parent); \ 45 if (!debugfs_create_file(#name, mode, parent, priv, \
46 if (!(dbgfs->dir_##name)) \ 46 &iwl_dbgfs_##name##_ops)) \
47 goto err; \ 47 goto err; \
48} while (0) 48} while (0)
49 49
50#define DEBUGFS_ADD_FILE(name, parent, mode) do { \ 50#define DEBUGFS_ADD_BOOL(name, parent, ptr) do { \
51 dbgfs->dbgfs_##parent##_files.file_##name = \ 51 struct dentry *__tmp; \
52 debugfs_create_file(#name, mode, \ 52 __tmp = debugfs_create_bool(#name, S_IWUSR | S_IRUSR, \
53 dbgfs->dir_##parent, priv, \ 53 parent, ptr); \
54 &iwl_dbgfs_##name##_ops); \ 54 if (IS_ERR(__tmp) || !__tmp) \
55 if (!(dbgfs->dbgfs_##parent##_files.file_##name)) \ 55 goto err; \
56 goto err; \
57} while (0) 56} while (0)
58 57
59#define DEBUGFS_ADD_BOOL(name, parent, ptr) do { \ 58#define DEBUGFS_ADD_X32(name, parent, ptr) do { \
60 dbgfs->dbgfs_##parent##_files.file_##name = \ 59 struct dentry *__tmp; \
61 debugfs_create_bool(#name, S_IWUSR | S_IRUSR, \ 60 __tmp = debugfs_create_x32(#name, S_IWUSR | S_IRUSR, \
62 dbgfs->dir_##parent, ptr); \ 61 parent, ptr); \
63 if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name) \ 62 if (IS_ERR(__tmp) || !__tmp) \
64 || !dbgfs->dbgfs_##parent##_files.file_##name) \ 63 goto err; \
65 goto err; \
66} while (0) 64} while (0)
67 65
68#define DEBUGFS_ADD_X32(name, parent, ptr) do { \
69 dbgfs->dbgfs_##parent##_files.file_##name = \
70 debugfs_create_x32(#name, S_IRUSR, dbgfs->dir_##parent, ptr); \
71 if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name) \
72 || !dbgfs->dbgfs_##parent##_files.file_##name) \
73 goto err; \
74} while (0)
75
76#define DEBUGFS_REMOVE(name) do { \
77 debugfs_remove(name); \
78 name = NULL; \
79} while (0);
80
81/* file operation */ 66/* file operation */
82#define DEBUGFS_READ_FUNC(name) \ 67#define DEBUGFS_READ_FUNC(name) \
83static ssize_t iwl_dbgfs_##name##_read(struct file *file, \ 68static ssize_t iwl_dbgfs_##name##_read(struct file *file, \
@@ -236,24 +221,24 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
236 size_t bufsz; 221 size_t bufsz;
237 222
238 /* default is to dump the entire data segment */ 223 /* default is to dump the entire data segment */
239 if (!priv->dbgfs->sram_offset && !priv->dbgfs->sram_len) { 224 if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
240 priv->dbgfs->sram_offset = 0x800000; 225 priv->dbgfs_sram_offset = 0x800000;
241 if (priv->ucode_type == UCODE_INIT) 226 if (priv->ucode_type == UCODE_INIT)
242 priv->dbgfs->sram_len = priv->ucode_init_data.len; 227 priv->dbgfs_sram_len = priv->ucode_init_data.len;
243 else 228 else
244 priv->dbgfs->sram_len = priv->ucode_data.len; 229 priv->dbgfs_sram_len = priv->ucode_data.len;
245 } 230 }
246 bufsz = 30 + priv->dbgfs->sram_len * sizeof(char) * 10; 231 bufsz = 30 + priv->dbgfs_sram_len * sizeof(char) * 10;
247 buf = kmalloc(bufsz, GFP_KERNEL); 232 buf = kmalloc(bufsz, GFP_KERNEL);
248 if (!buf) 233 if (!buf)
249 return -ENOMEM; 234 return -ENOMEM;
250 pos += scnprintf(buf + pos, bufsz - pos, "sram_len: 0x%x\n", 235 pos += scnprintf(buf + pos, bufsz - pos, "sram_len: 0x%x\n",
251 priv->dbgfs->sram_len); 236 priv->dbgfs_sram_len);
252 pos += scnprintf(buf + pos, bufsz - pos, "sram_offset: 0x%x\n", 237 pos += scnprintf(buf + pos, bufsz - pos, "sram_offset: 0x%x\n",
253 priv->dbgfs->sram_offset); 238 priv->dbgfs_sram_offset);
254 for (i = priv->dbgfs->sram_len; i > 0; i -= 4) { 239 for (i = priv->dbgfs_sram_len; i > 0; i -= 4) {
255 val = iwl_read_targ_mem(priv, priv->dbgfs->sram_offset + \ 240 val = iwl_read_targ_mem(priv, priv->dbgfs_sram_offset + \
256 priv->dbgfs->sram_len - i); 241 priv->dbgfs_sram_len - i);
257 if (i < 4) { 242 if (i < 4) {
258 switch (i) { 243 switch (i) {
259 case 1: 244 case 1:
@@ -293,11 +278,11 @@ static ssize_t iwl_dbgfs_sram_write(struct file *file,
293 return -EFAULT; 278 return -EFAULT;
294 279
295 if (sscanf(buf, "%x,%x", &offset, &len) == 2) { 280 if (sscanf(buf, "%x,%x", &offset, &len) == 2) {
296 priv->dbgfs->sram_offset = offset; 281 priv->dbgfs_sram_offset = offset;
297 priv->dbgfs->sram_len = len; 282 priv->dbgfs_sram_len = len;
298 } else { 283 } else {
299 priv->dbgfs->sram_offset = 0; 284 priv->dbgfs_sram_offset = 0;
300 priv->dbgfs->sram_len = 0; 285 priv->dbgfs_sram_len = 0;
301 } 286 }
302 287
303 return count; 288 return count;
@@ -2263,75 +2248,73 @@ DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta);
2263 */ 2248 */
2264int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) 2249int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
2265{ 2250{
2266 struct iwl_debugfs *dbgfs;
2267 struct dentry *phyd = priv->hw->wiphy->debugfsdir; 2251 struct dentry *phyd = priv->hw->wiphy->debugfsdir;
2268 int ret = 0; 2252 struct dentry *dir_drv, *dir_data, *dir_rf, *dir_debug;
2269 2253
2270 dbgfs = kzalloc(sizeof(struct iwl_debugfs), GFP_KERNEL); 2254 dir_drv = debugfs_create_dir(name, phyd);
2271 if (!dbgfs) { 2255 if (!dir_drv)
2272 ret = -ENOMEM; 2256 return -ENOMEM;
2273 goto err;
2274 }
2275 2257
2276 priv->dbgfs = dbgfs; 2258 priv->debugfs_dir = dir_drv;
2277 dbgfs->name = name; 2259
2278 dbgfs->dir_drv = debugfs_create_dir(name, phyd); 2260 dir_data = debugfs_create_dir("data", dir_drv);
2279 if (!dbgfs->dir_drv || IS_ERR(dbgfs->dir_drv)) { 2261 if (!dir_data)
2280 ret = -ENOENT; 2262 goto err;
2263 dir_rf = debugfs_create_dir("rf", dir_drv);
2264 if (!dir_rf)
2265 goto err;
2266 dir_debug = debugfs_create_dir("debug", dir_drv);
2267 if (!dir_debug)
2281 goto err; 2268 goto err;
2282 }
2283 2269
2284 DEBUGFS_ADD_DIR(data, dbgfs->dir_drv); 2270 DEBUGFS_ADD_FILE(nvm, dir_data, S_IRUSR);
2285 DEBUGFS_ADD_DIR(rf, dbgfs->dir_drv); 2271 DEBUGFS_ADD_FILE(sram, dir_data, S_IWUSR | S_IRUSR);
2286 DEBUGFS_ADD_DIR(debug, dbgfs->dir_drv); 2272 DEBUGFS_ADD_FILE(log_event, dir_data, S_IWUSR | S_IRUSR);
2287 DEBUGFS_ADD_FILE(nvm, data, S_IRUSR); 2273 DEBUGFS_ADD_FILE(stations, dir_data, S_IRUSR);
2288 DEBUGFS_ADD_FILE(sram, data, S_IWUSR | S_IRUSR); 2274 DEBUGFS_ADD_FILE(channels, dir_data, S_IRUSR);
2289 DEBUGFS_ADD_FILE(log_event, data, S_IWUSR | S_IRUSR); 2275 DEBUGFS_ADD_FILE(status, dir_data, S_IRUSR);
2290 DEBUGFS_ADD_FILE(stations, data, S_IRUSR); 2276 DEBUGFS_ADD_FILE(interrupt, dir_data, S_IWUSR | S_IRUSR);
2291 DEBUGFS_ADD_FILE(channels, data, S_IRUSR); 2277 DEBUGFS_ADD_FILE(qos, dir_data, S_IRUSR);
2292 DEBUGFS_ADD_FILE(status, data, S_IRUSR); 2278 DEBUGFS_ADD_FILE(led, dir_data, S_IRUSR);
2293 DEBUGFS_ADD_FILE(interrupt, data, S_IWUSR | S_IRUSR); 2279 DEBUGFS_ADD_FILE(sleep_level_override, dir_data, S_IWUSR | S_IRUSR);
2294 DEBUGFS_ADD_FILE(qos, data, S_IRUSR); 2280 DEBUGFS_ADD_FILE(current_sleep_command, dir_data, S_IRUSR);
2295 DEBUGFS_ADD_FILE(led, data, S_IRUSR); 2281 DEBUGFS_ADD_FILE(thermal_throttling, dir_data, S_IRUSR);
2296 DEBUGFS_ADD_FILE(sleep_level_override, data, S_IWUSR | S_IRUSR); 2282 DEBUGFS_ADD_FILE(disable_ht40, dir_data, S_IWUSR | S_IRUSR);
2297 DEBUGFS_ADD_FILE(current_sleep_command, data, S_IRUSR); 2283 DEBUGFS_ADD_FILE(rx_statistics, dir_debug, S_IRUSR);
2298 DEBUGFS_ADD_FILE(thermal_throttling, data, S_IRUSR); 2284 DEBUGFS_ADD_FILE(tx_statistics, dir_debug, S_IRUSR);
2299 DEBUGFS_ADD_FILE(disable_ht40, data, S_IWUSR | S_IRUSR); 2285 DEBUGFS_ADD_FILE(traffic_log, dir_debug, S_IWUSR | S_IRUSR);
2300 DEBUGFS_ADD_FILE(rx_statistics, debug, S_IRUSR); 2286 DEBUGFS_ADD_FILE(rx_queue, dir_debug, S_IRUSR);
2301 DEBUGFS_ADD_FILE(tx_statistics, debug, S_IRUSR); 2287 DEBUGFS_ADD_FILE(tx_queue, dir_debug, S_IRUSR);
2302 DEBUGFS_ADD_FILE(traffic_log, debug, S_IWUSR | S_IRUSR); 2288 DEBUGFS_ADD_FILE(tx_power, dir_debug, S_IRUSR);
2303 DEBUGFS_ADD_FILE(rx_queue, debug, S_IRUSR); 2289 DEBUGFS_ADD_FILE(power_save_status, dir_debug, S_IRUSR);
2304 DEBUGFS_ADD_FILE(tx_queue, debug, S_IRUSR); 2290 DEBUGFS_ADD_FILE(clear_ucode_statistics, dir_debug, S_IWUSR);
2305 DEBUGFS_ADD_FILE(tx_power, debug, S_IRUSR); 2291 DEBUGFS_ADD_FILE(clear_traffic_statistics, dir_debug, S_IWUSR);
2306 DEBUGFS_ADD_FILE(power_save_status, debug, S_IRUSR); 2292 DEBUGFS_ADD_FILE(csr, dir_debug, S_IWUSR);
2307 DEBUGFS_ADD_FILE(clear_ucode_statistics, debug, S_IWUSR); 2293 DEBUGFS_ADD_FILE(fh_reg, dir_debug, S_IRUSR);
2308 DEBUGFS_ADD_FILE(clear_traffic_statistics, debug, S_IWUSR); 2294 DEBUGFS_ADD_FILE(missed_beacon, dir_debug, S_IWUSR);
2309 DEBUGFS_ADD_FILE(csr, debug, S_IWUSR); 2295 DEBUGFS_ADD_FILE(internal_scan, dir_debug, S_IWUSR);
2310 DEBUGFS_ADD_FILE(fh_reg, debug, S_IRUSR); 2296 DEBUGFS_ADD_FILE(plcp_delta, dir_debug, S_IWUSR | S_IRUSR);
2311 DEBUGFS_ADD_FILE(missed_beacon, debug, S_IWUSR);
2312 DEBUGFS_ADD_FILE(internal_scan, debug, S_IWUSR);
2313 DEBUGFS_ADD_FILE(plcp_delta, debug, S_IWUSR | S_IRUSR);
2314 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { 2297 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) {
2315 DEBUGFS_ADD_FILE(ucode_rx_stats, debug, S_IRUSR); 2298 DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR);
2316 DEBUGFS_ADD_FILE(ucode_tx_stats, debug, S_IRUSR); 2299 DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR);
2317 DEBUGFS_ADD_FILE(ucode_general_stats, debug, S_IRUSR); 2300 DEBUGFS_ADD_FILE(ucode_general_stats, dir_debug, S_IRUSR);
2318 DEBUGFS_ADD_FILE(sensitivity, debug, S_IRUSR); 2301 DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR);
2319 DEBUGFS_ADD_FILE(chain_noise, debug, S_IRUSR); 2302 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR);
2320 DEBUGFS_ADD_FILE(ucode_tracing, debug, S_IWUSR | S_IRUSR); 2303 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR);
2321 } 2304 }
2322 DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); 2305 DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, &priv->disable_sens_cal);
2323 DEBUGFS_ADD_BOOL(disable_chain_noise, rf, 2306 DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf,
2324 &priv->disable_chain_noise_cal); 2307 &priv->disable_chain_noise_cal);
2325 if (((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) || 2308 if (((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) ||
2326 ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_3945)) 2309 ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_3945))
2327 DEBUGFS_ADD_BOOL(disable_tx_power, rf, 2310 DEBUGFS_ADD_BOOL(disable_tx_power, dir_rf,
2328 &priv->disable_tx_power_cal); 2311 &priv->disable_tx_power_cal);
2329 return 0; 2312 return 0;
2330 2313
2331err: 2314err:
2332 IWL_ERR(priv, "Can't open the debugfs directory\n"); 2315 IWL_ERR(priv, "Can't create the debugfs directory\n");
2333 iwl_dbgfs_unregister(priv); 2316 iwl_dbgfs_unregister(priv);
2334 return ret; 2317 return -ENOMEM;
2335} 2318}
2336EXPORT_SYMBOL(iwl_dbgfs_register); 2319EXPORT_SYMBOL(iwl_dbgfs_register);
2337 2320
@@ -2341,63 +2324,11 @@ EXPORT_SYMBOL(iwl_dbgfs_register);
2341 */ 2324 */
2342void iwl_dbgfs_unregister(struct iwl_priv *priv) 2325void iwl_dbgfs_unregister(struct iwl_priv *priv)
2343{ 2326{
2344 if (!priv->dbgfs) 2327 if (!priv->debugfs_dir)
2345 return; 2328 return;
2346 2329
2347 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_sleep_level_override); 2330 debugfs_remove_recursive(priv->debugfs_dir);
2348 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_current_sleep_command); 2331 priv->debugfs_dir = NULL;
2349 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_nvm);
2350 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_sram);
2351 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_log_event);
2352 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_stations);
2353 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_channels);
2354 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_status);
2355 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_interrupt);
2356 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_qos);
2357 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led);
2358 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling);
2359 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_disable_ht40);
2360 DEBUGFS_REMOVE(priv->dbgfs->dir_data);
2361 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_rx_statistics);
2362 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_tx_statistics);
2363 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_traffic_log);
2364 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_rx_queue);
2365 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_tx_queue);
2366 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_tx_power);
2367 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_power_save_status);
2368 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
2369 file_clear_ucode_statistics);
2370 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
2371 file_clear_traffic_statistics);
2372 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_csr);
2373 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_fh_reg);
2374 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_missed_beacon);
2375 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_internal_scan);
2376 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_plcp_delta);
2377 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) {
2378 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
2379 file_ucode_rx_stats);
2380 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
2381 file_ucode_tx_stats);
2382 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
2383 file_ucode_general_stats);
2384 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
2385 file_sensitivity);
2386 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
2387 file_chain_noise);
2388 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
2389 file_ucode_tracing);
2390 }
2391 DEBUGFS_REMOVE(priv->dbgfs->dir_debug);
2392 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity);
2393 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise);
2394 if (((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) ||
2395 ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_3945))
2396 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_tx_power);
2397 DEBUGFS_REMOVE(priv->dbgfs->dir_rf);
2398 DEBUGFS_REMOVE(priv->dbgfs->dir_drv);
2399 kfree(priv->dbgfs);
2400 priv->dbgfs = NULL;
2401} 2332}
2402EXPORT_SYMBOL(iwl_dbgfs_unregister); 2333EXPORT_SYMBOL(iwl_dbgfs_unregister);
2403 2334
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index a1f3ecb69ed0..d9f325bd4b69 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1309,7 +1309,8 @@ struct iwl_priv {
1309 u16 rx_traffic_idx; 1309 u16 rx_traffic_idx;
1310 u8 *tx_traffic; 1310 u8 *tx_traffic;
1311 u8 *rx_traffic; 1311 u8 *rx_traffic;
1312 struct iwl_debugfs *dbgfs; 1312 struct dentry *debugfs_dir;
1313 u32 dbgfs_sram_offset, dbgfs_sram_len;
1313#endif /* CONFIG_IWLWIFI_DEBUGFS */ 1314#endif /* CONFIG_IWLWIFI_DEBUGFS */
1314#endif /* CONFIG_IWLWIFI_DEBUG */ 1315#endif /* CONFIG_IWLWIFI_DEBUG */
1315 1316