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 fde39fe..12bb6ac 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 ada809f..3767399 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 3001332..6d49d99 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 7ef3593..243beab 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 63496ed..e0ba011 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);