aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-07-14 17:14:35 +0200
committerFelix Fietkau <nbd@nbd.name>2021-07-14 18:09:23 +0200
commit890bf06cef20015e2cec0274c87a9a2232691b6b (patch)
tree356865a43557943198e87d5010e9912493d27de1 /package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch
parent19228c456208776b2d9862fc1974c3e91c01a816 (diff)
downloadupstream-890bf06cef20015e2cec0274c87a9a2232691b6b.tar.gz
upstream-890bf06cef20015e2cec0274c87a9a2232691b6b.tar.bz2
upstream-890bf06cef20015e2cec0274c87a9a2232691b6b.zip
mac80211: backport SAR power limit support
Needed for an upcoming mt76 update Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch')
-rw-r--r--package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch b/package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch
new file mode 100644
index 0000000000..c351bc812a
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/385-mac80211-add-ieee80211_set_sar_specs.patch
@@ -0,0 +1,51 @@
+From: Carl Huang <cjhuang@codeaurora.org>
+Date: Thu, 3 Dec 2020 05:37:27 -0500
+Subject: [PATCH] mac80211: add ieee80211_set_sar_specs
+
+This change registers ieee80211_set_sar_specs to
+mac80211_config_ops, so cfg80211 can call it.
+
+Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
+Reviewed-by: Brian Norris <briannorris@chromium.org>
+Reviewed-by: Abhishek Kumar <kuabhs@chromium.org>
+Link: https://lore.kernel.org/r/20201203103728.3034-3-cjhuang@codeaurora.org
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -4207,6 +4207,8 @@ struct ieee80211_ops {
+ struct ieee80211_vif *vif);
+ void (*sta_set_4addr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta, bool enabled);
++ int (*set_sar_specs)(struct ieee80211_hw *hw,
++ const struct cfg80211_sar_specs *sar);
+ void (*sta_set_decap_offload)(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta, bool enabled);
+--- a/net/mac80211/cfg.c
++++ b/net/mac80211/cfg.c
+@@ -4136,6 +4136,17 @@ static int ieee80211_reset_tid_config(st
+ return ret;
+ }
+
++static int ieee80211_set_sar_specs(struct wiphy *wiphy,
++ struct cfg80211_sar_specs *sar)
++{
++ struct ieee80211_local *local = wiphy_priv(wiphy);
++
++ if (!local->ops->set_sar_specs)
++ return -EOPNOTSUPP;
++
++ return local->ops->set_sar_specs(&local->hw, sar);
++}
++
+ const struct cfg80211_ops mac80211_config_ops = {
+ .add_virtual_intf = ieee80211_add_iface,
+ .del_virtual_intf = ieee80211_del_iface,
+@@ -4239,4 +4250,5 @@ const struct cfg80211_ops mac80211_confi
+ .probe_mesh_link = ieee80211_probe_mesh_link,
+ .set_tid_config = ieee80211_set_tid_config,
+ .reset_tid_config = ieee80211_reset_tid_config,
++ .set_sar_specs = ieee80211_set_sar_specs,
+ };