319-v4.17-0003-mac80211-support-fast-rx-with-incompatible-PS-capabi.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From: Felix Fietkau <[email protected]>
  2. Date: Fri, 23 Feb 2018 10:01:53 +0100
  3. Subject: [PATCH] mac80211: support fast-rx with incompatible PS
  4. capabilities when PS is disabled
  5. When powersave is disabled for the interface, we can do fast-rx anyway.
  6. Signed-off-by: Felix Fietkau <[email protected]>
  7. ---
  8. --- a/net/mac80211/cfg.c
  9. +++ b/net/mac80211/cfg.c
  10. @@ -2658,6 +2658,7 @@ static int ieee80211_set_power_mgmt(stru
  11. ieee80211_recalc_ps(local);
  12. ieee80211_recalc_ps_vif(sdata);
  13. + ieee80211_check_fast_rx_iface(sdata);
  14. return 0;
  15. }
  16. --- a/net/mac80211/rx.c
  17. +++ b/net/mac80211/rx.c
  18. @@ -3741,12 +3741,7 @@ void ieee80211_check_fast_rx(struct sta_
  19. /* 4-addr is harder to deal with, later maybe */
  20. if (sdata->u.mgd.use_4addr)
  21. goto clear;
  22. - /* software powersave is a huge mess, avoid all of it */
  23. - if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK))
  24. - goto clear;
  25. - if (ieee80211_hw_check(&local->hw, SUPPORTS_PS) &&
  26. - !ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
  27. - goto clear;
  28. +
  29. if (sta->sta.tdls) {
  30. fastrx.da_offs = offsetof(struct ieee80211_hdr, addr1);
  31. fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr2);
  32. @@ -3758,6 +3753,16 @@ void ieee80211_check_fast_rx(struct sta_
  33. fastrx.expected_ds_bits =
  34. cpu_to_le16(IEEE80211_FCTL_FROMDS);
  35. }
  36. +
  37. + if (!sdata->u.mgd.powersave)
  38. + break;
  39. +
  40. + /* software powersave is a huge mess, avoid all of it */
  41. + if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK))
  42. + goto clear;
  43. + if (ieee80211_hw_check(&local->hw, SUPPORTS_PS) &&
  44. + !ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
  45. + goto clear;
  46. break;
  47. case NL80211_IFTYPE_AP_VLAN:
  48. case NL80211_IFTYPE_AP: