summaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys
diff options
context:
space:
mode:
authorRobert Marko <robimarko@gmail.com>2023-10-12 12:24:06 +0200
committerNick Hainke <vincent@systemli.org>2023-10-14 08:26:56 +0200
commitaab2e6d9ae5c6cf2f2e6471d8cf24b9afd3bc69a (patch)
tree645aeefba06b253ccd3f5445f420382d2595615f /package/kernel/mac80211/patches/subsys
parentd19bf76da12e2e0f3652640a6207557b019f2566 (diff)
downloadopenwrt-aab2e6d9ae5c6cf2f2e6471d8cf24b9afd3bc69a.tar.gz
openwrt-aab2e6d9ae5c6cf2f2e6471d8cf24b9afd3bc69a.tar.bz2
openwrt-aab2e6d9ae5c6cf2f2e6471d8cf24b9afd3bc69a.zip
mac80211: backport upstream DFS CAC time export
DFS CAC time export is required for backport of a ath11k fix so lets backport the required cfg80211 upstream commit as well. Signed-off-by: Robert Marko <robimarko@gmail.com>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys')
-rw-r--r--package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch111
-rw-r--r--package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch8
2 files changed, 115 insertions, 4 deletions
diff --git a/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch b/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch
new file mode 100644
index 0000000000..78ec030e18
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch
@@ -0,0 +1,111 @@
+From 30ca8b0c4d6c9fb1d76e5894b1e8bf7c6a12224d Mon Sep 17 00:00:00 2001
+From: Aditya Kumar Singh <quic_adisi@quicinc.com>
+Date: Tue, 12 Sep 2023 10:48:55 +0530
+Subject: [PATCH] wifi: cfg80211: export DFS CAC time and usable state helper
+ functions
+
+cfg80211 has cfg80211_chandef_dfs_usable() function to know whether
+at least one channel in the chandef is in usable state or not. Also,
+cfg80211_chandef_dfs_cac_time() function is there which tells the CAC
+time required for the given chandef.
+
+Make these two functions visible to drivers by exporting their symbol
+to global list of kernel symbols.
+
+Lower level drivers can make use of these two functions to be aware
+if CAC is required on the given chandef and for how long. For example
+drivers which maintains the CAC state internally can make use of these.
+
+Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
+Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
+Link: https://lore.kernel.org/r/20230912051857.2284-2-quic_adisi@quicinc.com
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+ include/net/cfg80211.h | 24 ++++++++++++++++++++++++
+ net/wireless/chan.c | 2 ++
+ net/wireless/core.h | 17 -----------------
+ 3 files changed, 26 insertions(+), 17 deletions(-)
+
+--- a/include/net/cfg80211.h
++++ b/include/net/cfg80211.h
+@@ -1008,6 +1008,30 @@ int cfg80211_chandef_dfs_required(struct
+ enum nl80211_iftype iftype);
+
+ /**
++ * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable and we
++ * can/need start CAC on such channel
++ * @wiphy: the wiphy to validate against
++ * @chandef: the channel definition to check
++ *
++ * Return: true if all channels available and at least
++ * one channel requires CAC (NL80211_DFS_USABLE)
++ */
++bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
++ const struct cfg80211_chan_def *chandef);
++
++/**
++ * cfg80211_chandef_dfs_cac_time - get the DFS CAC time (in ms) for given
++ * channel definition
++ * @wiphy: the wiphy to validate against
++ * @chandef: the channel definition to check
++ *
++ * Returns: DFS CAC time (in ms) which applies for this channel definition
++ */
++unsigned int
++cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy,
++ const struct cfg80211_chan_def *chandef);
++
++/**
+ * nl80211_send_chandef - sends the channel definition.
+ * @msg: the msg to send channel definition
+ * @chandef: the channel definition to check
+--- a/net/wireless/chan.c
++++ b/net/wireless/chan.c
+@@ -666,6 +666,7 @@ bool cfg80211_chandef_dfs_usable(struct
+
+ return (r1 + r2 > 0);
+ }
++EXPORT_SYMBOL(cfg80211_chandef_dfs_usable);
+
+ /*
+ * Checks if center frequency of chan falls with in the bandwidth
+@@ -965,6 +966,7 @@ cfg80211_chandef_dfs_cac_time(struct wip
+
+ return max(t1, t2);
+ }
++EXPORT_SYMBOL(cfg80211_chandef_dfs_cac_time);
+
+ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
+ u32 center_freq, u32 bandwidth,
+--- a/net/wireless/core.h
++++ b/net/wireless/core.h
+@@ -469,29 +469,12 @@ int cfg80211_scan(struct cfg80211_regist
+
+ extern struct work_struct cfg80211_disconnect_work;
+
+-/**
+- * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable
+- * @wiphy: the wiphy to validate against
+- * @chandef: the channel definition to check
+- *
+- * Checks if chandef is usable and we can/need start CAC on such channel.
+- *
+- * Return: true if all channels available and at least
+- * one channel requires CAC (NL80211_DFS_USABLE)
+- */
+-bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
+- const struct cfg80211_chan_def *chandef);
+-
+ void cfg80211_set_dfs_state(struct wiphy *wiphy,
+ const struct cfg80211_chan_def *chandef,
+ enum nl80211_dfs_state dfs_state);
+
+ void cfg80211_dfs_channels_update_work(struct work_struct *work);
+
+-unsigned int
+-cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy,
+- const struct cfg80211_chan_def *chandef);
+-
+ void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);
+
+ int
diff --git a/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch b/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch
index d04b1165bf..28e2144f7f 100644
--- a/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch
+++ b/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch
@@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
}
-@@ -873,6 +875,49 @@ static bool cfg80211_get_chans_dfs_avail
+@@ -874,6 +876,49 @@ static bool cfg80211_get_chans_dfs_avail
return true;
}
@@ -113,15 +113,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
{
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
-@@ -487,6 +487,8 @@ void cfg80211_set_dfs_state(struct wiphy
+@@ -474,6 +474,8 @@ void cfg80211_set_dfs_state(struct wiphy
enum nl80211_dfs_state dfs_state);
void cfg80211_dfs_channels_update_work(struct work_struct *work);
+void cfg80211_update_last_available(struct wiphy *wiphy,
+ const struct cfg80211_chan_def *chandef);
- unsigned int
- cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy,
+ void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);
+
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -915,6 +915,8 @@ void cfg80211_dfs_channels_update_work(s