5cbab6889aa9c067a22e1661c5733380a84202df
[librecmc/librecmc.git] / package / mac80211 / patches / 408-mac80211-remove-agg-debugfs.patch
1 Subject: mac80211: remove aggregation status write support from debugfs
2
3 This code uses static variables and thus cannot be kept.
4
5 Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
6 ---
7  net/mac80211/debugfs_sta.c |   73 ---------------------------------------------
8  1 file changed, 1 insertion(+), 72 deletions(-)
9
10 --- everything.orig/net/mac80211/debugfs_sta.c  2008-10-07 20:06:39.000000000 +0200
11 +++ everything/net/mac80211/debugfs_sta.c       2008-10-07 20:06:40.000000000 +0200
12 @@ -39,13 +39,6 @@ static const struct file_operations sta_
13         .open = mac80211_open_file_generic,                             \
14  }
15  
16 -#define STA_OPS_WR(name)                                               \
17 -static const struct file_operations sta_ ##name## _ops = {             \
18 -       .read = sta_##name##_read,                                      \
19 -       .write = sta_##name##_write,                                    \
20 -       .open = mac80211_open_file_generic,                             \
21 -}
22 -
23  #define STA_FILE(name, field, format)                                  \
24                 STA_READ_##format(name, field)                          \
25                 STA_OPS(name)
26 @@ -168,71 +161,7 @@ static ssize_t sta_agg_status_read(struc
27  
28         return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
29  }
30 -
31 -static ssize_t sta_agg_status_write(struct file *file,
32 -               const char __user *user_buf, size_t count, loff_t *ppos)
33 -{
34 -       struct sta_info *sta = file->private_data;
35 -       struct ieee80211_local *local = sta->sdata->local;
36 -       struct ieee80211_hw *hw = &local->hw;
37 -       u8 *da = sta->sta.addr;
38 -       static int tid_static_tx[16] = {0, 0, 0, 0, 0, 0, 0, 0,
39 -                                       0, 0, 0, 0, 0, 0, 0, 0};
40 -       static int tid_static_rx[16] = {1, 1, 1, 1, 1, 1, 1, 1,
41 -                                       1, 1, 1, 1, 1, 1, 1, 1};
42 -       char *endp;
43 -       char buf[32];
44 -       int buf_size, rs;
45 -       unsigned int tid_num;
46 -       char state[4];
47 -
48 -       memset(buf, 0x00, sizeof(buf));
49 -       buf_size = min(count, (sizeof(buf)-1));
50 -       if (copy_from_user(buf, user_buf, buf_size))
51 -               return -EFAULT;
52 -
53 -       tid_num = simple_strtoul(buf, &endp, 0);
54 -       if (endp == buf)
55 -               return -EINVAL;
56 -
57 -       if ((tid_num >= 100) && (tid_num <= 115)) {
58 -               /* toggle Rx aggregation command */
59 -               tid_num = tid_num - 100;
60 -               if (tid_static_rx[tid_num] == 1) {
61 -                       strcpy(state, "off ");
62 -                       ieee80211_sta_stop_rx_ba_session(sta->sdata, da, tid_num, 0,
63 -                                       WLAN_REASON_QSTA_REQUIRE_SETUP);
64 -                       sta->ampdu_mlme.tid_state_rx[tid_num] |=
65 -                                       HT_AGG_STATE_DEBUGFS_CTL;
66 -                       tid_static_rx[tid_num] = 0;
67 -               } else {
68 -                       strcpy(state, "on ");
69 -                       sta->ampdu_mlme.tid_state_rx[tid_num] &=
70 -                                       ~HT_AGG_STATE_DEBUGFS_CTL;
71 -                       tid_static_rx[tid_num] = 1;
72 -               }
73 -               printk(KERN_DEBUG "debugfs - try switching tid %u %s\n",
74 -                               tid_num, state);
75 -       } else if ((tid_num >= 0) && (tid_num <= 15)) {
76 -               /* toggle Tx aggregation command */
77 -               if (tid_static_tx[tid_num] == 0) {
78 -                       strcpy(state, "on ");
79 -                       rs =  ieee80211_start_tx_ba_session(hw, da, tid_num);
80 -                       if (rs == 0)
81 -                               tid_static_tx[tid_num] = 1;
82 -               } else {
83 -                       strcpy(state, "off");
84 -                       rs =  ieee80211_stop_tx_ba_session(hw, da, tid_num, 1);
85 -                       if (rs == 0)
86 -                               tid_static_tx[tid_num] = 0;
87 -               }
88 -               printk(KERN_DEBUG "debugfs - switching tid %u %s, return=%d\n",
89 -                               tid_num, state, rs);
90 -       }
91 -
92 -       return count;
93 -}
94 -STA_OPS_WR(agg_status);
95 +STA_OPS(agg_status);
96  
97  #define DEBUGFS_ADD(name) \
98         sta->debugfs.name = debugfs_create_file(#name, 0400, \