12 #include <linux/export.h>
15 #include <asm/unaligned.h>
41 tasklet_schedule(&local->
tasklet);
45 static void ieee80211_handle_filtered_frame(
struct ieee80211_local *local,
82 u8 *
p = ieee80211_get_qos_ctl(hdr);
91 *p &= ~IEEE80211_QOS_CTL_EOSP;
159 "dropped TX filtered frame, queue_len=%d PS=%d @%lu\n",
165 static void ieee80211_check_pending_bar(
struct sta_info *sta,
u8 *
addr,
u8 tid)
177 static void ieee80211_frame_acked(
struct sta_info *sta,
struct sk_buff *skb)
185 u8 *qc = ieee80211_get_qos_ctl(hdr);
186 u16 tid = qc[0] & 0xf;
188 ieee80211_check_pending_bar(sta, hdr->
addr1, tid);
202 switch (mgmt->
u.action.u.ht_smps.smps_control) {
219 static void ieee80211_set_bar_pending(
struct sta_info *sta,
u8 tid,
u16 ssn)
236 if (info->
status.rates[0].idx >= 0 &&
247 if (info->
status.rates[0].idx >= 0 &&
266 memset(rthdr, 0, rtap_len);
271 pos = (
unsigned char *)(rthdr + 1);
280 if (info->
status.rates[0].idx >= 0 &&
291 !is_multicast_ether_addr(hdr->
addr1))
300 put_unaligned_le16(txflags,
pos);
309 if (info->
status.rates[0].idx >= 0 &&
334 #define STA_LOST_PKT_THRESHOLD 50
347 int retry_count = -1,
i;
358 info->
status.rates[
i].idx = -1;
359 info->
status.rates[
i].count = 0;
361 }
else if (info->
status.rates[
i].idx < 0) {
365 info->
status.rates[
i].idx = -1;
366 info->
status.rates[
i].count = 0;
370 retry_count += info->
status.rates[
i].count;
379 sband = local->
hw.wiphy->bands[info->
band];
384 if (!ether_addr_equal(hdr->
addr2, sta->
sdata->vif.addr))
396 ieee80211_handle_filtered_frame(local, sta, skb);
406 (ieee80211_is_data_qos(fc))) {
410 qc = ieee80211_get_qos_ctl(hdr);
418 if (!acked && ieee80211_is_back_req(fc)) {
435 ieee80211_set_bar_pending(sta, tid, ssn);
440 ieee80211_handle_filtered_frame(local, sta, skb);
449 rate_control_tx_status(local, sband, sta, skb);
450 if (ieee80211_vif_is_mesh(&sta->
sdata->vif))
454 ieee80211_frame_acked(sta, skb);
483 if (ieee80211_is_first_frag(hdr->
seq_ctrl)) {
485 if (is_multicast_ether_addr(hdr->
addr1))
497 if (!is_multicast_ether_addr(hdr->
addr1) ||
498 ieee80211_is_data(fc) ||
499 ieee80211_is_mgmt(fc))
502 if (ieee80211_is_first_frag(hdr->
seq_ctrl))
506 if (ieee80211_is_nullfunc(fc) && ieee80211_has_pm(fc) &&
530 if (skb->
dev != sdata->
dev)
580 !(ieee80211_is_data(fc));
592 rtap_len = ieee80211_tx_radiotap_len(info);
594 pr_err(
"ieee80211_tx_status: headroom too small\n");
598 ieee80211_add_tx_radiotap_header(sband, skb, retry_count, rtap_len);
601 skb_set_mac_header(skb, 0);
605 memset(skb->cb, 0,
sizeof(skb->cb));
610 if (!ieee80211_sdata_running(sdata))
620 skb2->
dev = prev_dev;
625 prev_dev = sdata->
dev;
677 while ((skb = __skb_dequeue(skbs)))