mwifiex: AMPDU support for TDLS link
authorAvinash Patil <patila@marvell.com>
Sat, 8 Feb 2014 00:30:37 +0000 (16:30 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 12 Feb 2014 20:36:23 +0000 (15:36 -0500)
This patch adds AMPDU support for TDLS link. We have set 11n
capabilities including AMPDU parameters during ENABLE_LINK.
We set a variable in RA list to indicate this as TDLS link.
This patch uses these capabilities to know if AMPDU is allowed
on TDLS link and enables AMPDU aggregation for TX and RX reording
support for RA list for this peer.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/11n.h
drivers/net/wireless/mwifiex/11n_rxreorder.c
drivers/net/wireless/mwifiex/main.h
drivers/net/wireless/mwifiex/tdls.c
drivers/net/wireless/mwifiex/wmm.c

index fde39fedf0c03bf5b588391c0fa1196e58473bc4..12bb6acbdd58ce53dd97d5cc0fdeb2bbb10a5e29 100644 (file)
@@ -81,11 +81,15 @@ static inline u8
 mwifiex_is_ampdu_allowed(struct mwifiex_private *priv,
                         struct mwifiex_ra_list_tbl *ptr, int tid)
 {
-       if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)
+       if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) {
                return mwifiex_is_station_ampdu_allowed(priv, ptr, tid);
-       else
+       } else {
+               if (ptr->tdls_link)
+                       return mwifiex_is_station_ampdu_allowed(priv, ptr, tid);
+
                return (priv->aggr_prio_tbl[tid].ampdu_ap !=
                        BA_STREAM_NOT_ALLOWED) ? true : false;
+       }
 }
 
 /*
@@ -179,4 +183,14 @@ static inline int mwifiex_is_sta_11n_enabled(struct mwifiex_private *priv,
 
        return node->is_11n_enabled;
 }
+
+static inline u8
+mwifiex_tdls_peer_11n_enabled(struct mwifiex_private *priv, u8 *ra)
+{
+       struct mwifiex_sta_node *node = mwifiex_get_sta_entry(priv, ra);
+       if (node)
+               return node->is_11n_enabled;
+
+       return false;
+}
 #endif /* !_MWIFIEX_11N_H_ */
index ada809f576fe56c290a9150728b5b08e358c2d53..3767399576b34f9650a6dde395d0ddf8af768e29 100644 (file)
@@ -290,7 +290,11 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
                                last_seq = node->rx_seq[tid];
                }
        } else {
-               last_seq = priv->rx_seq[tid];
+               node = mwifiex_get_sta_entry(priv, ta);
+               if (node)
+                       last_seq = node->rx_seq[tid];
+               else
+                       last_seq = priv->rx_seq[tid];
        }
 
        if (last_seq != MWIFIEX_DEF_11N_RX_SEQ_NUM &&
index 3001332191a3fa9ea0a8e6ff625914ed8c8f0968..6d49d99045c09bd6618b91e6942f3ff74beee2c6 100644 (file)
@@ -210,6 +210,7 @@ struct mwifiex_ra_list_tbl {
        u16 ba_pkt_count;
        u8 ba_packet_thr;
        u16 total_pkt_count;
+       bool tdls_link;
 };
 
 struct mwifiex_tid_tbl {
index 7ef3593e2c4403abb86165c73fc4999e439adfe8..243beaba916051b93c0be6aae1201e53ca0c3a5a 100644 (file)
@@ -49,6 +49,7 @@ mwifiex_restore_tdls_packets(struct mwifiex_private *priv, u8 *mac, u8 status)
 
                if (status == TDLS_SETUP_COMPLETE) {
                        ra_list = mwifiex_wmm_get_queue_raptr(priv, tid, mac);
+                       ra_list->tdls_link = true;
                        tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT;
                } else {
                        tid_list = &priv->wmm.tid_tbl_ptr[tid_down].ra_list;
index 63496ed10272c09a09aca06be6bed68d65a58a00..e0ba0115e5aefcb79690559ee1b953ab58f52290 100644 (file)
@@ -160,8 +160,15 @@ mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra)
                        break;
 
                ra_list->is_11n_enabled = 0;
+               ra_list->tdls_link = false;
                if (!mwifiex_queuing_ra_based(priv)) {
-                       ra_list->is_11n_enabled = IS_11N_ENABLED(priv);
+                       if (mwifiex_get_tdls_link_status(priv, ra) ==
+                           TDLS_SETUP_COMPLETE) {
+                               ra_list->is_11n_enabled =
+                                       mwifiex_tdls_peer_11n_enabled(priv, ra);
+                       } else {
+                               ra_list->is_11n_enabled = IS_11N_ENABLED(priv);
+                       }
                } else {
                        ra_list->is_11n_enabled =
                                      mwifiex_is_sta_11n_enabled(priv, node);