forked from zeplios/atheros-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
612-retry-limit-for-bitmira.patch
69 lines (66 loc) · 2.05 KB
/
612-retry-limit-for-bitmira.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--- a/drivers/net/wireless/ath/ath9k/debug.c 2013-08-05 23:16:14.000000000 +0800
+++ b/drivers/net/wireless/ath/ath9k/debug.c 2013-08-05 23:14:15.000000000 +0800
@@ -1966,6 +1966,45 @@
.llseek = default_llseek,
};
+static ssize_t read_file_retry_limit(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ char buf[16];
+ unsigned int len;
+
+ len = sprintf(buf, "%u\n", sc->debug.retry_limit);
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static ssize_t write_file_retry_limit(struct file *file, const char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ unsigned long retry_limit;
+ char buf[16];
+ ssize_t len;
+
+ len = min(count, sizeof(buf) - 1);
+ if (copy_from_user(buf, user_buf, len))
+ return -EFAULT;
+
+ buf[len] = '\0';
+ if (strict_strtoul(buf, 0, &retry_limit))
+ return -EINVAL;
+
+ sc->debug.retry_limit = retry_limit;
+ return count;
+}
+
+static const struct file_operations fops_retry_limit = {
+ .read = read_file_retry_limit,
+ .write = write_file_retry_limit,
+ .open = ath9k_debugfs_open,
+ .owner = THIS_MODULE,
+ .llseek = default_llseek,
+};
+
int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
@@ -2047,7 +2086,10 @@
&fops_aggr_record);
debugfs_create_file("rx_infos", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc,
&fops_rx_infos);
+ debugfs_create_file("retry_limit", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc,
+ &fops_retry_limit);
+ sc->debug.retry_limit = 20;
INIT_LIST_HEAD(&sc->debug.rx_infos_list);
INIT_LIST_HEAD(&sc->debug.xmit_bw_list);
INIT_LIST_HEAD(&sc->debug.recv_tp_list);
--- a/drivers/net/wireless/ath/ath9k/debug.h 2013-08-05 23:16:14.000000000 +0800
+++ b/drivers/net/wireless/ath/ath9k/debug.h 2013-08-05 23:15:10.000000000 +0800
@@ -275,6 +275,7 @@
u8 tsidx;
u8 rsidx;
+ u8 retry_limit;
struct list_head recv_tp_list;
struct realtime_var rtv;
struct list_head xmit_bw_list;