All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rsi: Fix TX EAPOL packet handling against iwlwifi AP
@ 2020-10-15 11:16 Marek Vasut
  2020-11-07 11:32 ` Kalle Valo
  2021-05-27 16:52 ` Martin Fuzzey
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Vasut @ 2020-10-15 11:16 UTC (permalink / raw)
  To: netdev
  Cc: Marek Vasut, Angus Ainslie, David S . Miller, Jakub Kicinski,
	Kalle Valo, Lee Jones, Martin Kepplinger, Sebastian Krzyszkowiak,
	Siva Rebbagondla, linux-wireless

In case RSI9116 SDIO WiFi operates in STA mode against Intel 9260 in AP mode,
the association fails. The former is using wpa_supplicant during association,
the later is set up using hostapd:

iwl$ cat hostapd.conf
interface=wlp1s0
ssid=test
country_code=DE
hw_mode=g
channel=1
wpa=2
wpa_passphrase=test
wpa_key_mgmt=WPA-PSK
iwl$ hostapd -d hostapd.conf

rsi$ wpa_supplicant -i wlan0 -c <(wpa_passphrase test test)

The problem is that the TX EAPOL data descriptor RSI_DESC_REQUIRE_CFM_TO_HOST
flag and extended descriptor EAPOL4_CONFIRM frame type are not set in case the
AP is iwlwifi, because in that case the TX EAPOL packet is 2 bytes shorter.

The downstream vendor driver has this change in place already [1], however
there is no explanation for it, neither is there any commit history from which
such explanation could be obtained.

[1] https://github.com/SiliconLabs/RS911X-nLink-OSD/blob/master/rsi/rsi_91x_hal.c#L238

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Angus Ainslie <angus@akkea.ca>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Martin Kepplinger <martink@posteo.de>
Cc: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Cc: Siva Rebbagondla <siva8118@gmail.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
---
 drivers/net/wireless/rsi/rsi_91x_hal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c
index 3f7e3cfb6f00..ce9892152f4d 100644
--- a/drivers/net/wireless/rsi/rsi_91x_hal.c
+++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
@@ -248,7 +248,8 @@ int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb)
 			rsi_set_len_qno(&data_desc->len_qno,
 					(skb->len - FRAME_DESC_SZ),
 					RSI_WIFI_MGMT_Q);
-		if ((skb->len - header_size) == EAPOL4_PACKET_LEN) {
+		if (((skb->len - header_size) == EAPOL4_PACKET_LEN) ||
+		    ((skb->len - header_size) == EAPOL4_PACKET_LEN - 2)) {
 			data_desc->misc_flags |=
 				RSI_DESC_REQUIRE_CFM_TO_HOST;
 			xtend_desc->confirm_frame_type = EAPOL4_CONFIRM;
-- 
2.28.0


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

* Re: [PATCH] rsi: Fix TX EAPOL packet handling against iwlwifi AP
  2020-10-15 11:16 [PATCH] rsi: Fix TX EAPOL packet handling against iwlwifi AP Marek Vasut
@ 2020-11-07 11:32 ` Kalle Valo
  2021-05-27 16:52 ` Martin Fuzzey
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2020-11-07 11:32 UTC (permalink / raw)
  To: Marek Vasut
  Cc: netdev, Marek Vasut, Angus Ainslie, David S . Miller,
	Jakub Kicinski, Lee Jones, Martin Kepplinger,
	Sebastian Krzyszkowiak, Siva Rebbagondla, linux-wireless

Marek Vasut <marex@denx.de> wrote:

> In case RSI9116 SDIO WiFi operates in STA mode against Intel 9260 in AP mode,
> the association fails. The former is using wpa_supplicant during association,
> the later is set up using hostapd:
> 
> iwl$ cat hostapd.conf
> interface=wlp1s0
> ssid=test
> country_code=DE
> hw_mode=g
> channel=1
> wpa=2
> wpa_passphrase=test
> wpa_key_mgmt=WPA-PSK
> iwl$ hostapd -d hostapd.conf
> 
> rsi$ wpa_supplicant -i wlan0 -c <(wpa_passphrase test test)
> 
> The problem is that the TX EAPOL data descriptor RSI_DESC_REQUIRE_CFM_TO_HOST
> flag and extended descriptor EAPOL4_CONFIRM frame type are not set in case the
> AP is iwlwifi, because in that case the TX EAPOL packet is 2 bytes shorter.
> 
> The downstream vendor driver has this change in place already [1], however
> there is no explanation for it, neither is there any commit history from which
> such explanation could be obtained.
> 
> [1] https://github.com/SiliconLabs/RS911X-nLink-OSD/blob/master/rsi/rsi_91x_hal.c#L238
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Angus Ainslie <angus@akkea.ca>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Martin Kepplinger <martink@posteo.de>
> Cc: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
> Cc: Siva Rebbagondla <siva8118@gmail.com>
> Cc: linux-wireless@vger.kernel.org
> Cc: netdev@vger.kernel.org

Patch applied to wireless-drivers-next.git, thanks.

65277100caa2 rsi: Fix TX EAPOL packet handling against iwlwifi AP

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20201015111616.429220-1-marex@denx.de/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

* Re: [PATCH] rsi: Fix TX EAPOL packet handling against iwlwifi AP
  2020-10-15 11:16 [PATCH] rsi: Fix TX EAPOL packet handling against iwlwifi AP Marek Vasut
  2020-11-07 11:32 ` Kalle Valo
@ 2021-05-27 16:52 ` Martin Fuzzey
  2021-05-27 17:07   ` Marek Vasut
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Fuzzey @ 2021-05-27 16:52 UTC (permalink / raw)
  To: Marek Vasut, netdev
  Cc: Angus Ainslie, David S . Miller, Jakub Kicinski, Kalle Valo,
	Lee Jones, Martin Kepplinger, Sebastian Krzyszkowiak,
	Siva Rebbagondla, linux-wireless

Hi Marek,

I've just run into the same problem (on -5.4) and found your (now 
merged) patch


On 15/10/2020 13:16, Marek Vasut wrote:
> In case RSI9116 SDIO WiFi operates in STA mode against Intel 9260 in AP mode,
> the association fails. The former is using wpa_supplicant during association,
> the later is set up using hostapd:
>
> iwl$ cat hostapd.conf
> interface=wlp1s0
> ssid=test
> country_code=DE
> hw_mode=g
> channel=1
> wpa=2
> wpa_passphrase=test
> wpa_key_mgmt=WPA-PSK
> iwl$ hostapd -d hostapd.conf
>
> rsi$ wpa_supplicant -i wlan0 -c <(wpa_passphrase test test)
>
> The problem is that the TX EAPOL data descriptor RSI_DESC_REQUIRE_CFM_TO_HOST
> flag and extended descriptor EAPOL4_CONFIRM frame type are not set in case the
> AP is iwlwifi, because in that case the TX EAPOL packet is 2 bytes shorter.
>
> The downstream vendor driver has this change in place already [1], however
> there is no explanation for it, neither is there any commit history from which
> such explanation could be obtained.
>

I get this using 2 RSI9116 s, for both AP and STA using hostapd.
Comparing packet captures in the working and non working (without your 
patch) case shows that
the working case has a 802.11 QOS header whereas the non working case 
does not, hence the 2 byte difference.
The size of the EAPOL data is the same, it's the previous header that 
causes the problem...

This whole use the message size to determine the messages to ACK seems 
very fragile...

Regards,


Martin





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

* Re: [PATCH] rsi: Fix TX EAPOL packet handling against iwlwifi AP
  2021-05-27 16:52 ` Martin Fuzzey
@ 2021-05-27 17:07   ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2021-05-27 17:07 UTC (permalink / raw)
  To: Martin Fuzzey, netdev
  Cc: Angus Ainslie, David S . Miller, Jakub Kicinski, Kalle Valo,
	Lee Jones, Martin Kepplinger, Sebastian Krzyszkowiak,
	Siva Rebbagondla, linux-wireless

On 5/27/21 6:52 PM, Martin Fuzzey wrote:
> Hi Marek,

Hi,

> I've just run into the same problem (on -5.4) and found your (now 
> merged) patch

The patch should already be part of 5.4.y, no ?

> On 15/10/2020 13:16, Marek Vasut wrote:
>> In case RSI9116 SDIO WiFi operates in STA mode against Intel 9260 in 
>> AP mode,
>> the association fails. The former is using wpa_supplicant during 
>> association,
>> the later is set up using hostapd:
>>
>> iwl$ cat hostapd.conf
>> interface=wlp1s0
>> ssid=test
>> country_code=DE
>> hw_mode=g
>> channel=1
>> wpa=2
>> wpa_passphrase=test
>> wpa_key_mgmt=WPA-PSK
>> iwl$ hostapd -d hostapd.conf
>>
>> rsi$ wpa_supplicant -i wlan0 -c <(wpa_passphrase test test)
>>
>> The problem is that the TX EAPOL data descriptor 
>> RSI_DESC_REQUIRE_CFM_TO_HOST
>> flag and extended descriptor EAPOL4_CONFIRM frame type are not set in 
>> case the
>> AP is iwlwifi, because in that case the TX EAPOL packet is 2 bytes 
>> shorter.
>>
>> The downstream vendor driver has this change in place already [1], 
>> however
>> there is no explanation for it, neither is there any commit history 
>> from which
>> such explanation could be obtained.
>>
> 
> I get this using 2 RSI9116 s, for both AP and STA using hostapd.

Do I understand it correctly that two RSI9116 did not even work against 
one another as STA and AP respectively ? Sigh ...

> Comparing packet captures in the working and non working (without your 
> patch) case shows that
> the working case has a 802.11 QOS header whereas the non working case 
> does not, hence the 2 byte difference.
> The size of the EAPOL data is the same, it's the previous header that 
> causes the problem...
> 
> This whole use the message size to determine the messages to ACK seems 
> very fragile...

I'm not surprised, the quality of this driver is low and the 
documentation is lacking. Thanks for clarifying.

Do you think you can write and submit a patch which would fix this in a 
better way?

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

end of thread, other threads:[~2021-05-27 17:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 11:16 [PATCH] rsi: Fix TX EAPOL packet handling against iwlwifi AP Marek Vasut
2020-11-07 11:32 ` Kalle Valo
2021-05-27 16:52 ` Martin Fuzzey
2021-05-27 17:07   ` Marek Vasut

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.