mirror of
https://github.com/FUjr/gl-infra-builder.git
synced 2025-12-16 09:10:02 +00:00
85 lines
2.6 KiB
Diff
85 lines
2.6 KiB
Diff
From 46225b160074ee5c7f00cf41afd07732fdebcb91 Mon Sep 17 00:00:00 2001
|
|
From: Jianhui Zhao <jianhui.zhao@gl-inet.com>
|
|
Date: Wed, 22 Mar 2023 09:42:24 +0800
|
|
Subject: [PATCH] mac80211: support bypass cac
|
|
|
|
Signed-off-by: Jianhui Zhao <jianhui.zhao@gl-inet.com>
|
|
---
|
|
.../subsys/786-support-bypass-cac.patch | 64 +++++++++++++++++++
|
|
1 file changed, 64 insertions(+)
|
|
create mode 100644 package/kernel/mac80211/patches/subsys/786-support-bypass-cac.patch
|
|
|
|
diff --git a/package/kernel/mac80211/patches/subsys/786-support-bypass-cac.patch b/package/kernel/mac80211/patches/subsys/786-support-bypass-cac.patch
|
|
new file mode 100644
|
|
index 0000000000..ab624636f6
|
|
--- /dev/null
|
|
+++ b/package/kernel/mac80211/patches/subsys/786-support-bypass-cac.patch
|
|
@@ -0,0 +1,64 @@
|
|
+--- a/net/mac80211/debugfs.c
|
|
++++ b/net/mac80211/debugfs.c
|
|
+@@ -653,6 +653,42 @@ static const struct file_operations scan
|
|
+ .llseek = default_llseek,
|
|
+ };
|
|
+
|
|
++static ssize_t bypass_cac_write(struct file *file, const char __user *ptr,
|
|
++ size_t len, loff_t *off)
|
|
++{
|
|
++ struct ieee80211_local *local = file->private_data;
|
|
++ struct ieee80211_sub_if_data *sdata;
|
|
++
|
|
++ rtnl_lock();
|
|
++ wiphy_lock(local->hw.wiphy);
|
|
++ mutex_lock(&local->mtx);
|
|
++
|
|
++ list_for_each_entry(sdata, &local->interfaces, list) {
|
|
++ struct wireless_dev *wdev = &sdata->wdev;
|
|
++
|
|
++ cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
|
|
++
|
|
++ if (wdev->cac_started) {
|
|
++ pr_info("bypass cac for %s\n", sdata->name);
|
|
++ wdev->cac_time_ms = 0;
|
|
++ ieee80211_queue_delayed_work(&sdata->local->hw,
|
|
++ &sdata->dfs_cac_timer_work, 0);
|
|
++ }
|
|
++ }
|
|
++
|
|
++ mutex_unlock(&local->mtx);
|
|
++ wiphy_unlock(local->hw.wiphy);
|
|
++ rtnl_unlock();
|
|
++
|
|
++ return len;
|
|
++}
|
|
++
|
|
++static const struct file_operations bypass_cac_ops = {
|
|
++ .write = bypass_cac_write,
|
|
++ .open = simple_open,
|
|
++ .llseek = noop_llseek,
|
|
++};
|
|
++
|
|
+ void debugfs_hw_add(struct ieee80211_local *local)
|
|
+ {
|
|
+ struct dentry *phyd = local->hw.wiphy->debugfsdir;
|
|
+@@ -725,4 +761,5 @@ void debugfs_hw_add(struct ieee80211_loc
|
|
+ DEBUGFS_DEVSTATS_ADD(dot11RTSSuccessCount);
|
|
+
|
|
+ DEBUGFS_ADD(scanning);
|
|
++ DEBUGFS_ADD_MODE(bypass_cac, 0200);
|
|
+ }
|
|
+--- a/net/wireless/mlme.c
|
|
++++ b/net/wireless/mlme.c
|
|
+@@ -957,7 +957,9 @@ void cfg80211_cac_event(struct net_devic
|
|
+ memcpy(&rdev->cac_done_chandef, chandef,
|
|
+ sizeof(struct cfg80211_chan_def));
|
|
+ queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk);
|
|
+- cfg80211_sched_dfs_chan_update(rdev);
|
|
++ cancel_delayed_work(&rdev->dfs_update_channels_wk);
|
|
++ if (wdev->cac_time_ms > 0)
|
|
++ queue_delayed_work(cfg80211_wq, &rdev->dfs_update_channels_wk, 0);
|
|
+ fallthrough;
|
|
+ case NL80211_RADAR_CAC_ABORTED:
|
|
+ wdev->cac_started = false;
|
|
--
|
|
2.34.1
|
|
|