2021-07-16 00:52:36

by Larry Finger

[permalink] [raw]
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?

Thanks,

Larry


2021-07-16 03:19:34

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Difficulty connecting to AP using rtw89


> -----Original Message-----
> From: Larry Finger [mailto:[email protected]] 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



Attachments:
20210702_00_init_tp_regs.patch (1.36 kB)
20210702_00_init_tp_regs.patch

2021-07-16 16:41:29

by Larry Finger

[permalink] [raw]
Subject: Re: Difficulty connecting to AP using rtw89

On 7/15/21 10:17 PM, Pkshih wrote:
> 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,

Two of the 4 users with the problem have reported back that their device now
works. Thanks for the patch.

In a separate question, will v6 have provisions for IPv6?

Larry



2021-07-17 01:45:08

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Difficulty connecting to AP using rtw89



> -----Original Message-----
> From: Larry Finger [mailto:[email protected]] On Behalf Of Larry Finger
> Sent: Saturday, July 17, 2021 12:40 AM
> To: Pkshih; linux-wireless
> Subject: Re: Difficulty connecting to AP using rtw89
>
> On 7/15/21 10:17 PM, Pkshih wrote:
> > 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,
>
> Two of the 4 users with the problem have reported back that their device now
> works. Thanks for the patch.

Thanks for the help.

>
> In a separate question, will v6 have provisions for IPv6?
>

The driver handles L2 things only, but IPv6 that is L3 that we don't have special deal.
Could I know the problem you met?

--
Ping-Ke


2021-07-17 09:40:51

by Larry Finger

[permalink] [raw]
Subject: Re: Difficulty connecting to AP using rtw89

On 7/16/21 8:40 PM, Pkshih wrote:
>
>
>> -----Original Message-----
>> From: Larry Finger [mailto:[email protected]] On Behalf Of Larry Finger
>> In a separate question, will v6 have provisions for IPv6?
>>
>
> The driver handles L2 things only, but IPv6 that is L3 that we don't have special deal.
> Could I know the problem you met?

Personally, I do not use IPv6, but one of the users
(https://github.com/lwfinger/rtw89/issues/19) has bad IPv4 throughput with his
ISP, but better with IPv6. That doesn't make any sense to me, but I told him
that I would ask.

Sorry that I have not had time for reviewing the v5 code. There have been a
couple of emergencies with VirtualBox, which I maintain for openSUSE.

Larry

2021-07-19 02:47:42

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Difficulty connecting to AP using rtw89


> -----Original Message-----
> From: Larry Finger [mailto:[email protected]] On Behalf Of Larry Finger
> Sent: Saturday, July 17, 2021 5:40 PM
> To: Pkshih; linux-wireless
> Subject: Re: Difficulty connecting to AP using rtw89
>
> On 7/16/21 8:40 PM, Pkshih wrote:
> >
> >
> >> -----Original Message-----
> >> From: Larry Finger [mailto:[email protected]] On Behalf Of Larry Finger
> >> In a separate question, will v6 have provisions for IPv6?
> >>
> >
> > The driver handles L2 things only, but IPv6 that is L3 that we don't have special deal.
> > Could I know the problem you met?
>
> Personally, I do not use IPv6, but one of the users
> (https://github.com/lwfinger/rtw89/issues/19) has bad IPv4 throughput with his
> ISP, but better with IPv6. That doesn't make any sense to me, but I told him
> that I would ask.

I'm not sure if ISP limits the throughput or not.
My suggestion is to have another PC connected to AP with ethernet cable. Then,
do performance test between two PCs to check the difference between IPv4 and IPv6.

--
Ping-Ke

2021-08-07 00:13:52

by Jan Reusch

[permalink] [raw]
Subject: RE: Difficulty connecting to AP using rtw89

Hey hey
Hope this works and gets sorted right, i had to manually set the
in-reply-to header.

I'm one of the people having problems with ipv6 and the rtw89 driver.
i've tested it with the debian bullseye kernel and vanilla 5.13 from
kernel.org

It's about a Realtek 8852 in a Thinkpad E14 Gen2 (amd).

> > The driver handles L2 things only, but IPv6 that is L3 that we don't
> > have special deal.
> > Could I know the problem you met?

Yep that was also my first reaction 1:1, but it's 100% repdoducible.
Ethernet connection works, i get an v4 adress and an v6 one (SLAAC), it
works flawlessly with an USB wifi stick, but the integrated wifi only
gets the link local ipv6 address, an ipv4 one but nothing more.
I've tried to dump router advertisements, but none of them pop up. (As
soon as i attach the ethernet cable/usb wifi stick they're there...)
I have around ~10 other devices in the same network, all of them get
without any hazzle an v6 address via SLAAC and since some other people
seem to have the same problem in the github issue i'm really suspecting
the driver here...

If it maybe helps: this is what i get als output from ip(8) on a wifi
usb stick:
59: wlx801XXXXXXXXX: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq
state UP group default qlen 1000
link/ether 80:1f:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
inet 192.168.64.113/24 brd 192.168.64.255 scope global dynamic
noprefixroute wlx801XXXXXXXXX
valid_lft 862412sec preferred_lft 862412sec
inet6 fd00::1245:XXXX:XXXX:XXXX/64 scope global dynamic noprefixroute
valid_lft 6718sec preferred_lft 3118sec
inet6 2a02:8071:2cc3:XXX:XXXX:XXXX:XXXX:XXXX/64 scope global
dynamic noprefixroute
valid_lft 6718sec preferred_lft 3118sec
inet6 fe80::XX:XXXX:XXXX:XXXX/64 scope link noprefixroute
valid_lft forever preferred_lft forever

and this is what i get on the 8852:
4: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
state UP group default qlen 1000
link/ether 74:4c:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
inet 192.168.64.112/24 brd 192.168.64.255 scope global dynamic
noprefixroute wlp3s0
valid_lft 863997sec preferred_lft 863997sec
inet6 fe80::XXXX:XXXX:XXXX:XXX/64 scope link noprefixroute
valid_lft forever preferred_lft forever

i'd be glad to help to debug this any further, currently i'm also out of
ideas how the driver could impact L3...


> I'm not sure if ISP limits the throughput or not.
> My suggestion is to have another PC connected to AP with ethernet cable.
> Then,
> do performance test between two PCs to check the difference between IPv4
> and IPv6.

Please do not confused by this throughput problem, that's completely
independent.
The ipv4 performance of the driver seems to be enough, though i did not
measure it, but it's also not noticable slow :)
The only problem for me personally is that i only have a DS-Lite
connection from my ISP, which means for v4 i'm behind a carrier grade
nat - and the gateway (of the carrier) where my v4 traffic is routed
through seems to be heavily overloaded during some hours of the day.
So no worries for the driver here at all ;)

Thanks!
Cheers
Jan


--
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread
If you dont know what ~/.signature means , dont get your panties in a
knot, you already have a WinSBuLcOkWss virus.!

2021-08-09 06:07:27

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Difficulty connecting to AP using rtw89


> -----Original Message-----
> From: Jan Reusch [mailto:[email protected]]
> Sent: Saturday, August 07, 2021 4:19 AM
> To: [email protected]; Pkshih
> Subject: RE: Difficulty connecting to AP using rtw89
>
> Hey hey
> Hope this works and gets sorted right, i had to manually set the
> in-reply-to header.
>
> I'm one of the people having problems with ipv6 and the rtw89 driver.
> i've tested it with the debian bullseye kernel and vanilla 5.13 from
> kernel.org
>
> It's about a Realtek 8852 in a Thinkpad E14 Gen2 (amd).
>
> > > The driver handles L2 things only, but IPv6 that is L3 that we don't
> > > have special deal.
> > > Could I know the problem you met?
>
> Yep that was also my first reaction 1:1, but it's 100% repdoducible.
> Ethernet connection works, i get an v4 adress and an v6 one (SLAAC), it
> works flawlessly with an USB wifi stick, but the integrated wifi only
> gets the link local ipv6 address, an ipv4 one but nothing more.
> I've tried to dump router advertisements, but none of them pop up. (As
> soon as i attach the ethernet cable/usb wifi stick they're there...)

Could you provide your dump of USB wifi stick and rtw89?
If possible, I'd like to have tcpdump of interfaces locally and sniffer
packets in the air. Then, I can check the good and bad cases, and check
if any transmitting data is eaten by rtw89.

If the data have privacy problem, please send me directly.

[...]

Thank you
--
Ping-Ke


2021-08-16 00:46:59

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Difficulty connecting to AP using rtw89


> -----Original Message-----
> From: Pkshih [mailto:[email protected]]
> Sent: Monday, August 09, 2021 1:52 PM
> To: Jan Reusch; [email protected]
> Subject: RE: Difficulty connecting to AP using rtw89
>
> > -----Original Message-----
> > From: Jan Reusch [mailto:[email protected]]
> > Sent: Saturday, August 07, 2021 4:19 AM
> > To: [email protected]; Pkshih
> > Subject: RE: Difficulty connecting to AP using rtw89
> >
> > Hey hey
> > Hope this works and gets sorted right, i had to manually set the
> > in-reply-to header.
> >
> > I'm one of the people having problems with ipv6 and the rtw89 driver.
> > i've tested it with the debian bullseye kernel and vanilla 5.13 from
> > kernel.org
> >
> > It's about a Realtek 8852 in a Thinkpad E14 Gen2 (amd).
> >
> > > > The driver handles L2 things only, but IPv6 that is L3 that we don't
> > > > have special deal.
> > > > Could I know the problem you met?
> >
> > Yep that was also my first reaction 1:1, but it's 100% repdoducible.
> > Ethernet connection works, i get an v4 adress and an v6 one (SLAAC), it
> > works flawlessly with an USB wifi stick, but the integrated wifi only
> > gets the link local ipv6 address, an ipv4 one but nothing more.
> > I've tried to dump router advertisements, but none of them pop up. (As
> > soon as i attach the ethernet cable/usb wifi stick they're there...)
>
> Could you provide your dump of USB wifi stick and rtw89?
> If possible, I'd like to have tcpdump of interfaces locally and sniffer
> packets in the air. Then, I can check the good and bad cases, and check
> if any transmitting data is eaten by rtw89.
>

With Jan's help, we get this fixed.
This fix will be included in next submission recently. If people want this
fix right now, please checkout Larry's GitHub https://github.com/lwfinger/rtw89

Ping-Ke