40 #include <linux/slab.h>
41 #include <linux/export.h>
46 static void ieee80211_free_tid_rx(
struct rcu_head *
h)
54 for (i = 0; i < tid_rx->
buf_size; i++)
78 "Rx BA session stop requested for %pM tid %u %s reason: %d\n",
86 "HW problem - can not stop rx aggregation for tid %d\n",
122 if (ba_rx_bitmap &
BIT(i))
134 static void sta_rx_agg_session_timer_expired(
unsigned long data)
140 u8 *ptid = (
u8 *)data;
141 u8 *timer_to_id = ptid - *ptid;
162 ht_dbg(sta->
sdata,
"rx session timer expired on tid %d\n", (
u16)*ptid);
168 static void sta_rx_agg_reorder_timer_expired(
unsigned long data)
170 u8 *ptid = (
u8 *)data;
171 u8 *timer_to_id = ptid - *ptid;
189 skb = dev_alloc_skb(
sizeof(*mgmt) + local->
hw.extra_tx_headroom);
193 skb_reserve(skb, local->
hw.extra_tx_headroom);
210 skb_put(skb, 1 +
sizeof(mgmt->
u.action.u.addba_resp));
215 capab = (
u16)(policy << 1);
216 capab |= (
u16)(tid << 2);
217 capab |= (
u16)(buf_size << 6);
220 mgmt->
u.action.u.addba_resp.timeout =
cpu_to_le16(timeout);
221 mgmt->
u.action.u.addba_resp.status =
cpu_to_le16(status);
223 ieee80211_tx_skb(sdata, skb);
237 dialog_token = mgmt->
u.action.u.addba_req.dialog_token;
238 timeout =
le16_to_cpu(mgmt->
u.action.u.addba_req.timeout);
240 le16_to_cpu(mgmt->
u.action.u.addba_req.start_seq_num) >> 4;
250 ht_dbg(sta->
sdata,
"Suspend in progress - Denying ADDBA request\n");
258 if (((ba_policy != 1) &&
263 "AddBA Req with bad params from %pM on tid %u. policy %d, buffer size %d\n",
264 mgmt->
sa, tid, ba_policy, buf_size);
272 if (buf_size > local->
hw.max_rx_aggregation_subframes)
273 buf_size = local->
hw.max_rx_aggregation_subframes;
280 "unexpected AddBA Req from %pM on tid %u\n",
297 tid_agg_rx->
session_timer.function = sta_rx_agg_session_timer_expired;
302 tid_agg_rx->
reorder_timer.function = sta_rx_agg_reorder_timer_expired;
310 kcalloc(buf_size,
sizeof(
unsigned long),
GFP_KERNEL);
319 &sta->
sta, tid, &start_seq_num, 0);
320 ht_dbg(sta->
sdata,
"Rx A-MPDU request on tid %d result %d\n", tid, ret);
349 ieee80211_send_addba_resp(sta->
sdata, sta->
sta.addr, tid,
350 dialog_token, status, 1, buf_size, timeout);