From: Zhao Li <enderaoelyther@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Thomas Pedersen <thomas@adapt-ip.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Zhao Li <enderaoelyther@gmail.com>,
stable@vger.kernel.org
Subject: [PATCH v2 2/2] wifi: cfg80211: derive S1G beacon TSF from S1G fields
Date: Fri, 12 Jun 2026 00:19:46 +0800 [thread overview]
Message-ID: <20260611161943.91069-6-enderaoelyther@gmail.com> (raw)
In-Reply-To: <20260611161943.91069-4-enderaoelyther@gmail.com>
cfg80211_inform_bss_frame_data() parses S1G beacons with the extension
frame layout, but still reads the TSF from the regular probe response
layout after the S1G branch. For S1G beacons that reads bytes at the
regular management-frame timestamp offset instead of the S1G timestamp.
Use the 32-bit S1G beacon timestamp and the S1G Beacon Compatibility
element's TSF completion field when informing an S1G BSS. Keep the
regular management-frame timestamp read in the non-S1G branch.
Fixes: 9eaffe5078ca ("cfg80211: convert S1G beacon to scan results")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
---
net/wireless/scan.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 27a56ee2e8f0b..c90619eeb03b1 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -3309,14 +3309,15 @@ cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
bssid = ext->u.s1g_beacon.sa;
capability = le16_to_cpu(compat->compat_info);
beacon_interval = le16_to_cpu(compat->beacon_int);
+ tsf = le32_to_cpu(ext->u.s1g_beacon.timestamp);
+ tsf |= (u64)le32_to_cpu(compat->tsf_completion) << 32;
} else {
bssid = mgmt->bssid;
beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int);
capability = le16_to_cpu(mgmt->u.probe_resp.capab_info);
+ tsf = le64_to_cpu(mgmt->u.probe_resp.timestamp);
}
- tsf = le64_to_cpu(mgmt->u.probe_resp.timestamp);
-
if (ieee80211_is_probe_resp(mgmt->frame_control))
ftype = CFG80211_BSS_FTYPE_PRESP;
else if (ext)
--
2.50.1 (Apple Git-155)
next prev parent reply other threads:[~2026-06-11 16:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 16:27 [PATCH] wifi: mac80211: validate S1G beacon length before RX Zhao Li
2026-06-11 12:03 ` Johannes Berg
2026-06-11 16:19 ` [PATCH v2 0/2] wifi: handle S1G and extension-frame RX layout Zhao Li
2026-06-11 16:19 ` [PATCH v2 1/2] wifi: mac80211: validate extension-frame layout before RX Zhao Li
2026-06-11 16:19 ` Zhao Li [this message]
2026-06-12 2:28 ` [PATCH v2 2/2] wifi: cfg80211: derive S1G beacon TSF from S1G fields Lachlan Hodges
2026-06-12 0:54 ` [PATCH v2 0/2] wifi: handle S1G and extension-frame RX layout Lachlan Hodges
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=20260611161943.91069-6-enderaoelyther@gmail.com \
--to=enderaoelyther@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=thomas@adapt-ip.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