343-wifi-mac80211-fix-decap-offload-for-stations-on-AP_V.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From: Felix Fietkau <[email protected]>
  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. Since AP_VLAN interfaces are not passed to the driver, check offload_flags
  6. on the bss vif instead.
  7. Reported-by: Howard Hsu <[email protected]>
  8. Fixes: 80a915ec4427 ("mac80211: add rx decapsulation offload support")
  9. Signed-off-by: Felix Fietkau <[email protected]>
  10. ---
  11. --- a/net/mac80211/rx.c
  12. +++ b/net/mac80211/rx.c
  13. @@ -4267,6 +4267,7 @@ void ieee80211_check_fast_rx(struct sta_
  14. .vif_type = sdata->vif.type,
  15. .control_port_protocol = sdata->control_port_protocol,
  16. }, *old, *new = NULL;
  17. + u32 offload_flags;
  18. bool set_offload = false;
  19. bool assign = false;
  20. bool offload;
  21. @@ -4382,10 +4383,10 @@ void ieee80211_check_fast_rx(struct sta_
  22. if (assign)
  23. new = kmemdup(&fastrx, sizeof(fastrx), GFP_KERNEL);
  24. - offload = assign &&
  25. - (sdata->vif.offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED);
  26. + offload_flags = get_bss_sdata(sdata)->vif.offload_flags;
  27. + offload = offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED;
  28. - if (offload)
  29. + if (assign && offload)
  30. set_offload = !test_and_set_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);
  31. else
  32. set_offload = test_and_clear_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);