Skip to content

Commit c2852b5

Browse files
Zong-Zhe YangPing-Ke Shih
authored andcommitted
wifi: rtw89: report boottime of receiving beacon and probe response
Userspace tools will parse NL80211_BSS_LAST_SEEN_BOOTTIME (if any) for a more accurate timing when a BSS was seen. For example, iw, wpa_supplicant. For beacon and probe response, fill RX boottime_ns in ieee80211_rx_status. And for certain, it shouldn't count the waiting time for the PPDU status, i.e. the possible buffering time of a frame in driver. Signed-off-by: Zong-Zhe Yang <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 7e04f01 commit c2852b5

File tree

1 file changed

+7
-1
lines changed
  • drivers/net/wireless/realtek/rtw89

1 file changed

+7
-1
lines changed

drivers/net/wireless/realtek/rtw89/core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2796,9 +2796,11 @@ static void rtw89_core_stats_sta_rx_status(struct rtw89_dev *rtwdev,
27962796
}
27972797

27982798
static void rtw89_core_update_rx_status(struct rtw89_dev *rtwdev,
2799+
struct sk_buff *skb,
27992800
struct rtw89_rx_desc_info *desc_info,
28002801
struct ieee80211_rx_status *rx_status)
28012802
{
2803+
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
28022804
const struct cfg80211_chan_def *chandef =
28032805
rtw89_chandef_get(rtwdev, RTW89_CHANCTX_0);
28042806
u16 data_rate;
@@ -2810,6 +2812,10 @@ static void rtw89_core_update_rx_status(struct rtw89_dev *rtwdev,
28102812
rx_status->freq = chandef->chan->center_freq;
28112813
rx_status->band = chandef->chan->band;
28122814

2815+
if (ieee80211_is_beacon(hdr->frame_control) ||
2816+
ieee80211_is_probe_resp(hdr->frame_control))
2817+
rx_status->boottime_ns = ktime_get_boottime_ns();
2818+
28132819
if (rtwdev->scanning &&
28142820
RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD, &rtwdev->fw)) {
28152821
const struct rtw89_chan *cur = rtw89_scan_chan_get(rtwdev);
@@ -2966,7 +2972,7 @@ void rtw89_core_rx(struct rtw89_dev *rtwdev,
29662972

29672973
rx_status = IEEE80211_SKB_RXCB(skb);
29682974
memset(rx_status, 0, sizeof(*rx_status));
2969-
rtw89_core_update_rx_status(rtwdev, desc_info, rx_status);
2975+
rtw89_core_update_rx_status(rtwdev, skb, desc_info, rx_status);
29702976
rtw89_core_rx_pkt_hdl(rtwdev, skb, desc_info);
29712977
if (desc_info->long_rxdesc &&
29722978
BIT(desc_info->frame_type) & PPDU_FILTER_BITMAP)

0 commit comments

Comments
 (0)