iwinfo: fix 6e channel calculation

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2022-05-12 11:45:30 +02:00
parent 63ab76bb30
commit 9650f8eaa8

View File

@@ -0,0 +1,33 @@
From f057826fed0208c369ca9483092c706bf5c9ae9e Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Thu, 12 May 2022 09:31:11 +0200
Subject: [PATCH] iwinfo: add 6E support
Signed-off-by: John Crispin <john@phrozen.org>
---
package/network/utils/iwinfo/patches/100-6g.patch | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 package/network/utils/iwinfo/patches/100-6g.patch
diff --git a/package/network/utils/iwinfo/patches/100-6g.patch b/package/network/utils/iwinfo/patches/100-6g.patch
new file mode 100644
index 0000000000..45472e8ccf
--- /dev/null
+++ b/package/network/utils/iwinfo/patches/100-6g.patch
@@ -0,0 +1,13 @@
+Index: libiwinfo-2021-06-09-c0414642/iwinfo_nl80211.c
+===================================================================
+--- libiwinfo-2021-06-09-c0414642.orig/iwinfo_nl80211.c
++++ libiwinfo-2021-06-09-c0414642/iwinfo_nl80211.c
+@@ -642,6 +642,8 @@ static int nl80211_freq2channel(int freq
+ return (freq - 4000) / 5;
+ else if(freq >= 56160 + 2160 * 1 && freq <= 56160 + 2160 * 6)
+ return (freq - 56160) / 2160;
++ else if (freq >= 5955 && freq <= 7115)
++ return (freq - 5950) / 5;
+ else
+ return (freq - 5000) / 5;
+ }
--
2.25.1