1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 28 Sep 2022 13:50:34 +0200
3 Subject: [PATCH] wifi: mac80211: fix decap offload for stations on AP_VLAN
6 Since AP_VLAN interfaces are not passed to the driver, check offload_flags
7 on the bss vif instead.
9 Reported-by: Howard Hsu <howard-yh.hsu@mediatek.com>
10 Fixes: 80a915ec4427 ("mac80211: add rx decapsulation offload support")
11 Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 --- a/net/mac80211/rx.c
15 +++ b/net/mac80211/rx.c
16 @@ -4267,6 +4267,7 @@ void ieee80211_check_fast_rx(struct sta_
17 .vif_type = sdata->vif.type,
18 .control_port_protocol = sdata->control_port_protocol,
21 bool set_offload = false;
24 @@ -4382,10 +4383,10 @@ void ieee80211_check_fast_rx(struct sta_
26 new = kmemdup(&fastrx, sizeof(fastrx), GFP_KERNEL);
29 - (sdata->vif.offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED);
30 + offload_flags = get_bss_sdata(sdata)->vif.offload_flags;
31 + offload = offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED;
34 + if (assign && offload)
35 set_offload = !test_and_set_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);
37 set_offload = test_and_clear_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);