diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-10-07 06:04:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 18:05:57 -0400 |
commit | 804feeb826f8a32c8c71a09101fae31804b40ad1 (patch) | |
tree | 06aeea8cbf07e7ca26fdf19c345b82194952e5dd /net | |
parent | 3685f25de1b0447fff381c420de1e25bd57c9efb (diff) |
mac80211: remove aggregation status write support from debugfs
This code uses static variables and thus cannot be kept.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/debugfs_sta.c | 73 |
1 files changed, 1 insertions, 72 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 21e8b1c4f64e..5824eb225f26 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -39,13 +39,6 @@ static const struct file_operations sta_ ##name## _ops = { \ | |||
39 | .open = mac80211_open_file_generic, \ | 39 | .open = mac80211_open_file_generic, \ |
40 | } | 40 | } |
41 | 41 | ||
42 | #define STA_OPS_WR(name) \ | ||
43 | static const struct file_operations sta_ ##name## _ops = { \ | ||
44 | .read = sta_##name##_read, \ | ||
45 | .write = sta_##name##_write, \ | ||
46 | .open = mac80211_open_file_generic, \ | ||
47 | } | ||
48 | |||
49 | #define STA_FILE(name, field, format) \ | 42 | #define STA_FILE(name, field, format) \ |
50 | STA_READ_##format(name, field) \ | 43 | STA_READ_##format(name, field) \ |
51 | STA_OPS(name) | 44 | STA_OPS(name) |
@@ -168,71 +161,7 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, | |||
168 | 161 | ||
169 | return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); | 162 | return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); |
170 | } | 163 | } |
171 | 164 | STA_OPS(agg_status); | |
172 | static ssize_t sta_agg_status_write(struct file *file, | ||
173 | const char __user *user_buf, size_t count, loff_t *ppos) | ||
174 | { | ||
175 | struct sta_info *sta = file->private_data; | ||
176 | struct ieee80211_local *local = sta->sdata->local; | ||
177 | struct ieee80211_hw *hw = &local->hw; | ||
178 | u8 *da = sta->sta.addr; | ||
179 | static int tid_static_tx[16] = {0, 0, 0, 0, 0, 0, 0, 0, | ||
180 | 0, 0, 0, 0, 0, 0, 0, 0}; | ||
181 | static int tid_static_rx[16] = {1, 1, 1, 1, 1, 1, 1, 1, | ||
182 | 1, 1, 1, 1, 1, 1, 1, 1}; | ||
183 | char *endp; | ||
184 | char buf[32]; | ||
185 | int buf_size, rs; | ||
186 | unsigned int tid_num; | ||
187 | char state[4]; | ||
188 | |||
189 | memset(buf, 0x00, sizeof(buf)); | ||
190 | buf_size = min(count, (sizeof(buf)-1)); | ||
191 | if (copy_from_user(buf, user_buf, buf_size)) | ||
192 | return -EFAULT; | ||
193 | |||
194 | tid_num = simple_strtoul(buf, &endp, 0); | ||
195 | if (endp == buf) | ||
196 | return -EINVAL; | ||
197 | |||
198 | if ((tid_num >= 100) && (tid_num <= 115)) { | ||
199 | /* toggle Rx aggregation command */ | ||
200 | tid_num = tid_num - 100; | ||
201 | if (tid_static_rx[tid_num] == 1) { | ||
202 | strcpy(state, "off "); | ||
203 | ieee80211_sta_stop_rx_ba_session(sta->sdata, da, tid_num, 0, | ||
204 | WLAN_REASON_QSTA_REQUIRE_SETUP); | ||
205 | sta->ampdu_mlme.tid_state_rx[tid_num] |= | ||
206 | HT_AGG_STATE_DEBUGFS_CTL; | ||
207 | tid_static_rx[tid_num] = 0; | ||
208 | } else { | ||
209 | strcpy(state, "on "); | ||
210 | sta->ampdu_mlme.tid_state_rx[tid_num] &= | ||
211 | ~HT_AGG_STATE_DEBUGFS_CTL; | ||
212 | tid_static_rx[tid_num] = 1; | ||
213 | } | ||
214 | printk(KERN_DEBUG "debugfs - try switching tid %u %s\n", | ||
215 | tid_num, state); | ||
216 | } else if ((tid_num >= 0) && (tid_num <= 15)) { | ||
217 | /* toggle Tx aggregation command */ | ||
218 | if (tid_static_tx[tid_num] == 0) { | ||
219 | strcpy(state, "on "); | ||
220 | rs = ieee80211_start_tx_ba_session(hw, da, tid_num); | ||
221 | if (rs == 0) | ||
222 | tid_static_tx[tid_num] = 1; | ||
223 | } else { | ||
224 | strcpy(state, "off"); | ||
225 | rs = ieee80211_stop_tx_ba_session(hw, da, tid_num, 1); | ||
226 | if (rs == 0) | ||
227 | tid_static_tx[tid_num] = 0; | ||
228 | } | ||
229 | printk(KERN_DEBUG "debugfs - switching tid %u %s, return=%d\n", | ||
230 | tid_num, state, rs); | ||
231 | } | ||
232 | |||
233 | return count; | ||
234 | } | ||
235 | STA_OPS_WR(agg_status); | ||
236 | 165 | ||
237 | #define DEBUGFS_ADD(name) \ | 166 | #define DEBUGFS_ADD(name) \ |
238 | sta->debugfs.name = debugfs_create_file(#name, 0400, \ | 167 | sta->debugfs.name = debugfs_create_file(#name, 0400, \ |