All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ronald Ouyang <repaxan@gmail.com>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, Ronald Ouyang <repaxan@gmail.com>
Subject: [PATCH] wifi: ath12k: set OFFLOAD_ENCAP_4ADDR on interface bringup
Date: Wed, 11 Nov 2026 13:58:45 -0800	[thread overview]
Message-ID: <20261111215845.814490-1-repaxan@gmail.com> (raw)

I tried the WDS support added in https://lists.infradead.org/pipermail/ath12k/2026-May/009382.html.
With a ath12k WDS client, the frames received by the WDS AP had some extra bytes in the beginning of the frame.

My understanding of the problem:
1 - this is a WDS client, 4 address mode.
2 - on interface bringup (ath12k_mac_op_add_interface), it has OFFLOAD_ENCAP_ENABLED but not OFFLOAD_ENCAP_4ADDR.
    so it software encaps the ethernet frames and sends the resulting wifi frames to the vdev
3 - on vdev bringup (ath12k_mac_vdev_create -> ath12k_mac_update_vif_offload), it has OFFLOAD_ENCAP_ENABLED.
    so it expects to receive ethernet or "native wifi" frames.
    it also sets OFFLOAD_ENCAP_4ADDR but it's too late here
4 - the wifi frame from (2) gets passed to the vdev marked as "native wifi".
    it already had a QOS field in it, the vdev adds an extra one when doing the hardware encap

This fixes it by setting OFFLOAD_ENCAP_4ADDR during interface bringup.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Fixes: 729cad3c3c9e ("wifi: ath12k: Add 4-address mode support for eth offload")

Signed-off-by: Ronald Ouyang <repaxan@gmail.com>
---
 drivers/net/wireless/ath/ath12k/mac.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index afa3556480d3..1b1c3f738590 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -10275,7 +10275,8 @@ static void ath12k_mac_update_vif_offload(struct ath12k_link_vif *arvif)
 	if (ret) {
 		ath12k_warn(ab, "failed to set vdev %d tx encap mode: %d\n",
 			    arvif->vdev_id, ret);
-		vif->offload_flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
+		vif->offload_flags &= ~(IEEE80211_OFFLOAD_ENCAP_ENABLED |
+					IEEE80211_OFFLOAD_ENCAP_4ADDR);
 	}
 
 	if (vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED)
@@ -10939,6 +10940,9 @@ int ath12k_mac_op_add_interface(struct ieee80211_hw *hw,
 
 	vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD;
 
+	if (vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED)
+		vif->offload_flags |= IEEE80211_OFFLOAD_ENCAP_4ADDR;
+
 	ath12k_mac_determine_vdev_type(vif, ahvif);
 
 	for_each_ar(ah, ar, i) {
-- 
2.56.1


                 reply	other threads:[~2026-11-11 21:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261111215845.814490-1-repaxan@gmail.com \
    --to=repaxan@gmail.com \
    --cc=ath12k@lists.infradead.org \
    --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.