1 From edb6d6885bef82d1eac432dbeca9fbf4ec349d7e Mon Sep 17 00:00:00 2001
2 From: Chung-Hsien Hsu <stanley.hsu@cypress.com>
3 Date: Thu, 27 Sep 2018 14:59:44 +0000
4 Subject: [PATCH] brcmfmac: reduce timeout for action frame scan
6 Finding a common channel to send an action frame out is required for
7 some action types. Since a loop with several scan retry is used to find
8 the channel, a short wait time could be considered for each attempt.
9 This patch reduces the wait time from 1500 to 450 msec for each action
12 This patch fixes the WFA p2p certification 5.1.20 failure caused by the
13 long action frame send time.
15 Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
16 Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
17 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
19 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 9 ++++-----
20 1 file changed, 4 insertions(+), 5 deletions(-)
22 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
23 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
25 #define P2P_AF_MAX_WAIT_TIME msecs_to_jiffies(2000)
26 #define P2P_INVALID_CHANNEL -1
27 #define P2P_CHANNEL_SYNC_RETRY 5
28 -#define P2P_AF_FRM_SCAN_MAX_WAIT msecs_to_jiffies(1500)
29 +#define P2P_AF_FRM_SCAN_MAX_WAIT msecs_to_jiffies(450)
30 #define P2P_DEFAULT_SLEEP_TIME_VSDB 200
32 /* WiFi P2P Public Action Frame OUI Subtypes */
33 @@ -1134,7 +1134,6 @@ static s32 brcmf_p2p_af_searching_channe
35 struct afx_hdl *afx_hdl = &p2p->afx_hdl;
36 struct brcmf_cfg80211_vif *pri_vif;
37 - unsigned long duration;
40 brcmf_dbg(TRACE, "Enter\n");
41 @@ -1150,7 +1149,6 @@ static s32 brcmf_p2p_af_searching_channe
42 * pending action frame tx is cancelled.
45 - duration = msecs_to_jiffies(P2P_AF_FRM_SCAN_MAX_WAIT);
46 while ((retry < P2P_CHANNEL_SYNC_RETRY) &&
47 (afx_hdl->peer_chan == P2P_INVALID_CHANNEL)) {
48 afx_hdl->is_listen = false;
49 @@ -1158,7 +1156,8 @@ static s32 brcmf_p2p_af_searching_channe
51 /* search peer on peer's listen channel */
52 schedule_work(&afx_hdl->afx_work);
53 - wait_for_completion_timeout(&afx_hdl->act_frm_scan, duration);
54 + wait_for_completion_timeout(&afx_hdl->act_frm_scan,
55 + P2P_AF_FRM_SCAN_MAX_WAIT);
56 if ((afx_hdl->peer_chan != P2P_INVALID_CHANNEL) ||
57 (!test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL,
59 @@ -1171,7 +1170,7 @@ static s32 brcmf_p2p_af_searching_channe
60 afx_hdl->is_listen = true;
61 schedule_work(&afx_hdl->afx_work);
62 wait_for_completion_timeout(&afx_hdl->act_frm_scan,
64 + P2P_AF_FRM_SCAN_MAX_WAIT);
66 if ((afx_hdl->peer_chan != P2P_INVALID_CHANNEL) ||
67 (!test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL,