OpenWrt 2.3GHz - 2.7GHz Channel

There are no simple standard ways to achieve what you want. In order to use nonstandard frequencies, you have to modify the ath9k driver.

1 Like

How to do that? Any guide available to follow?

I have modified the 2 patches and applied to my wr841nd v11. But the channel list is ever the same, only 13 channel. Should be i have to make other modification in the art partition?

diff -pur a/src/ap/hw_features.c b/src/ap/hw_features.c
--- a/src/ap/hw_features.c    2017-01-27 00:09:12.314728000 +0100
+++ b/src/ap/hw_features.c    2017-01-27 02:56:05.813277300 +0100
@@ -911,10 +911,7 @@ int hostapd_select_hw_mode(struct hostap
     if ((iface->conf->hw_mode == HOSTAPD_MODE_IEEE80211G ||
          iface->conf->ieee80211n || iface->conf->ieee80211ac) &&
         iface->conf->channel == 14) {
-        wpa_printf(MSG_INFO, "Disable OFDM/HT/VHT on channel 14");
-        iface->conf->hw_mode = HOSTAPD_MODE_IEEE80211B;
-        iface->conf->ieee80211n = 0;
-        iface->conf->ieee80211ac = 0;
+        iface->conf->hw_mode = HOSTAPD_MODE_IEEE80211G;
     }
 
     iface->current_mode = NULL;
diff -pur a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
--- a/src/common/ieee802_11_common.c    2017-01-27 02:01:29.732186000 +0100
+++ b/src/common/ieee802_11_common.c    2017-01-27 02:59:54.902397265 +0100
@@ -629,13 +629,498 @@ enum hostapd_hw_mode ieee80211_freq_to_c
         return HOSTAPD_MODE_IEEE80211G;
     }
 
-    if (freq == 2484) {
-        if (sec_channel || vht)
-            return NUM_HOSTAPD_MODES;
+    if (freq == 2192) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 213;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
 
-        *op_class = 82; /* channel 14 */
-        *channel = 14;
+    if (freq == 2197) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 214;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2202) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 215;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2207) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 216;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2212) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 217;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2217) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 218;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2222) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 219;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2227) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 220;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2232) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 221;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2237) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 222;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2242) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 223;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2247) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 224;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2252) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 225;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2257) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 226;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2262) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 227;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2267) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 228;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2272) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 229;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2277) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 230;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2282) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 231;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2287) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 232;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2292) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 233;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2297) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 234;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2302) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 235;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2307) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 236;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2312) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 237;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2317) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 238;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2322) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 239;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2327) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 240;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
 
+    if (freq == 2332) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 241;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2337) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 242;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2342) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 243;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2347) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 244;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2352) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 245;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2357) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 246;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2362) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 247;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2367) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 248;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2372) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 249;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2377) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 250;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2382) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 251;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2387) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 252;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2392) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 253;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2397) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 254;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2402) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 255;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2407) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 0;
+        return HOSTAPD_MODE_IEEE80211G;
+    }
+
+    if (freq == 2484) {
+        if (sec_channel == 1)
+            *op_class = 83;
+        else if (sec_channel == -1)
+            *op_class = 84;
+        else
+            *op_class = 81;
+        *channel = 14;
         return HOSTAPD_MODE_IEEE80211B;
     }
 
@@ -1188,12 +1673,12 @@ struct wpabuf * mb_ies_by_info(struct mb
 
 
 const struct oper_class_map global_op_class[] = {
-    { HOSTAPD_MODE_IEEE80211G, 81, 1, 13, 1, BW20, P2P_SUPP },
-    { HOSTAPD_MODE_IEEE80211G, 82, 14, 14, 1, BW20, NO_P2P_SUPP },
+    { HOSTAPD_MODE_IEEE80211G, 81, 1, 14, 1, BW20, P2P_SUPP },
+    { HOSTAPD_MODE_IEEE80211G, 82, 14, 14, 1, BW20, P2P_SUPP },
 
     /* Do not enable HT40 on 2.4 GHz for P2P use for now */
-    { HOSTAPD_MODE_IEEE80211G, 83, 1, 9, 1, BW40PLUS, NO_P2P_SUPP },
-    { HOSTAPD_MODE_IEEE80211G, 84, 5, 13, 1, BW40MINUS, NO_P2P_SUPP },
+    { HOSTAPD_MODE_IEEE80211G, 83, 1, 14, 1, BW40PLUS, P2P_SUPP },
+    { HOSTAPD_MODE_IEEE80211G, 84, 1, 14, 1, BW40MINUS, P2P_SUPP },
 
     { HOSTAPD_MODE_IEEE80211A, 115, 36, 48, 4, BW20, P2P_SUPP },
     { HOSTAPD_MODE_IEEE80211A, 116, 36, 44, 8, BW40PLUS, P2P_SUPP },



diff -pur a/drivers/net/wireless/ath/ath9k/common-init.c b/drivers/net/wireless/ath/ath9k/common-init.c
--- a/drivers/net/wireless/ath/ath9k/common-init.c    2017-01-27 03:12:57.878225039 +0100
+++ b/drivers/net/wireless/ath/ath9k/common-init.c    2017-01-27 02:12:25.667393000 +0100
@@ -22,7 +22,7 @@
     .band = NL80211_BAND_2GHZ, \
     .center_freq = (_freq), \
     .hw_value = (_idx), \
-    .max_power = 20, \
+    .max_power = 30, \
 }
 
 #define CHAN5G(_freq, _idx) { \
@@ -37,6 +37,50 @@
  * we have calibration data for all cards though to make
  * this static */
 static const struct ieee80211_channel ath9k_2ghz_chantable[] = {
+    CHAN2G(2192, 58), /* Channel 213 */
+    CHAN2G(2197, 57), /* Channel 214 */
+    CHAN2G(2202, 56), /* Channel 215 */
+    CHAN2G(2207, 55), /* Channel 216 */
+    CHAN2G(2212, 54), /* Channel 217 */
+    CHAN2G(2217, 53), /* Channel 218 */
+    CHAN2G(2222, 52), /* Channel 219 */
+    CHAN2G(2227, 51), /* Channel 220 */
+    CHAN2G(2232, 50), /* Channel 221 */
+    CHAN2G(2237, 49), /* Channel 222 */
+    CHAN2G(2242, 48), /* Channel 223 */
+    CHAN2G(2247, 47), /* Channel 224 */
+    CHAN2G(2252, 46), /* Channel 225 */
+    CHAN2G(2257, 45), /* Channel 226 */
+    CHAN2G(2262, 44), /* Channel 227 */
+    CHAN2G(2267, 43), /* Channel 228 */
+    CHAN2G(2272, 42), /* Channel 229 */
+    CHAN2G(2277, 41), /* Channel 230 */
+    CHAN2G(2282, 40), /* Channel 231 */
+    CHAN2G(2287, 39), /* Channel 232 */
+    CHAN2G(2292, 38), /* Channel 233 */
+    CHAN2G(2297, 37), /* Channel 234 */
+    CHAN2G(2302, 36), /* Channel 235 */
+    CHAN2G(2307, 35), /* Channel 236 */
+    CHAN2G(2312, 34), /* Channel 237 */
+    CHAN2G(2317, 33), /* Channel 238 */
+    CHAN2G(2322, 32), /* Channel 239 */
+    CHAN2G(2327, 31), /* Channel 240 */
+    CHAN2G(2332, 30), /* Channel 241 */
+    CHAN2G(2337, 29), /* Channel 242 */
+    CHAN2G(2342, 28), /* Channel 243 */
+    CHAN2G(2347, 27), /* Channel 244 */
+    CHAN2G(2352, 26), /* Channel 245 */
+    CHAN2G(2357, 25), /* Channel 246 */
+    CHAN2G(2362, 24), /* Channel 247 */
+    CHAN2G(2367, 23), /* Channel 248 */
+    CHAN2G(2372, 22), /* Channel 249 */
+    CHAN2G(2377, 21), /* Channel 250 */
+    CHAN2G(2382, 20), /* Channel 251 */
+    CHAN2G(2387, 19), /* Channel 252 */
+    CHAN2G(2392, 18), /* Channel 253 */
+    CHAN2G(2397, 17), /* Channel 254 */
+    CHAN2G(2402, 16), /* Channel 255 */
+    CHAN2G(2407, 15), /* Channel 0 */
     CHAN2G(2412, 0), /* Channel 1 */
     CHAN2G(2417, 1), /* Channel 2 */
     CHAN2G(2422, 2), /* Channel 3 */
@@ -48,6 +92,7 @@ static const struct ieee80211_channel at
     CHAN2G(2452, 8), /* Channel 9 */
     CHAN2G(2457, 9), /* Channel 10 */
     CHAN2G(2462, 10), /* Channel 11 */
+    CHAN2G(2464, 14), /* Channel 11 */
     CHAN2G(2467, 11), /* Channel 12 */
     CHAN2G(2472, 12), /* Channel 13 */
     CHAN2G(2484, 13), /* Channel 14 */
diff -pur a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
--- a/drivers/net/wireless/ath/ath9k/hw.h    2017-01-27 03:12:44.230158313 +0100
+++ b/drivers/net/wireless/ath/ath9k/hw.h    2017-01-27 02:12:29.919414000 +0100
@@ -74,7 +74,7 @@
 
 #define ATH9K_RSSI_BAD            -128
 
-#define ATH9K_NUM_CHANNELS    38
+#define ATH9K_NUM_CHANNELS    83
 
 /* Register read/write primitives */
 #define REG_WRITE(_ah, _reg, _val) \
diff -pur a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
--- a/drivers/net/wireless/ath/regd.c    2017-01-27 03:34:37.760579834 +0100
+++ b/drivers/net/wireless/ath/regd.c    2017-01-27 01:39:28.073725000 +0100
@@ -33,29 +33,16 @@ static int __ath_regd_init(struct ath_re
  */
 
 /* Only these channels all allow active scan on all world regulatory domains */
-#define ATH9K_2GHZ_CH01_11    REG_RULE(2412-10, 2462+10, 40, 0, 20, 0)
-
-/* We enable active scan on these a case by case basis by regulatory domain */
-#define ATH9K_2GHZ_CH12_13    REG_RULE(2467-10, 2472+10, 40, 0, 20,\
-                     NL80211_RRF_NO_IR)
-#define ATH9K_2GHZ_CH14        REG_RULE(2484-10, 2484+10, 40, 0, 20,\
-                     NL80211_RRF_NO_IR | \
-                     NL80211_RRF_NO_OFDM)
+#define ATH9K_2GHZ_2224        REG_RULE(2192-10, 2472+10, 40, 0, 30, 0)
+#define ATH9K_2GHZ_CH14        REG_RULE(2484-10, 2484+10, 40, 0, 30, 0)
+#define ATH9K_2GHZ_2527        REG_RULE(2492-10, 2732+10, 40, 0, 30, 0)
+
+#define ATH9K_2GHZ        ATH9K_2GHZ_2224, \
+                ATH9K_2GHZ_CH14, \
+                ATH9K_2GHZ_2527
 
 /* We allow IBSS on these on a case by case basis by regulatory domain */
-#define ATH9K_5GHZ_5150_5350    REG_RULE(5150-10, 5350+10, 80, 0, 30,\
-                     NL80211_RRF_NO_IR)
-#define ATH9K_5GHZ_5470_5850    REG_RULE(5470-10, 5850+10, 80, 0, 30,\
-                     NL80211_RRF_NO_IR)
-#define ATH9K_5GHZ_5725_5850    REG_RULE(5725-10, 5850+10, 80, 0, 30,\
-                     NL80211_RRF_NO_IR)
-
-#define ATH9K_2GHZ_ALL        ATH9K_2GHZ_CH01_11, \
-                ATH9K_2GHZ_CH12_13, \
-                ATH9K_2GHZ_CH14
-
-#define ATH9K_5GHZ_ALL        ATH9K_5GHZ_5150_5350, \
-                ATH9K_5GHZ_5470_5850
+#define ATH9K_5GHZ        REG_RULE(4900-10, 6100+10, 80, 0, 30, 0)
 
 /* This one skips what we call "mid band" */
 #define ATH9K_5GHZ_NO_MIDBAND    ATH9K_5GHZ_5150_5350, \
@@ -70,8 +57,8 @@ static int __ath_regd_init(struct ath_re
 static const struct ieee80211_regdomain ath_world_regdom_60_61_62 = {
     .alpha2 =  "99",
    .reg_rules = {
-        ATH9K_2GHZ_ALL,
-        ATH9K_5GHZ_ALL,
+        ATH9K_2GHZ,
+        ATH9K_5GHZ,
     }
 };
 
@@ -79,9 +66,8 @@ static const struct ieee80211_regdomain 
 static const struct ieee80211_regdomain ath_world_regdom_63_65 = {
     .alpha2 =  "99",
     .reg_rules = {
-        ATH9K_2GHZ_CH01_11,
-        ATH9K_2GHZ_CH12_13,
-        ATH9K_5GHZ_NO_MIDBAND,
+        ATH9K_2GHZ,
+        ATH9K_5GHZ,
     }
 };
 
@@ -89,8 +75,8 @@ static const struct ieee80211_regdomain 
 static const struct ieee80211_regdomain ath_world_regdom_64 = {
     .alpha2 =  "99",
     .reg_rules = {
-        ATH9K_2GHZ_CH01_11,
-        ATH9K_5GHZ_NO_MIDBAND,
+        ATH9K_2GHZ,
+        ATH9K_5GHZ,
     }
 };
 
@@ -98,8 +84,8 @@ static const struct ieee80211_regdomain 
 static const struct ieee80211_regdomain ath_world_regdom_66_69 = {
     .alpha2 =  "99",
     .reg_rules = {
-        ATH9K_2GHZ_CH01_11,
-        ATH9K_5GHZ_ALL,
+        ATH9K_2GHZ,
+        ATH9K_5GHZ,
     }
 };
 
@@ -107,9 +93,8 @@ static const struct ieee80211_regdomain 
 static const struct ieee80211_regdomain ath_world_regdom_67_68_6A_6C = {
     .alpha2 =  "99",
     .reg_rules = {
-        ATH9K_2GHZ_CH01_11,
-        ATH9K_2GHZ_CH12_13,
-        ATH9K_5GHZ_ALL,
+        ATH9K_2GHZ,
+        ATH9K_5GHZ,
     }
 };
 
diff -pur a/net/wireless/reg.c b/net/wireless/reg.c
--- a/net/wireless/reg.c    2017-01-24 21:54:57.121925000 +0100
+++ b/net/wireless/reg.c    2017-01-27 02:07:42.950011000 +0100
@@ -220,15 +220,8 @@ static const struct ieee80211_regdomain world_regdom = {
    .n_reg_rules = 8,
    .alpha2 =  "00",
    .reg_rules = {
        /* IEEE 802.11b/g, channels 1..11 */
-        REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
-        /* IEEE 802.11b/g, channels 12..13. */
-        REG_RULE(2467-10, 2472+10, 40, 6, 20,
-            NL80211_RRF_NO_IR),
-        /* IEEE 802.11 channel 14 - Only JP enables
-         * this and for 802.11b only */
-        REG_RULE(2484-10, 2484+10, 20, 6, 20,
-            NL80211_RRF_NO_IR |
-            NL80211_RRF_NO_OFDM),
+        REG_RULE(2192-10, 2472+10, 40, 6, 30, 0),
+        REG_RULE(2484-10, 2484+10, 40, 6, 30, 0),
         /* IEEE 802.11a, channel 36..48 */
        REG_RULE(5180-10, 5240+10, 160, 6, 20,
                        NL80211_RRF_NO_IR),

@@ -2812,13 +2805,6 @@ static int reg_set_rd_user(const struct 
     if (!regdom_changes(rd->alpha2))
         return -EALREADY;
 
-    if (!is_valid_rd(rd)) {
-        pr_err("Invalid regulatory domain detected: %c%c\n",
-               rd->alpha2[0], rd->alpha2[1]);
-        print_regdomain_info(rd);
-        return -EINVAL;
-    }
-
     if (!user_request->intersect) {
         reset_regdomains(false, rd);
         return 0;
@@ -2849,13 +2835,6 @@ static int reg_set_rd_driver(const struc
     if (!regdom_changes(rd->alpha2))
         return -EALREADY;
 
-    if (!is_valid_rd(rd)) {
-        pr_err("Invalid regulatory domain detected: %c%c\n",
-               rd->alpha2[0], rd->alpha2[1]);
-        print_regdomain_info(rd);
-        return -EINVAL;
-    }
-
     request_wiphy = wiphy_idx_to_wiphy(driver_request->wiphy_idx);
     if (!request_wiphy)
         return -ENODEV;
@@ -2908,13 +2887,6 @@ static int reg_set_rd_country_ie(const s
      * and the pending request came in from a country IE
      */
 
-    if (!is_valid_rd(rd)) {
-        pr_err("Invalid regulatory domain detected: %c%c\n",
-               rd->alpha2[0], rd->alpha2[1]);
-        print_regdomain_info(rd);
-        return -EINVAL;
-    }
-
     request_wiphy = wiphy_idx_to_wiphy(country_ie_request->wiphy_idx);
     if (!request_wiphy)
         return -ENODEV;
@@ -3013,11 +2985,6 @@ static int __regulatory_set_wiphy_regd(s
          "wiphy should have REGULATORY_WIPHY_SELF_MANAGED\n"))
         return -EPERM;
 
-    if (WARN(!is_valid_rd(rd), "Invalid regulatory domain detected\n")) {
-        print_regdomain_info(rd);
-        return -EINVAL;
-    }
-
     regd = reg_copy_regd(rd);
     if (IS_ERR(regd))
         return PTR_ERR(regd);
diff -pur a/net/wireless/util.c b/net/wireless/util.c
--- a/net/wireless/util.c    2017-01-27 03:07:40.868675258 +0100
+++ b/net/wireless/util.c    2017-01-27 00:53:41.599777000 +0100
@@ -73,6 +73,7 @@ int ieee80211_channel_to_frequency(int c
    
        return 0; /* not supported */
    switch (band) {
    case IEEE80211_BAND_2GHZ:
+        chan = (int)(char)chan;
         if (chan == 14)
            return 2484;
        else if (chan < 14)
            return 2407 + chan * 5;
        break;
@@ -1449,7 +1450,14 @@ bool ieee80211_chandef_to_operating_clas
         if (chandef->width > NL80211_CHAN_WIDTH_40)
             return false;
 
-        *op_class = 82; /* channel 14 */
+        if (chandef->width == NL80211_CHAN_WIDTH_40) {
+            if (freq > chandef->chan->center_freq)
+                *op_class = 83; /* HT40+ */
+            else
+                *op_class = 84; /* HT40- */
+        } else {
+            *op_class = 81;
+        }
         return true;
     }

Hi,

interested topic. There is an ham amateur radio project that mantains patches for openwrt chaos calmer
https://www.arcman.de/pub/patches/arcman_patches_20160203.tar.gz. These patches enable 2.3 Ghz (ham radio) for atheros devices

Patches are working at least for openwrt cc revision r49480, with last cc source are broken due of new hostpad version.

It could be a useful start point to implement ham radio support (or extended channel in general) in lede project...

D.

Any progress??

While this is IN FACT illegal without a license or Special Temporary Authority from the FCC in the US...I will refer you to 2 resources:

http://www.broadband-hamnet.org/

https://www.aredn.org/

I know for a fact, there have been some Amateur Radio Operators able to access Channels "-2," "-1" and "0" (which channels are completely within the 2.4 GHz licensed Amateur Radio band). I am aware, this is on the other side of the band than you're interested in (below 2.4, not above). Nonetheless, I spoke to the head developer of AREDN to get the information patched into OpenWRT, she never responded to me.

I'm also not certain that either project uses a public code repo. Both projects seem highly rewritten from a version of Kamikaze. Broadband-Hamnet is in fact a stripped-down OpenWRT.

Yes, it is true that there are licensed uses for bands that are not in the regional "license-free" bands. Unless you have a license for those bands, you are not permitted to operate in them. In the United States, unless you have a license to modify radio equipment for use in those bands, it is illegal to do so.

The US Amateur Radio Service does permit certain of its licensees the ability to operate in certain of those bands, with the restriction that the data must not be encrypted, and may not be used for any commercial purpose. So, for all practical purposes, even with that type of license, those channels are "useless" for typical use; no encryption on the wireless, no connecting to commercial websites, no TLS,...

1 Like

It should also be noted that 2.4 GHz while not licensed, is regulated for all users in the United States. The rules are defined in Title 47, Code of Federal Regulations, Part 15.

users manual or instruction manual for an intentional or unintentional radiator shall caution the user that changes or modifications not expressly approved by the party responsible for compliance could void the user's authority to operate the equipment

I have ham license in my country (India). That's why I'm trying to unlock these bands.

3 Likes

brother there is I'm from Cuba I'm looking to put my router TP-Link WR740N V5 channels from 2.3Ghz - 2.7Ghz and I have OpenWrt 18.06.1 r7258-5eb055306f put.Ask and a way to do it

At least from what I have read, Cuba permits only channels 1-13 on the 2.4 GHz band. As a result, fulfilling your request would go against the rules for this forum.

but I am a ham radio, in Cuba nothing is published with respect to the channels here people put the nanos and other ubikiti equipment in compilance test. please can you allude me I just want to unlock all the frequencies of my router so I can connect to a bullet What I have close to my house. that uses the frequency 2312 I think

por favor abiliten todos los canales desde 2.2-2.7ghz si es posible y lla haci como mismo hace ubikiti y los demas

soy cubano correo osmanydante@gmail.com

When writing in your native language, please always provide an english translation.
This way other users all around the world can take part in the discussion and possibly benefit from the outcome, without having to use a translator.

2 Likes

brother I have an M2 bullet and I installed the openwrt but with that firmward does not give me all the frequencies there is some way like in AIROS of ubikiti to make it compilance test

What frequencies (channels) are you lacking?

Only 1-13 (and 14 too in Japan) should be operational on a consumer WiFi device.

uploaded mostly random chosen test images on ar71xx 4.9 kernel:

NEW: rt2800usb supported

RT3070 and RT5370 (or is it RT5390?) work, if you have different card leave a follow-up feedback

links dead

4 Likes

Can you pld upload a ubnt xw image for tlwn841nd, NSM2 and similars, great work

I liked that one!