0feb408d218172a494bc35f4a1e639f9e76b541a
[openwrt/staging/hauke.git] /
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
4 interfaces
5
6 Since AP_VLAN interfaces are not passed to the driver, check offload_flags
7 on the bss vif instead.
8
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>
12 ---
13
14 --- a/net/mac80211/rx.c
15 +++ b/net/mac80211/rx.c
16 @@ -4265,6 +4265,7 @@ void ieee80211_check_fast_rx(struct sta_
17 .vif_type = sdata->vif.type,
18 .control_port_protocol = sdata->control_port_protocol,
19 }, *old, *new = NULL;
20 + u32 offload_flags;
21 bool set_offload = false;
22 bool assign = false;
23 bool offload;
24 @@ -4380,10 +4381,10 @@ void ieee80211_check_fast_rx(struct sta_
25 if (assign)
26 new = kmemdup(&fastrx, sizeof(fastrx), GFP_KERNEL);
27
28 - offload = assign &&
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;
32
33 - if (offload)
34 + if (assign && offload)
35 set_offload = !test_and_set_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);
36 else
37 set_offload = test_and_clear_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);