diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-09-27 16:33:28 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-09-28 12:03:47 -0400 |
commit | 9a7308341b71f3c5e88e6a30f9d6a1cfb3bc2b4f (patch) | |
tree | dda46b7616fe1866d1efa07fc5cee5330be7e783 /drivers/net/wireless/ath/ath6kl/debug.c | |
parent | 1b4304da0adcc31727da3ee7f89dd180f4e65473 (diff) |
ath6kl: silence "invalid rate" warning
For some reason firmware is sending invalid rates when we try to
query current bitrate from ath6kl_get_station() and a warning is issued:
[ 3810.415720] ath6kl: invalid rate: 1935633515
[ 3811.105493] ath6kl: invalid rate: 1935633515
[ 3811.556063] ath6kl: invalid rate: 1935633515
As the warning happens way too often, convert the warning to a debug
message once we have a proper fix. But to make it easy to follow
how often the problem appears, add a debugfs to print
various statistics about workarounds and make this issue the first WAR.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/debug.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c index 4fc83ccbf8bd..5237369cd521 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.c +++ b/drivers/net/wireless/ath/ath6kl/debug.c | |||
@@ -192,6 +192,51 @@ static int ath6kl_debugfs_open(struct inode *inode, struct file *file) | |||
192 | return 0; | 192 | return 0; |
193 | } | 193 | } |
194 | 194 | ||
195 | void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war) | ||
196 | { | ||
197 | switch (war) { | ||
198 | case ATH6KL_WAR_INVALID_RATE: | ||
199 | ar->debug.war_stats.invalid_rate++; | ||
200 | break; | ||
201 | } | ||
202 | } | ||
203 | |||
204 | static ssize_t read_file_war_stats(struct file *file, char __user *user_buf, | ||
205 | size_t count, loff_t *ppos) | ||
206 | { | ||
207 | struct ath6kl *ar = file->private_data; | ||
208 | char *buf; | ||
209 | unsigned int len = 0, buf_len = 1500; | ||
210 | ssize_t ret_cnt; | ||
211 | |||
212 | buf = kzalloc(buf_len, GFP_KERNEL); | ||
213 | if (!buf) | ||
214 | return -ENOMEM; | ||
215 | |||
216 | len += scnprintf(buf + len, buf_len - len, "\n"); | ||
217 | len += scnprintf(buf + len, buf_len - len, "%25s\n", | ||
218 | "Workaround stats"); | ||
219 | len += scnprintf(buf + len, buf_len - len, "%25s\n\n", | ||
220 | "================="); | ||
221 | len += scnprintf(buf + len, buf_len - len, "%20s %10u\n", | ||
222 | "Invalid rates", ar->debug.war_stats.invalid_rate); | ||
223 | |||
224 | if (WARN_ON(len > buf_len)) | ||
225 | len = buf_len; | ||
226 | |||
227 | ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
228 | |||
229 | kfree(buf); | ||
230 | return ret_cnt; | ||
231 | } | ||
232 | |||
233 | static const struct file_operations fops_war_stats = { | ||
234 | .read = read_file_war_stats, | ||
235 | .open = ath6kl_debugfs_open, | ||
236 | .owner = THIS_MODULE, | ||
237 | .llseek = default_llseek, | ||
238 | }; | ||
239 | |||
195 | static void ath6kl_debug_fwlog_add(struct ath6kl *ar, const void *buf, | 240 | static void ath6kl_debug_fwlog_add(struct ath6kl *ar, const void *buf, |
196 | size_t buf_len) | 241 | size_t buf_len) |
197 | { | 242 | { |
@@ -873,6 +918,9 @@ int ath6kl_debug_init(struct ath6kl *ar) | |||
873 | debugfs_create_file("reg_write", S_IRUSR | S_IWUSR, | 918 | debugfs_create_file("reg_write", S_IRUSR | S_IWUSR, |
874 | ar->debugfs_phy, ar, &fops_diag_reg_write); | 919 | ar->debugfs_phy, ar, &fops_diag_reg_write); |
875 | 920 | ||
921 | debugfs_create_file("war_stats", S_IRUSR, ar->debugfs_phy, ar, | ||
922 | &fops_war_stats); | ||
923 | |||
876 | return 0; | 924 | return 0; |
877 | } | 925 | } |
878 | 926 | ||