mac80211: add flag to indicate HW only Tx-agg setup support
authorArik Nemtsov <arik@wizery.com>
Tue, 30 Aug 2011 06:32:38 +0000 (09:32 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 13 Sep 2011 19:45:03 +0000 (15:45 -0400)
When this flag is set, Tx A-MPDU sessions will not be started by
mac80211. This flag is required for devices that support Tx A-MPDU setup
in hardware.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/net/mac80211.h
net/mac80211/agg-tx.c
net/mac80211/debugfs.c
net/mac80211/tx.c

index 2e752df575109dc1526d22d1dbe40aa5a3ed5f77..5e5029b22ac729aed08a8bcf9a180137315b22fc 100644 (file)
@@ -1096,6 +1096,10 @@ enum sta_notify_cmd {
  *     stations based on the PM bit of incoming frames.
  *     Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure
  *     the PS mode of connected stations.
+ *
+ * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session
+ *     setup strictly in HW. mac80211 should not attempt to do this in
+ *     software.
  */
 enum ieee80211_hw_flags {
        IEEE80211_HW_HAS_RATE_CONTROL                   = 1<<0,
@@ -1121,6 +1125,7 @@ enum ieee80211_hw_flags {
        IEEE80211_HW_SUPPORTS_CQM_RSSI                  = 1<<20,
        IEEE80211_HW_SUPPORTS_PER_STA_GTK               = 1<<21,
        IEEE80211_HW_AP_LINK_PS                         = 1<<22,
+       IEEE80211_HW_TX_AMPDU_SETUP_IN_HW               = 1<<23,
 };
 
 /**
index f10e1096c332ca7ae9e4c6ab6039b1e55d7baa18..250b9a53f6d99c3a7cd001292edd12cd6e309f8c 100644 (file)
@@ -360,7 +360,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
                return -EINVAL;
 
        if ((tid >= STA_TID_NUM) ||
-           !(local->hw.flags & IEEE80211_HW_AMPDU_AGGREGATION))
+           !(local->hw.flags & IEEE80211_HW_AMPDU_AGGREGATION) ||
+           (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW))
                return -EINVAL;
 
 #ifdef CONFIG_MAC80211_HT_DEBUG
index 569609b94c8c35aa7768dbeb4859bc869ce54d82..c9141168fd4343bc562168be5457ba80069fc549 100644 (file)
@@ -350,6 +350,8 @@ static ssize_t hwflags_read(struct file *file, char __user *user_buf,
                sf += snprintf(buf + sf, mxln - sf, "SUPPORTS_PER_STA_GTK\n");
        if (local->hw.flags & IEEE80211_HW_AP_LINK_PS)
                sf += snprintf(buf + sf, mxln - sf, "AP_LINK_PS\n");
+       if (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW)
+               sf += snprintf(buf + sf, mxln - sf, "TX_AMPDU_SETUP_IN_HW\n");
 
        rv = simple_read_from_buffer(user_buf, count, ppos, buf, strlen(buf));
        kfree(buf);
index c9766ccb51a4788eec0271a90d5151893c15014b..2521716aa97b033bb6953152a87f0432b77ab587 100644 (file)
@@ -1232,7 +1232,8 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
                tx->sta = sta_info_get(sdata, hdr->addr1);
 
        if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
-           (local->hw.flags & IEEE80211_HW_AMPDU_AGGREGATION)) {
+           (local->hw.flags & IEEE80211_HW_AMPDU_AGGREGATION) &&
+           !(local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW)) {
                struct tid_ampdu_tx *tid_tx;
 
                qc = ieee80211_get_qos_ctl(hdr);