From: Xinming Hu <[email protected]>

It is observed that driver may send the data packet to tdls peer
before tdls peer receives tdls setup confirm frame.
Similar race condition exists during tdls teardown procedure also.
This patch adds 10 milliseconds delay to resolve the race.

Signed-off-by: Xinming Hu <[email protected]>
Signed-off-by: Cathy Luo <[email protected]>
Signed-off-by: Amitkumar Karwar <[email protected]>
---
 drivers/net/wireless/marvell/mwifiex/tdls.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/tdls.c 
b/drivers/net/wireless/marvell/mwifiex/tdls.c
index 9275f9c..1506496 100644
--- a/drivers/net/wireless/marvell/mwifiex/tdls.c
+++ b/drivers/net/wireless/marvell/mwifiex/tdls.c
@@ -680,6 +680,13 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private 
*priv, const u8 *peer,
        __net_timestamp(skb);
        mwifiex_queue_tx_pkt(priv, skb);
 
+       /* Delay 10ms to make sure tdls setup confirm/teardown frame
+        * is received by peer
+       */
+       if (action_code == WLAN_TDLS_SETUP_CONFIRM ||
+           action_code == WLAN_TDLS_TEARDOWN)
+               msleep_interruptible(10);
+
        return 0;
 }
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to