Skip to content

Commit abe3f3d

Browse files
ryderlee1110nbd168
authored andcommitted
mt76: fill boottime_ns in Rx path
Give a proper boottime_ns value for netlink RX to avoid scan issues with Android. Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
1 parent a2e7596 commit abe3f3d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/wireless/mediatek/mt76/mac80211.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb,
801801
struct ieee80211_sta **sta)
802802
{
803803
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
804+
struct ieee80211_hdr *hdr = mt76_skb_get_hdr(skb);
804805
struct mt76_rx_status mstat;
805806

806807
mstat = *((struct mt76_rx_status *)skb->cb);
@@ -823,6 +824,10 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb,
823824
status->device_timestamp = mstat.timestamp;
824825
status->mactime = mstat.timestamp;
825826

827+
if (ieee80211_is_beacon(hdr->frame_control) ||
828+
ieee80211_is_probe_resp(hdr->frame_control))
829+
status->boottime_ns = ktime_get_boottime_ns();
830+
826831
BUILD_BUG_ON(sizeof(mstat) > sizeof(skb->cb));
827832
BUILD_BUG_ON(sizeof(status->chain_signal) !=
828833
sizeof(mstat.chain_signal));

0 commit comments

Comments
 (0)