All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] WFA p2p certification fixes
@ 2018-09-27  9:44 Chi-Hsien Lin
  2018-09-27  9:44 ` [PATCH 1/2] brcmfmac: reduce timeout for action frame scan Chi-Hsien Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chi-Hsien Lin @ 2018-09-27  9:44 UTC (permalink / raw)
  To: linux-firmware
  Cc: linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
	Josh Boyer, Arend van Spriel, Franky Lin, Hante Meuleman,
	Wright Feng, Chi-Hsien Lin

Fixes for WFA p2p certification 5.1.19 and 5.1.20 failures.

Chung-Hsien Hsu (2):
  brcmfmac: reduce timeout for action frame scan
  brcmfmac: fix full timeout waiting for action frame on-channel tx

 .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 26 ++++++++++++++++------
 .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.h |  2 ++
 2 files changed, 21 insertions(+), 7 deletions(-)

-- 
2.1.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] brcmfmac: reduce timeout for action frame scan
  2018-09-27  9:44 [PATCH 0/2] WFA p2p certification fixes Chi-Hsien Lin
@ 2018-09-27  9:44 ` Chi-Hsien Lin
  2018-09-27  9:44 ` [PATCH 2/2] brcmfmac: fix full timeout waiting for action frame on-channel tx Chi-Hsien Lin
  2018-09-27 14:58 ` [PATCH 0/2] WFA p2p certification fixes Chi-Hsien Lin
  2 siblings, 0 replies; 4+ messages in thread
From: Chi-Hsien Lin @ 2018-09-27  9:44 UTC (permalink / raw)
  To: linux-firmware
  Cc: linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
	Josh Boyer, Arend van Spriel, Franky Lin, Hante Meuleman,
	Wright Feng, Stanley Hsu, Chi-Hsien Lin

From: Chung-Hsien Hsu <stanley.hsu@cypress.com>

Finding a common channel to send an action frame out is required for
some action types. Since a loop with several scan retry is used to find
the channel, a short wait time could be considered for each attempt.
This patch reduces the wait time from 1500 to 450 msec for each action
frame scan.

This patch fixes the WFA p2p certification 5.1.20 failure caused by the
long action frame send time.

Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index 3e9c4f2f5dd1..7822740a8cb4 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -74,7 +74,7 @@
 #define P2P_AF_MAX_WAIT_TIME		msecs_to_jiffies(2000)
 #define P2P_INVALID_CHANNEL		-1
 #define P2P_CHANNEL_SYNC_RETRY		5
-#define P2P_AF_FRM_SCAN_MAX_WAIT	msecs_to_jiffies(1500)
+#define P2P_AF_FRM_SCAN_MAX_WAIT	msecs_to_jiffies(450)
 #define P2P_DEFAULT_SLEEP_TIME_VSDB	200
 
 /* WiFi P2P Public Action Frame OUI Subtypes */
@@ -1134,7 +1134,6 @@ static s32 brcmf_p2p_af_searching_channel(struct brcmf_p2p_info *p2p)
 {
 	struct afx_hdl *afx_hdl = &p2p->afx_hdl;
 	struct brcmf_cfg80211_vif *pri_vif;
-	unsigned long duration;
 	s32 retry;
 
 	brcmf_dbg(TRACE, "Enter\n");
@@ -1150,7 +1149,6 @@ static s32 brcmf_p2p_af_searching_channel(struct brcmf_p2p_info *p2p)
 	 * pending action frame tx is cancelled.
 	 */
 	retry = 0;
-	duration = msecs_to_jiffies(P2P_AF_FRM_SCAN_MAX_WAIT);
 	while ((retry < P2P_CHANNEL_SYNC_RETRY) &&
 	       (afx_hdl->peer_chan == P2P_INVALID_CHANNEL)) {
 		afx_hdl->is_listen = false;
@@ -1158,7 +1156,8 @@ static s32 brcmf_p2p_af_searching_channel(struct brcmf_p2p_info *p2p)
 			  retry);
 		/* search peer on peer's listen channel */
 		schedule_work(&afx_hdl->afx_work);
-		wait_for_completion_timeout(&afx_hdl->act_frm_scan, duration);
+		wait_for_completion_timeout(&afx_hdl->act_frm_scan,
+					    P2P_AF_FRM_SCAN_MAX_WAIT);
 		if ((afx_hdl->peer_chan != P2P_INVALID_CHANNEL) ||
 		    (!test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL,
 			       &p2p->status)))
@@ -1171,7 +1170,7 @@ static s32 brcmf_p2p_af_searching_channel(struct brcmf_p2p_info *p2p)
 			afx_hdl->is_listen = true;
 			schedule_work(&afx_hdl->afx_work);
 			wait_for_completion_timeout(&afx_hdl->act_frm_scan,
-						    duration);
+						    P2P_AF_FRM_SCAN_MAX_WAIT);
 		}
 		if ((afx_hdl->peer_chan != P2P_INVALID_CHANNEL) ||
 		    (!test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL,
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] brcmfmac: fix full timeout waiting for action frame on-channel tx
  2018-09-27  9:44 [PATCH 0/2] WFA p2p certification fixes Chi-Hsien Lin
  2018-09-27  9:44 ` [PATCH 1/2] brcmfmac: reduce timeout for action frame scan Chi-Hsien Lin
@ 2018-09-27  9:44 ` Chi-Hsien Lin
  2018-09-27 14:58 ` [PATCH 0/2] WFA p2p certification fixes Chi-Hsien Lin
  2 siblings, 0 replies; 4+ messages in thread
From: Chi-Hsien Lin @ 2018-09-27  9:44 UTC (permalink / raw)
  To: linux-firmware
  Cc: linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
	Josh Boyer, Arend van Spriel, Franky Lin, Hante Meuleman,
	Wright Feng, Stanley Hsu, Chi-Hsien Lin

From: Chung-Hsien Hsu <stanley.hsu@cypress.com>

The driver sends an action frame down and waits for a completion signal
triggered by the received BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE event
to continue the process. However, the action frame could be transmitted
either on the current channel or on an off channel. For the on-channel
case, only BRCMF_E_ACTION_FRAME_COMPLETE event will be received when
the frame is transmitted, which make the driver always wait a full
timeout duration. This patch has the completion signal be triggered by
receiving the BRCMF_E_ACTION_FRAME_COMPLETE event for the on-channel
case.

This change fixes WFA p2p certification 5.1.19 failure.

Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 17 +++++++++++++++--
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h |  2 ++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index 7822740a8cb4..456a1bf008b3 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -1457,10 +1457,12 @@ int brcmf_p2p_notify_action_tx_complete(struct brcmf_if *ifp,
 		return 0;
 
 	if (e->event_code == BRCMF_E_ACTION_FRAME_COMPLETE) {
-		if (e->status == BRCMF_E_STATUS_SUCCESS)
+		if (e->status == BRCMF_E_STATUS_SUCCESS) {
 			set_bit(BRCMF_P2P_STATUS_ACTION_TX_COMPLETED,
 				&p2p->status);
-		else {
+			if (!p2p->wait_for_offchan_complete)
+				complete(&p2p->send_af_done);
+		} else {
 			set_bit(BRCMF_P2P_STATUS_ACTION_TX_NOACK, &p2p->status);
 			/* If there is no ack, we don't need to wait for
 			 * WLC_E_ACTION_FRAME_OFFCHAN_COMPLETE event
@@ -1511,6 +1513,17 @@ static s32 brcmf_p2p_tx_action_frame(struct brcmf_p2p_info *p2p,
 	p2p->af_sent_channel = le32_to_cpu(af_params->channel);
 	p2p->af_tx_sent_jiffies = jiffies;
 
+	if (test_bit(BRCMF_P2P_STATUS_DISCOVER_LISTEN, &p2p->status) &&
+	    p2p->af_sent_channel ==
+	    ieee80211_frequency_to_channel(p2p->remain_on_channel.center_freq))
+		p2p->wait_for_offchan_complete = false;
+	else
+		p2p->wait_for_offchan_complete = true;
+
+	brcmf_dbg(TRACE, "Waiting for %s tx completion event\n",
+		  (p2p->wait_for_offchan_complete) ?
+		   "off-channel" : "on-channel");
+
 	timeout = wait_for_completion_timeout(&p2p->send_af_done,
 					      P2P_AF_MAX_WAIT_TIME);
 
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
index 0e8b34d2d85c..39f0d0218088 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
@@ -124,6 +124,7 @@ struct afx_hdl {
  * @gon_req_action: about to send go negotiation requets frame.
  * @block_gon_req_tx: drop tx go negotiation requets frame.
  * @p2pdev_dynamically: is p2p device if created by module param or supplicant.
+ * @wait_for_offchan_complete: wait for off-channel tx completion event.
  */
 struct brcmf_p2p_info {
 	struct brcmf_cfg80211_info *cfg;
@@ -144,6 +145,7 @@ struct brcmf_p2p_info {
 	bool gon_req_action;
 	bool block_gon_req_tx;
 	bool p2pdev_dynamically;
+	bool wait_for_offchan_complete;
 };
 
 s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg, bool p2pdev_forced);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] WFA p2p certification fixes
  2018-09-27  9:44 [PATCH 0/2] WFA p2p certification fixes Chi-Hsien Lin
  2018-09-27  9:44 ` [PATCH 1/2] brcmfmac: reduce timeout for action frame scan Chi-Hsien Lin
  2018-09-27  9:44 ` [PATCH 2/2] brcmfmac: fix full timeout waiting for action frame on-channel tx Chi-Hsien Lin
@ 2018-09-27 14:58 ` Chi-Hsien Lin
  2 siblings, 0 replies; 4+ messages in thread
From: Chi-Hsien Lin @ 2018-09-27 14:58 UTC (permalink / raw)
  To: linux-firmware
  Cc: linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
	Josh Boyer, Arend van Spriel, Franky Lin, Hante Meuleman,
	Wright Feng

This is submitted to linux-firmware by mistake. It should have been sent 
to linux-wireless only. Please discard it. Sorry for the inconvenience.

I'll submit v2 to linux-wireless list only.

On 09/27/2018 5:44, Chi-Hsien Lin wrote:
> Fixes for WFA p2p certification 5.1.19 and 5.1.20 failures.
> 
> Chung-Hsien Hsu (2):
>    brcmfmac: reduce timeout for action frame scan
>    brcmfmac: fix full timeout waiting for action frame on-channel tx
> 
>   .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 26 ++++++++++++++++------
>   .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.h |  2 ++
>   2 files changed, 21 insertions(+), 7 deletions(-)
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-27 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27  9:44 [PATCH 0/2] WFA p2p certification fixes Chi-Hsien Lin
2018-09-27  9:44 ` [PATCH 1/2] brcmfmac: reduce timeout for action frame scan Chi-Hsien Lin
2018-09-27  9:44 ` [PATCH 2/2] brcmfmac: fix full timeout waiting for action frame on-channel tx Chi-Hsien Lin
2018-09-27 14:58 ` [PATCH 0/2] WFA p2p certification fixes Chi-Hsien Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.