blob: acf33e265f9c57c42cbbe5b44c0f7bcc7e0d93df [file] [log] [blame]
Sven Eckelmann9cfc7bd2012-05-12 02:09:43 +02001/* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00002 *
3 * Marek Lindner
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public
7 * License as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000018 */
19
20#include "main.h"
21
22#include <linux/debugfs.h>
23
24#include "bat_debugfs.h"
25#include "translation-table.h"
26#include "originator.h"
27#include "hard-interface.h"
28#include "gateway_common.h"
29#include "gateway_client.h"
30#include "soft-interface.h"
31#include "vis.h"
32#include "icmp_socket.h"
Simon Wunderlich9bf8e4d2012-01-22 20:00:21 +010033#include "bridge_loop_avoidance.h"
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000034
Sven Eckelmann9e466252012-05-12 18:33:50 +020035static struct dentry *batadv_debugfs;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000036
37#ifdef CONFIG_BATMAN_ADV_DEBUG
Sven Eckelmann347c80f2012-06-03 22:19:07 +020038#define BATADV_LOG_BUFF_MASK (batadv_log_buff_len - 1)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000039
Sven Eckelmanna8a0a622012-06-05 22:31:32 +020040static const int batadv_log_buff_len = BATADV_LOG_BUF_LEN;
41
42static char *batadv_log_char_addr(struct batadv_debug_log *debug_log,
43 size_t idx)
44{
45 return &debug_log->log_buff[idx & BATADV_LOG_BUFF_MASK];
46}
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000047
Sven Eckelmann56303d32012-06-05 22:31:31 +020048static void batadv_emit_log_char(struct batadv_debug_log *debug_log, char c)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000049{
Sven Eckelmanna8a0a622012-06-05 22:31:32 +020050 char *char_addr;
51
52 char_addr = batadv_log_char_addr(debug_log, debug_log->log_end);
53 *char_addr = c;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000054 debug_log->log_end++;
55
Sven Eckelmann9e466252012-05-12 18:33:50 +020056 if (debug_log->log_end - debug_log->log_start > batadv_log_buff_len)
57 debug_log->log_start = debug_log->log_end - batadv_log_buff_len;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000058}
59
Sven Eckelmannd3a547b2011-05-14 23:14:46 +020060__printf(2, 3)
Sven Eckelmann56303d32012-06-05 22:31:31 +020061static int batadv_fdebug_log(struct batadv_debug_log *debug_log,
62 const char *fmt, ...)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000063{
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000064 va_list args;
65 static char debug_log_buf[256];
66 char *p;
67
68 if (!debug_log)
69 return 0;
70
71 spin_lock_bh(&debug_log->lock);
72 va_start(args, fmt);
Sven Eckelmann1299bda2011-01-27 13:48:54 +010073 vscnprintf(debug_log_buf, sizeof(debug_log_buf), fmt, args);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000074 va_end(args);
75
76 for (p = debug_log_buf; *p != 0; p++)
Sven Eckelmann9e466252012-05-12 18:33:50 +020077 batadv_emit_log_char(debug_log, *p);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000078
79 spin_unlock_bh(&debug_log->lock);
80
81 wake_up(&debug_log->queue_wait);
82
83 return 0;
84}
85
Sven Eckelmann56303d32012-06-05 22:31:31 +020086int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000087{
88 va_list args;
89 char tmp_log_buf[256];
90
91 va_start(args, fmt);
92 vscnprintf(tmp_log_buf, sizeof(tmp_log_buf), fmt, args);
Sven Eckelmann9e466252012-05-12 18:33:50 +020093 batadv_fdebug_log(bat_priv->debug_log, "[%10u] %s",
94 jiffies_to_msecs(jiffies), tmp_log_buf);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000095 va_end(args);
96
97 return 0;
98}
99
Sven Eckelmann9e466252012-05-12 18:33:50 +0200100static int batadv_log_open(struct inode *inode, struct file *file)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000101{
102 nonseekable_open(inode, file);
103 file->private_data = inode->i_private;
Sven Eckelmann3193e8f2012-05-12 02:09:42 +0200104 batadv_inc_module_count();
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000105 return 0;
106}
107
Sven Eckelmann9e466252012-05-12 18:33:50 +0200108static int batadv_log_release(struct inode *inode, struct file *file)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000109{
Sven Eckelmann3193e8f2012-05-12 02:09:42 +0200110 batadv_dec_module_count();
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000111 return 0;
112}
113
Sven Eckelmann9e466252012-05-12 18:33:50 +0200114static ssize_t batadv_log_read(struct file *file, char __user *buf,
115 size_t count, loff_t *ppos)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000116{
Sven Eckelmann56303d32012-06-05 22:31:31 +0200117 struct batadv_priv *bat_priv = file->private_data;
118 struct batadv_debug_log *debug_log = bat_priv->debug_log;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000119 int error, i = 0;
Sven Eckelmanna8a0a622012-06-05 22:31:32 +0200120 char *char_addr;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000121 char c;
122
123 if ((file->f_flags & O_NONBLOCK) &&
124 !(debug_log->log_end - debug_log->log_start))
125 return -EAGAIN;
126
Sven Eckelmann16f14b42011-05-14 23:14:48 +0200127 if (!buf)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000128 return -EINVAL;
129
130 if (count == 0)
131 return 0;
132
133 if (!access_ok(VERIFY_WRITE, buf, count))
134 return -EFAULT;
135
136 error = wait_event_interruptible(debug_log->queue_wait,
137 (debug_log->log_start - debug_log->log_end));
138
139 if (error)
140 return error;
141
142 spin_lock_bh(&debug_log->lock);
143
144 while ((!error) && (i < count) &&
145 (debug_log->log_start != debug_log->log_end)) {
Sven Eckelmanna8a0a622012-06-05 22:31:32 +0200146 char_addr = batadv_log_char_addr(debug_log,
147 debug_log->log_start);
148 c = *char_addr;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000149
150 debug_log->log_start++;
151
152 spin_unlock_bh(&debug_log->lock);
153
154 error = __put_user(c, buf);
155
156 spin_lock_bh(&debug_log->lock);
157
158 buf++;
159 i++;
160
161 }
162
163 spin_unlock_bh(&debug_log->lock);
164
165 if (!error)
166 return i;
167
168 return error;
169}
170
Sven Eckelmann9e466252012-05-12 18:33:50 +0200171static unsigned int batadv_log_poll(struct file *file, poll_table *wait)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000172{
Sven Eckelmann56303d32012-06-05 22:31:31 +0200173 struct batadv_priv *bat_priv = file->private_data;
174 struct batadv_debug_log *debug_log = bat_priv->debug_log;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000175
176 poll_wait(file, &debug_log->queue_wait, wait);
177
178 if (debug_log->log_end - debug_log->log_start)
179 return POLLIN | POLLRDNORM;
180
181 return 0;
182}
183
Sven Eckelmann9e466252012-05-12 18:33:50 +0200184static const struct file_operations batadv_log_fops = {
185 .open = batadv_log_open,
186 .release = batadv_log_release,
187 .read = batadv_log_read,
188 .poll = batadv_log_poll,
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000189 .llseek = no_llseek,
190};
191
Sven Eckelmann56303d32012-06-05 22:31:31 +0200192static int batadv_debug_log_setup(struct batadv_priv *bat_priv)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000193{
194 struct dentry *d;
195
196 if (!bat_priv->debug_dir)
197 goto err;
198
Sven Eckelmann704509b2011-05-14 23:14:54 +0200199 bat_priv->debug_log = kzalloc(sizeof(*bat_priv->debug_log), GFP_ATOMIC);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000200 if (!bat_priv->debug_log)
201 goto err;
202
203 spin_lock_init(&bat_priv->debug_log->lock);
204 init_waitqueue_head(&bat_priv->debug_log->queue_wait);
205
206 d = debugfs_create_file("log", S_IFREG | S_IRUSR,
Sven Eckelmann9e466252012-05-12 18:33:50 +0200207 bat_priv->debug_dir, bat_priv,
208 &batadv_log_fops);
Sven Eckelmann5346c352012-05-05 13:27:28 +0200209 if (!d)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000210 goto err;
211
212 return 0;
213
214err:
Sven Eckelmann5346c352012-05-05 13:27:28 +0200215 return -ENOMEM;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000216}
217
Sven Eckelmann56303d32012-06-05 22:31:31 +0200218static void batadv_debug_log_cleanup(struct batadv_priv *bat_priv)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000219{
220 kfree(bat_priv->debug_log);
221 bat_priv->debug_log = NULL;
222}
223#else /* CONFIG_BATMAN_ADV_DEBUG */
Sven Eckelmann56303d32012-06-05 22:31:31 +0200224static int batadv_debug_log_setup(struct batadv_priv *bat_priv)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000225{
226 bat_priv->debug_log = NULL;
227 return 0;
228}
229
Sven Eckelmann56303d32012-06-05 22:31:31 +0200230static void batadv_debug_log_cleanup(struct batadv_priv *bat_priv)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000231{
232 return;
233}
234#endif
235
Sven Eckelmann9e466252012-05-12 18:33:50 +0200236static int batadv_algorithms_open(struct inode *inode, struct file *file)
Marek Lindner1c280472011-11-28 17:40:17 +0800237{
Sven Eckelmann3193e8f2012-05-12 02:09:42 +0200238 return single_open(file, batadv_algo_seq_print_text, NULL);
Marek Lindner1c280472011-11-28 17:40:17 +0800239}
240
Sven Eckelmann9e466252012-05-12 18:33:50 +0200241static int batadv_originators_open(struct inode *inode, struct file *file)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000242{
243 struct net_device *net_dev = (struct net_device *)inode->i_private;
Sven Eckelmann7d211ef2012-05-12 02:09:34 +0200244 return single_open(file, batadv_orig_seq_print_text, net_dev);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000245}
246
Sven Eckelmann9e466252012-05-12 18:33:50 +0200247static int batadv_gateways_open(struct inode *inode, struct file *file)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000248{
249 struct net_device *net_dev = (struct net_device *)inode->i_private;
Sven Eckelmann7cf06bc2012-05-12 02:09:29 +0200250 return single_open(file, batadv_gw_client_seq_print_text, net_dev);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000251}
252
Sven Eckelmann9e466252012-05-12 18:33:50 +0200253static int batadv_transtable_global_open(struct inode *inode, struct file *file)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000254{
255 struct net_device *net_dev = (struct net_device *)inode->i_private;
Sven Eckelmann08c36d32012-05-12 02:09:39 +0200256 return single_open(file, batadv_tt_global_seq_print_text, net_dev);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000257}
258
Simon Wunderlich7a5cc242012-01-22 20:00:27 +0100259#ifdef CONFIG_BATMAN_ADV_BLA
Sven Eckelmann9e466252012-05-12 18:33:50 +0200260static int batadv_bla_claim_table_open(struct inode *inode, struct file *file)
Simon Wunderlich9bf8e4d2012-01-22 20:00:21 +0100261{
262 struct net_device *net_dev = (struct net_device *)inode->i_private;
Sven Eckelmann08adf152012-05-12 13:38:47 +0200263 return single_open(file, batadv_bla_claim_table_seq_print_text,
264 net_dev);
Simon Wunderlich9bf8e4d2012-01-22 20:00:21 +0100265}
Simon Wunderlich7a5cc242012-01-22 20:00:27 +0100266#endif
Simon Wunderlich9bf8e4d2012-01-22 20:00:21 +0100267
Sven Eckelmann9e466252012-05-12 18:33:50 +0200268static int batadv_transtable_local_open(struct inode *inode, struct file *file)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000269{
270 struct net_device *net_dev = (struct net_device *)inode->i_private;
Sven Eckelmann08c36d32012-05-12 02:09:39 +0200271 return single_open(file, batadv_tt_local_seq_print_text, net_dev);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000272}
273
Sven Eckelmann9e466252012-05-12 18:33:50 +0200274static int batadv_vis_data_open(struct inode *inode, struct file *file)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000275{
276 struct net_device *net_dev = (struct net_device *)inode->i_private;
Sven Eckelmannd0f714f2012-05-12 02:09:41 +0200277 return single_open(file, batadv_vis_seq_print_text, net_dev);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000278}
279
Sven Eckelmann7f223c02012-06-05 22:31:27 +0200280struct batadv_debuginfo {
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000281 struct attribute attr;
282 const struct file_operations fops;
283};
284
Sven Eckelmann347c80f2012-06-03 22:19:07 +0200285#define BATADV_DEBUGINFO(_name, _mode, _open) \
Sven Eckelmann7f223c02012-06-05 22:31:27 +0200286struct batadv_debuginfo batadv_debuginfo_##_name = { \
Sven Eckelmann9e466252012-05-12 18:33:50 +0200287 .attr = { .name = __stringify(_name), \
288 .mode = _mode, }, \
289 .fops = { .owner = THIS_MODULE, \
290 .open = _open, \
291 .read = seq_read, \
292 .llseek = seq_lseek, \
293 .release = single_release, \
294 } \
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000295};
296
Sven Eckelmann347c80f2012-06-03 22:19:07 +0200297static BATADV_DEBUGINFO(routing_algos, S_IRUGO, batadv_algorithms_open);
298static BATADV_DEBUGINFO(originators, S_IRUGO, batadv_originators_open);
299static BATADV_DEBUGINFO(gateways, S_IRUGO, batadv_gateways_open);
300static BATADV_DEBUGINFO(transtable_global, S_IRUGO,
301 batadv_transtable_global_open);
Simon Wunderlich7a5cc242012-01-22 20:00:27 +0100302#ifdef CONFIG_BATMAN_ADV_BLA
Sven Eckelmann347c80f2012-06-03 22:19:07 +0200303static BATADV_DEBUGINFO(bla_claim_table, S_IRUGO, batadv_bla_claim_table_open);
Simon Wunderlich7a5cc242012-01-22 20:00:27 +0100304#endif
Sven Eckelmann347c80f2012-06-03 22:19:07 +0200305static BATADV_DEBUGINFO(transtable_local, S_IRUGO,
306 batadv_transtable_local_open);
307static BATADV_DEBUGINFO(vis_data, S_IRUGO, batadv_vis_data_open);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000308
Sven Eckelmann7f223c02012-06-05 22:31:27 +0200309static struct batadv_debuginfo *batadv_mesh_debuginfos[] = {
Sven Eckelmann9e466252012-05-12 18:33:50 +0200310 &batadv_debuginfo_originators,
311 &batadv_debuginfo_gateways,
312 &batadv_debuginfo_transtable_global,
Simon Wunderlich7a5cc242012-01-22 20:00:27 +0100313#ifdef CONFIG_BATMAN_ADV_BLA
Sven Eckelmann9e466252012-05-12 18:33:50 +0200314 &batadv_debuginfo_bla_claim_table,
Simon Wunderlich7a5cc242012-01-22 20:00:27 +0100315#endif
Sven Eckelmann9e466252012-05-12 18:33:50 +0200316 &batadv_debuginfo_transtable_local,
317 &batadv_debuginfo_vis_data,
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000318 NULL,
319};
320
Sven Eckelmann40a072d2012-05-12 02:09:23 +0200321void batadv_debugfs_init(void)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000322{
Sven Eckelmann7f223c02012-06-05 22:31:27 +0200323 struct batadv_debuginfo *bat_debug;
Marek Lindner1c280472011-11-28 17:40:17 +0800324 struct dentry *file;
325
Sven Eckelmann54590e42012-06-03 22:19:08 +0200326 batadv_debugfs = debugfs_create_dir(BATADV_DEBUGFS_SUBDIR, NULL);
Sven Eckelmann9e466252012-05-12 18:33:50 +0200327 if (batadv_debugfs == ERR_PTR(-ENODEV))
328 batadv_debugfs = NULL;
Marek Lindner1c280472011-11-28 17:40:17 +0800329
Sven Eckelmann9e466252012-05-12 18:33:50 +0200330 if (!batadv_debugfs)
Marek Lindner1c280472011-11-28 17:40:17 +0800331 goto out;
332
Sven Eckelmann9e466252012-05-12 18:33:50 +0200333 bat_debug = &batadv_debuginfo_routing_algos;
Marek Lindner1c280472011-11-28 17:40:17 +0800334 file = debugfs_create_file(bat_debug->attr.name,
335 S_IFREG | bat_debug->attr.mode,
Sven Eckelmann9e466252012-05-12 18:33:50 +0200336 batadv_debugfs, NULL, &bat_debug->fops);
Marek Lindner1c280472011-11-28 17:40:17 +0800337 if (!file)
338 pr_err("Can't add debugfs file: %s\n", bat_debug->attr.name);
339
340out:
341 return;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000342}
343
Sven Eckelmann40a072d2012-05-12 02:09:23 +0200344void batadv_debugfs_destroy(void)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000345{
Sven Eckelmann9e466252012-05-12 18:33:50 +0200346 if (batadv_debugfs) {
347 debugfs_remove_recursive(batadv_debugfs);
348 batadv_debugfs = NULL;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000349 }
350}
351
Sven Eckelmann40a072d2012-05-12 02:09:23 +0200352int batadv_debugfs_add_meshif(struct net_device *dev)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000353{
Sven Eckelmann56303d32012-06-05 22:31:31 +0200354 struct batadv_priv *bat_priv = netdev_priv(dev);
Sven Eckelmann7f223c02012-06-05 22:31:27 +0200355 struct batadv_debuginfo **bat_debug;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000356 struct dentry *file;
357
Sven Eckelmann9e466252012-05-12 18:33:50 +0200358 if (!batadv_debugfs)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000359 goto out;
360
Sven Eckelmann9e466252012-05-12 18:33:50 +0200361 bat_priv->debug_dir = debugfs_create_dir(dev->name, batadv_debugfs);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000362 if (!bat_priv->debug_dir)
363 goto out;
364
Sven Eckelmann9039dc72012-05-12 02:09:33 +0200365 if (batadv_socket_setup(bat_priv) < 0)
Sven Eckelmann5346c352012-05-05 13:27:28 +0200366 goto rem_attr;
367
Sven Eckelmann9e466252012-05-12 18:33:50 +0200368 if (batadv_debug_log_setup(bat_priv) < 0)
Sven Eckelmann5346c352012-05-05 13:27:28 +0200369 goto rem_attr;
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000370
Sven Eckelmann9e466252012-05-12 18:33:50 +0200371 for (bat_debug = batadv_mesh_debuginfos; *bat_debug; ++bat_debug) {
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000372 file = debugfs_create_file(((*bat_debug)->attr).name,
373 S_IFREG | ((*bat_debug)->attr).mode,
374 bat_priv->debug_dir,
375 dev, &(*bat_debug)->fops);
376 if (!file) {
Sven Eckelmann3e348192012-05-16 20:23:22 +0200377 batadv_err(dev, "Can't add debugfs file: %s/%s\n",
378 dev->name, ((*bat_debug)->attr).name);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000379 goto rem_attr;
380 }
381 }
382
383 return 0;
384rem_attr:
385 debugfs_remove_recursive(bat_priv->debug_dir);
386 bat_priv->debug_dir = NULL;
387out:
388#ifdef CONFIG_DEBUG_FS
389 return -ENOMEM;
390#else
391 return 0;
392#endif /* CONFIG_DEBUG_FS */
393}
394
Sven Eckelmann40a072d2012-05-12 02:09:23 +0200395void batadv_debugfs_del_meshif(struct net_device *dev)
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000396{
Sven Eckelmann56303d32012-06-05 22:31:31 +0200397 struct batadv_priv *bat_priv = netdev_priv(dev);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000398
Sven Eckelmann9e466252012-05-12 18:33:50 +0200399 batadv_debug_log_cleanup(bat_priv);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000400
Sven Eckelmann9e466252012-05-12 18:33:50 +0200401 if (batadv_debugfs) {
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +0000402 debugfs_remove_recursive(bat_priv->debug_dir);
403 bat_priv->debug_dir = NULL;
404 }
405}