netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Marek Vasut <marex@denx.de>
Cc: linux-wireless@vger.kernel.org,
	Amitkumar Karwar <amit.karwar@redpinesignals.com>,
	Angus Ainslie <angus@akkea.ca>, Jakub Kicinski <kuba@kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Martin Fuzzey <martin.fuzzey@flowbird.group>,
	Martin Kepplinger <martink@posteo.de>,
	Prameela Rani Garnepudi <prameela.j04cs@gmail.com>,
	Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>,
	Siva Rebbagondla <siva8118@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH v5] wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port
Date: Mon, 07 Nov 2022 14:37:11 +0200	[thread overview]
Message-ID: <87o7tjszyg.fsf@kernel.org> (raw)
In-Reply-To: <20221104163339.227432-1-marex@denx.de> (Marek Vasut's message of "Fri, 4 Nov 2022 17:33:39 +0100")

Marek Vasut <marex@denx.de> writes:

> When using wpa_supplicant v2.10, this driver is no longer able to
> associate with any AP and fails in the EAPOL 4-way handshake while
> sending the 2/4 message to the AP. The problem is not present in
> wpa_supplicant v2.9 or older. The problem stems from HostAP commit
> 144314eaa ("wpa_supplicant: Send EAPOL frames over nl80211 where available")
> which changes the way EAPOL frames are sent, from them being send
> at L2 frames to them being sent via nl80211 control port.
>
> An EAPOL frame sent as L2 frame is passed to the WiFi driver with
> skb->protocol ETH_P_PAE, while EAPOL frame sent via nl80211 control
> port has skb->protocol set to ETH_P_802_3 . The later happens in
> ieee80211_tx_control_port(), where the EAPOL frame is encapsulated
> into 802.3 frame.
>
> The rsi_91x driver handles ETH_P_PAE EAPOL frames as high-priority
> frames and sends them via highest-priority transmit queue, while
> the ETH_P_802_3 frames are sent as regular frames. The EAPOL 4-way
> handshake frames must be sent as highest-priority, otherwise the
> 4-way handshake times out.
>
> Therefore, to fix this problem, inspect the skb control flags and
> if flag IEEE80211_TX_CTRL_PORT_CTRL_PROTO is set, assume this is
> an EAPOL frame and transmit the frame via high-priority queue just
> like other ETH_P_PAE frames.
>
> Fixes: 0eb42586cf87 ("rsi: data packet descriptor enhancements")
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> NOTE: I am really unsure about the method of finding out the exact
>       place of ethernet header in the encapsulated packet and then
>       extracting the ethertype from it. Is there maybe some sort of
>       helper function for that purpose ?
> ---
> V2: - Turn the duplicated code into common function
> V3: - Simplify the TX EAPOL detection (Johannes)
> V4: - Drop the double !!() from test
>     - Update commit message
> V5: - Inline the rsi_is_tx_eapol() again, undoes V2 change completely

BTW did you test this on a real device?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

  reply	other threads:[~2022-11-07 12:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 16:33 [PATCH v5] wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port Marek Vasut
2022-11-07 12:37 ` Kalle Valo [this message]
2022-11-07 13:23   ` Marek Vasut
2022-11-07 13:54     ` Kalle Valo
2022-11-07 14:44       ` Marek Vasut
2022-11-07 16:50         ` Fuzzey, Martin
2022-11-09 16:20         ` Kalle Valo
2022-11-09 18:17           ` Marek Vasut
2022-11-10  5:39             ` Kalle Valo
2022-11-13 18:59               ` Marek Vasut
2022-11-14 12:57                 ` Kalle Valo
2022-11-08  7:41 ` 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=87o7tjszyg.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=amit.karwar@redpinesignals.com \
    --cc=angus@akkea.ca \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=martin.fuzzey@flowbird.group \
    --cc=martink@posteo.de \
    --cc=netdev@vger.kernel.org \
    --cc=prameela.j04cs@gmail.com \
    --cc=sebastian.krzyszkowiak@puri.sm \
    --cc=siva8118@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).