aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00debug.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-11-27 15:48:16 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:06 -0500
commit91921a4e9b033b1bf6ab65be7f9b74b60290f41c (patch)
tree0a45c7412a979ee9090cad9c81d5ccbacb8b167e /drivers/net/wireless/rt2x00/rt2x00debug.c
parent49da2605e27935835861a118df0671b5f004bfac (diff)
rt2x00: Move register value/offset files into new folder
Cleanup debugfs interface by moving the csr/bbp/rf/eeprom value/offset entries into the "register" folder. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00debug.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 6dc9a2503562..92efc5a38d71 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -50,18 +50,20 @@ struct rt2x00debug_intf {
50 /* 50 /*
51 * Debugfs entries for: 51 * Debugfs entries for:
52 * - driver folder 52 * - driver folder
53 * - driver file 53 * - driver file
54 * - chipset file 54 * - chipset file
55 * - device flags file 55 * - device flags file
56 * - register offset/value files 56 * - register folder
57 * - eeprom offset/value files 57 * - csr offset/value files
58 * - bbp offset/value files 58 * - eeprom offset/value files
59 * - rf offset/value files 59 * - bbp offset/value files
60 * - rf offset/value files
60 */ 61 */
61 struct dentry *driver_folder; 62 struct dentry *driver_folder;
62 struct dentry *driver_entry; 63 struct dentry *driver_entry;
63 struct dentry *chipset_entry; 64 struct dentry *chipset_entry;
64 struct dentry *dev_flags; 65 struct dentry *dev_flags;
66 struct dentry *register_folder;
65 struct dentry *csr_off_entry; 67 struct dentry *csr_off_entry;
66 struct dentry *csr_val_entry; 68 struct dentry *csr_val_entry;
67 struct dentry *eeprom_off_entry; 69 struct dentry *eeprom_off_entry;
@@ -115,7 +117,7 @@ static ssize_t rt2x00debug_read_##__name(struct file *file, \
115 size_t length, \ 117 size_t length, \
116 loff_t *offset) \ 118 loff_t *offset) \
117{ \ 119{ \
118 struct rt2x00debug_intf *intf = file->private_data; \ 120 struct rt2x00debug_intf *intf = file->private_data; \
119 const struct rt2x00debug *debug = intf->debug; \ 121 const struct rt2x00debug *debug = intf->debug; \
120 char line[16]; \ 122 char line[16]; \
121 size_t size; \ 123 size_t size; \
@@ -145,7 +147,7 @@ static ssize_t rt2x00debug_write_##__name(struct file *file, \
145 size_t length, \ 147 size_t length, \
146 loff_t *offset) \ 148 loff_t *offset) \
147{ \ 149{ \
148 struct rt2x00debug_intf *intf = file->private_data; \ 150 struct rt2x00debug_intf *intf = file->private_data; \
149 const struct rt2x00debug *debug = intf->debug; \ 151 const struct rt2x00debug *debug = intf->debug; \
150 char line[16]; \ 152 char line[16]; \
151 size_t size; \ 153 size_t size; \
@@ -301,12 +303,17 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
301 if (IS_ERR(intf->dev_flags)) 303 if (IS_ERR(intf->dev_flags))
302 goto exit; 304 goto exit;
303 305
304#define RT2X00DEBUGFS_CREATE_ENTRY(__intf, __name) \ 306 intf->register_folder =
307 debugfs_create_dir("register", intf->driver_folder);
308 if (IS_ERR(intf->register_folder))
309 goto exit;
310
311#define RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(__intf, __name) \
305({ \ 312({ \
306 (__intf)->__name##_off_entry = \ 313 (__intf)->__name##_off_entry = \
307 debugfs_create_u32(__stringify(__name) "_offset", \ 314 debugfs_create_u32(__stringify(__name) "_offset", \
308 S_IRUGO | S_IWUSR, \ 315 S_IRUGO | S_IWUSR, \
309 (__intf)->driver_folder, \ 316 (__intf)->register_folder, \
310 &(__intf)->offset_##__name); \ 317 &(__intf)->offset_##__name); \
311 if (IS_ERR((__intf)->__name##_off_entry)) \ 318 if (IS_ERR((__intf)->__name##_off_entry)) \
312 goto exit; \ 319 goto exit; \
@@ -314,18 +321,18 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
314 (__intf)->__name##_val_entry = \ 321 (__intf)->__name##_val_entry = \
315 debugfs_create_file(__stringify(__name) "_value", \ 322 debugfs_create_file(__stringify(__name) "_value", \
316 S_IRUGO | S_IWUSR, \ 323 S_IRUGO | S_IWUSR, \
317 (__intf)->driver_folder, \ 324 (__intf)->register_folder, \
318 (__intf), &rt2x00debug_fop_##__name);\ 325 (__intf), &rt2x00debug_fop_##__name);\
319 if (IS_ERR((__intf)->__name##_val_entry)) \ 326 if (IS_ERR((__intf)->__name##_val_entry)) \
320 goto exit; \ 327 goto exit; \
321}) 328})
322 329
323 RT2X00DEBUGFS_CREATE_ENTRY(intf, csr); 330 RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(intf, csr);
324 RT2X00DEBUGFS_CREATE_ENTRY(intf, eeprom); 331 RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(intf, eeprom);
325 RT2X00DEBUGFS_CREATE_ENTRY(intf, bbp); 332 RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(intf, bbp);
326 RT2X00DEBUGFS_CREATE_ENTRY(intf, rf); 333 RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(intf, rf);
327 334
328#undef RT2X00DEBUGFS_CREATE_ENTRY 335#undef RT2X00DEBUGFS_CREATE_REGISTER_ENTRY
329 336
330 return; 337 return;
331 338
@@ -351,6 +358,7 @@ void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev)
351 debugfs_remove(intf->eeprom_off_entry); 358 debugfs_remove(intf->eeprom_off_entry);
352 debugfs_remove(intf->csr_val_entry); 359 debugfs_remove(intf->csr_val_entry);
353 debugfs_remove(intf->csr_off_entry); 360 debugfs_remove(intf->csr_off_entry);
361 debugfs_remove(intf->register_folder);
354 debugfs_remove(intf->dev_flags); 362 debugfs_remove(intf->dev_flags);
355 debugfs_remove(intf->chipset_entry); 363 debugfs_remove(intf->chipset_entry);
356 debugfs_remove(intf->driver_entry); 364 debugfs_remove(intf->driver_entry);