ethtool: update to v5.14
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / subsys / 385-mac80211-add-ieee80211_set_sar_specs.patch
1 From: Carl Huang <cjhuang@codeaurora.org>
2 Date: Thu, 3 Dec 2020 05:37:27 -0500
3 Subject: [PATCH] mac80211: add ieee80211_set_sar_specs
4
5 This change registers ieee80211_set_sar_specs to
6 mac80211_config_ops, so cfg80211 can call it.
7
8 Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
9 Reviewed-by: Brian Norris <briannorris@chromium.org>
10 Reviewed-by: Abhishek Kumar <kuabhs@chromium.org>
11 Link: https://lore.kernel.org/r/20201203103728.3034-3-cjhuang@codeaurora.org
12 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 ---
14
15 --- a/include/net/mac80211.h
16 +++ b/include/net/mac80211.h
17 @@ -4207,6 +4207,8 @@ struct ieee80211_ops {
18 struct ieee80211_vif *vif);
19 void (*sta_set_4addr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
20 struct ieee80211_sta *sta, bool enabled);
21 + int (*set_sar_specs)(struct ieee80211_hw *hw,
22 + const struct cfg80211_sar_specs *sar);
23 void (*sta_set_decap_offload)(struct ieee80211_hw *hw,
24 struct ieee80211_vif *vif,
25 struct ieee80211_sta *sta, bool enabled);
26 --- a/net/mac80211/cfg.c
27 +++ b/net/mac80211/cfg.c
28 @@ -4136,6 +4136,17 @@ static int ieee80211_reset_tid_config(st
29 return ret;
30 }
31
32 +static int ieee80211_set_sar_specs(struct wiphy *wiphy,
33 + struct cfg80211_sar_specs *sar)
34 +{
35 + struct ieee80211_local *local = wiphy_priv(wiphy);
36 +
37 + if (!local->ops->set_sar_specs)
38 + return -EOPNOTSUPP;
39 +
40 + return local->ops->set_sar_specs(&local->hw, sar);
41 +}
42 +
43 const struct cfg80211_ops mac80211_config_ops = {
44 .add_virtual_intf = ieee80211_add_iface,
45 .del_virtual_intf = ieee80211_del_iface,
46 @@ -4239,4 +4250,5 @@ const struct cfg80211_ops mac80211_confi
47 .probe_mesh_link = ieee80211_probe_mesh_link,
48 .set_tid_config = ieee80211_set_tid_config,
49 .reset_tid_config = ieee80211_reset_tid_config,
50 + .set_sar_specs = ieee80211_set_sar_specs,
51 };