aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ieee80211.h4
-rw-r--r--include/net/mac80211.h3
-rw-r--r--net/mac80211/ieee80211_i.h1
-rw-r--r--net/mac80211/main.c21
-rw-r--r--net/mac80211/mlme.c29
5 files changed, 56 insertions, 2 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index cffd6d0094f9..aa603c3d76d1 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -658,6 +658,10 @@ struct ieee80211_bar {
658 __le16 start_seq_num; 658 __le16 start_seq_num;
659} __attribute__((packed)); 659} __attribute__((packed));
660 660
661/* 802.11 BAR control masks */
662#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000
663#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
664
661/** 665/**
662 * struct ieee80211_ht_cap - HT capabilities 666 * struct ieee80211_ht_cap - HT capabilities
663 * 667 *
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 3a204acad901..0a5de3ef527a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -235,6 +235,8 @@ struct ieee80211_bss_conf {
235 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged 235 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged
236 * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status 236 * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status
237 * is for the whole aggregation. 237 * is for the whole aggregation.
238 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned,
239 * so consider using block ack request (BAR).
238 */ 240 */
239enum mac80211_tx_control_flags { 241enum mac80211_tx_control_flags {
240 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 242 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
@@ -260,6 +262,7 @@ enum mac80211_tx_control_flags {
260 IEEE80211_TX_STAT_TX_FILTERED = BIT(20), 262 IEEE80211_TX_STAT_TX_FILTERED = BIT(20),
261 IEEE80211_TX_STAT_ACK = BIT(21), 263 IEEE80211_TX_STAT_ACK = BIT(21),
262 IEEE80211_TX_STAT_AMPDU = BIT(22), 264 IEEE80211_TX_STAT_AMPDU = BIT(22),
265 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(23),
263}; 266};
264 267
265 268
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index f90da1bbec49..175cbdd36d7f 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -904,6 +904,7 @@ void ieee80211_send_addba_request(struct net_device *dev, const u8 *da,
904 u16 agg_size, u16 timeout); 904 u16 agg_size, u16 timeout);
905void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid, 905void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid,
906 u16 initiator, u16 reason_code); 906 u16 initiator, u16 reason_code);
907void ieee80211_send_bar(struct net_device *dev, u8 *ra, u16 tid, u16 ssn);
907 908
908void ieee80211_sta_stop_rx_ba_session(struct net_device *dev, u8 *da, 909void ieee80211_sta_stop_rx_ba_session(struct net_device *dev, u8 *da,
909 u16 tid, u16 initiator, u16 reason); 910 u16 tid, u16 initiator, u16 reason);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index f18cfd727872..074f71a62a6d 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1404,14 +1404,15 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
1404 struct ieee80211_local *local = hw_to_local(hw); 1404 struct ieee80211_local *local = hw_to_local(hw);
1405 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1405 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1406 u16 frag, type; 1406 u16 frag, type;
1407 __le16 fc;
1407 struct ieee80211_tx_status_rtap_hdr *rthdr; 1408 struct ieee80211_tx_status_rtap_hdr *rthdr;
1408 struct ieee80211_sub_if_data *sdata; 1409 struct ieee80211_sub_if_data *sdata;
1409 struct net_device *prev_dev = NULL; 1410 struct net_device *prev_dev = NULL;
1411 struct sta_info *sta;
1410 1412
1411 rcu_read_lock(); 1413 rcu_read_lock();
1412 1414
1413 if (info->status.excessive_retries) { 1415 if (info->status.excessive_retries) {
1414 struct sta_info *sta;
1415 sta = sta_info_get(local, hdr->addr1); 1416 sta = sta_info_get(local, hdr->addr1);
1416 if (sta) { 1417 if (sta) {
1417 if (test_sta_flags(sta, WLAN_STA_PS)) { 1418 if (test_sta_flags(sta, WLAN_STA_PS)) {
@@ -1426,8 +1427,24 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
1426 } 1427 }
1427 } 1428 }
1428 1429
1430 fc = hdr->frame_control;
1431
1432 if ((info->flags & IEEE80211_TX_STAT_AMPDU_NO_BACK) &&
1433 (ieee80211_is_data_qos(fc))) {
1434 u16 tid, ssn;
1435 u8 *qc;
1436 sta = sta_info_get(local, hdr->addr1);
1437 if (sta) {
1438 qc = ieee80211_get_qos_ctl(hdr);
1439 tid = qc[0] & 0xf;
1440 ssn = ((le16_to_cpu(hdr->seq_ctrl) + 0x10)
1441 & IEEE80211_SCTL_SEQ);
1442 ieee80211_send_bar(sta->sdata->dev, hdr->addr1,
1443 tid, ssn);
1444 }
1445 }
1446
1429 if (info->flags & IEEE80211_TX_STAT_TX_FILTERED) { 1447 if (info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
1430 struct sta_info *sta;
1431 sta = sta_info_get(local, hdr->addr1); 1448 sta = sta_info_get(local, hdr->addr1);
1432 if (sta) { 1449 if (sta) {
1433 ieee80211_handle_filtered_frame(local, sta, skb); 1450 ieee80211_handle_filtered_frame(local, sta, skb);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 86abdf96390c..e080482b63cd 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1536,6 +1536,35 @@ void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid,
1536 ieee80211_sta_tx(dev, skb, 0); 1536 ieee80211_sta_tx(dev, skb, 0);
1537} 1537}
1538 1538
1539void ieee80211_send_bar(struct net_device *dev, u8 *ra, u16 tid, u16 ssn)
1540{
1541 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
1542 struct sk_buff *skb;
1543 struct ieee80211_bar *bar;
1544 u16 bar_control = 0;
1545
1546 skb = dev_alloc_skb(sizeof(*bar) + local->hw.extra_tx_headroom);
1547 if (!skb) {
1548 printk(KERN_ERR "%s: failed to allocate buffer for "
1549 "bar frame\n", dev->name);
1550 return;
1551 }
1552 skb_reserve(skb, local->hw.extra_tx_headroom);
1553 bar = (struct ieee80211_bar *)skb_put(skb, sizeof(*bar));
1554 memset(bar, 0, sizeof(*bar));
1555 bar->frame_control = IEEE80211_FC(IEEE80211_FTYPE_CTL,
1556 IEEE80211_STYPE_BACK_REQ);
1557 memcpy(bar->ra, ra, ETH_ALEN);
1558 memcpy(bar->ta, dev->dev_addr, ETH_ALEN);
1559 bar_control |= (u16)IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL;
1560 bar_control |= (u16)IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA;
1561 bar_control |= (u16)(tid << 12);
1562 bar->control = cpu_to_le16(bar_control);
1563 bar->start_seq_num = cpu_to_le16(ssn);
1564
1565 ieee80211_sta_tx(dev, skb, 0);
1566}
1567
1539void ieee80211_sta_stop_rx_ba_session(struct net_device *dev, u8 *ra, u16 tid, 1568void ieee80211_sta_stop_rx_ba_session(struct net_device *dev, u8 *ra, u16 tid,
1540 u16 initiator, u16 reason) 1569 u16 initiator, u16 reason)
1541{ 1570{