All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <tony0620emma@gmail.com>, <kvalo@kernel.org>
Cc: <phhuang@realtek.com>, <linux-wireless@vger.kernel.org>
Subject: [PATCH v2 4/6] wifi: rtw88: Stop high queue during scan
Date: Fri, 16 Jun 2023 20:55:38 +0800	[thread overview]
Message-ID: <20230616125540.36877-5-pkshih@realtek.com> (raw)
In-Reply-To: <20230616125540.36877-1-pkshih@realtek.com>

From: Po-Hao Huang <phhuang@realtek.com>

When traversing channel list, TX in high queue should be disabled
along with beacon function, so packets won't be sent to incorrect
channels.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
v2: no change
---
 drivers/net/wireless/realtek/rtw88/main.c | 7 +++++--
 drivers/net/wireless/realtek/rtw88/reg.h  | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 9447a3aae3b5e..d55b041a6bb93 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2403,10 +2403,13 @@ void rtw_core_enable_beacon(struct rtw_dev *rtwdev, bool enable)
 	if (!rtwdev->ap_active)
 		return;
 
-	if (enable)
+	if (enable) {
 		rtw_write32_set(rtwdev, REG_BCN_CTRL, BIT_EN_BCN_FUNCTION);
-	else
+		rtw_write32_clr(rtwdev, REG_TXPAUSE, BIT_HIGH_QUEUE);
+	} else {
 		rtw_write32_clr(rtwdev, REG_BCN_CTRL, BIT_EN_BCN_FUNCTION);
+		rtw_write32_set(rtwdev, REG_TXPAUSE, BIT_HIGH_QUEUE);
+	}
 }
 
 MODULE_AUTHOR("Realtek Corporation");
diff --git a/drivers/net/wireless/realtek/rtw88/reg.h b/drivers/net/wireless/realtek/rtw88/reg.h
index 60de9de1cc7a8..7c6c11d50ff30 100644
--- a/drivers/net/wireless/realtek/rtw88/reg.h
+++ b/drivers/net/wireless/realtek/rtw88/reg.h
@@ -378,6 +378,7 @@
 #define BIT_SIFS_BK_EN		BIT(12)
 #define REG_TXPAUSE		0x0522
 #define BIT_AC_QUEUE		GENMASK(7, 0)
+#define BIT_HIGH_QUEUE		BIT(5)
 #define REG_RD_CTRL		0x0524
 #define BIT_EDCCA_MSK_CNTDOWN_EN BIT(11)
 #define BIT_DIS_TXOP_CFE	BIT(10)
-- 
2.25.1


  parent reply	other threads:[~2023-06-16 12:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 12:55 [PATCH v2 0/6] wifi: rtw88: correct AP and PS mode behaviors Ping-Ke Shih
2023-06-16 12:55 ` [PATCH v2 1/6] wifi: rtw88: use struct instead of macros to set TX desc Ping-Ke Shih
2023-06-21  9:42   ` Kalle Valo
2023-06-16 12:55 ` [PATCH v2 2/6] wifi: rtw88: Fix AP mode incorrect DTIM behavior Ping-Ke Shih
2023-06-16 12:55 ` [PATCH v2 3/6] wifi: rtw88: Skip high queue in hci_flush Ping-Ke Shih
2023-06-16 12:55 ` Ping-Ke Shih [this message]
2023-06-16 12:55 ` [PATCH v2 5/6] wifi: rtw88: refine register based H2C command Ping-Ke Shih
2023-06-16 12:55 ` [PATCH v2 6/6] wifi: rtw88: fix not entering PS mode after AP stops Ping-Ke Shih
2023-06-21  9:21 ` [PATCH v2 0/6] wifi: rtw88: correct AP and PS mode behaviors Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230616125540.36877-5-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=phhuang@realtek.com \
    --cc=tony0620emma@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.