diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2014-05-11 04:04:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-05-13 15:56:38 -0400 |
commit | 29bf801e04514929aeec768d237c62ae37564041 (patch) | |
tree | 4a5a8fdff64b4148c085ad80698606cf0d107f76 /drivers/net/wireless/ath/ath9k/common-debug.c | |
parent | 7e9bed7125760748648be539240d1191227b7bb7 (diff) |
ath9k: move base_eeprom debug code to ath9k_cmn_debug_base_eeprom
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/common-debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common-debug.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common-debug.c b/drivers/net/wireless/ath/ath9k/common-debug.c index da5efdbe4910..f2234e06a0ad 100644 --- a/drivers/net/wireless/ath/ath9k/common-debug.c +++ b/drivers/net/wireless/ath/ath9k/common-debug.c | |||
@@ -51,3 +51,38 @@ void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy, | |||
51 | &fops_modal_eeprom); | 51 | &fops_modal_eeprom); |
52 | } | 52 | } |
53 | EXPORT_SYMBOL(ath9k_cmn_debug_modal_eeprom); | 53 | EXPORT_SYMBOL(ath9k_cmn_debug_modal_eeprom); |
54 | |||
55 | static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf, | ||
56 | size_t count, loff_t *ppos) | ||
57 | { | ||
58 | struct ath_hw *ah = file->private_data; | ||
59 | u32 len = 0, size = 1500; | ||
60 | ssize_t retval = 0; | ||
61 | char *buf; | ||
62 | |||
63 | buf = kzalloc(size, GFP_KERNEL); | ||
64 | if (!buf) | ||
65 | return -ENOMEM; | ||
66 | |||
67 | len = ah->eep_ops->dump_eeprom(ah, true, buf, len, size); | ||
68 | |||
69 | retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
70 | kfree(buf); | ||
71 | |||
72 | return retval; | ||
73 | } | ||
74 | |||
75 | static const struct file_operations fops_base_eeprom = { | ||
76 | .read = read_file_base_eeprom, | ||
77 | .open = simple_open, | ||
78 | .owner = THIS_MODULE, | ||
79 | .llseek = default_llseek, | ||
80 | }; | ||
81 | |||
82 | void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy, | ||
83 | struct ath_hw *ah) | ||
84 | { | ||
85 | debugfs_create_file("base_eeprom", S_IRUSR, debugfs_phy, ah, | ||
86 | &fops_base_eeprom); | ||
87 | } | ||
88 | EXPORT_SYMBOL(ath9k_cmn_debug_base_eeprom); | ||