All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pkshih <pkshih@realtek.com>
To: Larry Finger <Larry.Finger@lwfinger.net>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: RE: Difficulty connecting to AP using rtw89
Date: Fri, 16 Jul 2021 03:17:48 +0000	[thread overview]
Message-ID: <d74a6a489b2f466eb66df3f5f965a1fa@realtek.com> (raw)
In-Reply-To: <f2ee1dbd-28b5-a1e6-8f41-e7ed8dfc2521@lwfinger.net>

[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]


> -----Original Message-----
> From: Larry Finger [mailto:larry.finger@gmail.com] On Behalf Of Larry Finger
> Sent: Friday, July 16, 2021 8:52 AM
> To: linux-wireless
> Subject: Difficulty connecting to AP using rtw89
> 
> Hi,
> 
> I am trying to help some users of my GitHub repo for rtw89. Several are having
> problems trying to connect to their APs. When their AP scan lists the following:
> 
> WPA:	 * Version: 1
> 	 * Group cipher: TKIP
> 	 * Pairwise ciphers: TKIP
> 	 * Authentication suites: PSK
> RSN:	 * Version: 1
> 	 * Group cipher: TKIP
> 	 * Pairwise ciphers: CCMP
> 	 * Authentication suites: PSK
> 	 * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
> 
> I have no problems. My scan results show:
> 
>          RSN:     * Version: 1
>                   * Group cipher: CCMP
>                   * Pairwise ciphers: CCMP
>                   * Authentication suites: PSK
>                   * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
> 
> At least one of them can connect to a hotspot created on his phone; however, it
> also shows Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c). I have tried to
> discover what causes the difference between this value and that of Capabilities:
> 1-PTKSA-RC 1-GTKSA-RC (0x0000). No matter how I setup my APs, I always get
> 16-PTKSA-RC.
> 
> Can anyone help me understand this problem?
> 

Hi Larry,

I'm not sure if the problem the users met is related to security or not.
But, we have a solution to deal with similar symptom. 
Please apply and try attached patch to see if it is helpful.

--
Ping-Ke



[-- Attachment #2: 20210702_00_init_tp_regs.patch --]
[-- Type: application/octet-stream, Size: 1389 bytes --]

diff --git a/reg.h b/reg.h
index 51b5969..bbb0ff0 100644
--- a/reg.h
+++ b/reg.h
@@ -1379,6 +1379,8 @@
 #define R_AX_PWR_LMT_MAX 0xD338
 #define R_AX_PWR_RU_LMT 0xD33C
 #define R_AX_PWR_RU_LMT_MAX 0xD368
+#define R_AX_PWR_MACID_TABLE0 0xD36C
+#define R_AX_PWR_MACID_TABLE127 0xD568
 
 #define R_AX_TXPWR_IMR 0xD9E0
 #define R_AX_TXPWR_IMR_C1 0xF9E0
diff --git a/rtw8852a.c b/rtw8852a.c
index 7769e8b..70c960b 100644
--- a/rtw8852a.c
+++ b/rtw8852a.c
@@ -1097,6 +1097,15 @@ static void rtw8852a_bb_reset(struct rtw89_dev *rtwdev,
 	rtw89_phy_write32_clr(rtwdev, R_P1_TSSI_TRK, B_P1_TSSI_TRK_EN);
 }
 
+static void rtw8852a_bb_macid_ctrl_init(struct rtw89_dev *rtwdev,
+					enum rtw89_phy_idx phy_idx)
+{
+	u32 addr;
+
+	for (addr = R_AX_PWR_MACID_TABLE0; addr <= R_AX_PWR_MACID_TABLE127; addr += 4)
+		rtw89_mac_txpwr_write32(rtwdev, phy_idx, addr, 0);
+}
+
 static void rtw8852a_bb_sethw(struct rtw89_dev *rtwdev)
 {
 	rtw89_phy_write32_clr(rtwdev, R_P0_EN_SOUND_WO_NDP, B_P0_EN_SOUND_WO_NDP);
@@ -1117,6 +1126,8 @@ static void rtw8852a_bb_sethw(struct rtw89_dev *rtwdev)
 	rtw89_phy_write32_idx(rtwdev, R_MAC_SEL, B_MAC_SEL_MOD, 0x0, RTW89_PHY_1);
 	rtw89_phy_write32_clr(rtwdev, R_NDP_BRK0, B_NDP_RU_BRK);
 	rtw89_phy_write32_set(rtwdev, R_NDP_BRK1, B_NDP_RU_BRK);
+
+	rtw8852a_bb_macid_ctrl_init(rtwdev, RTW89_PHY_0);
 }
 
 static void rtw8852a_bbrst_for_rfk(struct rtw89_dev *rtwdev,

  reply	other threads:[~2021-07-16  3:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16  0:51 Difficulty connecting to AP using rtw89 Larry Finger
2021-07-16  3:17 ` Pkshih [this message]
2021-07-16 16:40   ` Larry Finger
2021-07-17  1:40     ` Pkshih
2021-07-17  9:39       ` Larry Finger
2021-07-19  2:44         ` Pkshih
2021-08-06 20:18           ` Jan Reusch
2021-08-09  5:52             ` Pkshih
2021-08-16  0:45               ` Pkshih

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=d74a6a489b2f466eb66df3f5f965a1fa@realtek.com \
    --to=pkshih@realtek.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-wireless@vger.kernel.org \
    /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.