Am 10.12.2024 um 08:06 schrieb John Crispin:
Hi Hartmut

On 09.12.24 19:19, e9hack wrote:
2) wireless.wifi-xxx.json: reading of options with alias definitions don't work

can you elaborate on this one please ?

     John


My 5g wifi wasn't detected properly:

config wifi-device 'radio0'
        option type 'mac80211'
        option channel 'auto'
        option channels '36-138 149-165'
        option hwmode '11a'

I add a small patch to hostapd.uc to see what's going on:

--- hostapd.uc.bak      2024-12-09 11:21:06.000000000 +0100
+++ hostapd.uc  2024-12-10 15:08:59.000000000 +0100
@@ -7,6 +7,7 @@ import * as iface from 'wifi.iface';
 import * as nl80211 from 'nl80211';
 import * as ap from 'wifi.ap';
 import * as fs from 'fs';
+import { log } from 'wifi.common';

 const NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER = 33;
 const NL80211_EXT_FEATURE_RADAR_BACKGROUND = 61;
@@ -16,6 +17,7 @@ let phy_capabilities = {};

 /* make sure old style UCI and hwmode and newer band properties are correctly 
resolved */
 function set_device_defaults(config) {
+       log(`===> config.hwmode=${config.hwmode} config.channel=${config.channel} 
<==`);
        /* validate the hw mode */
        if (config.hwmode in [ '11a', '11b', '11g', '11ad' ])
                config.hw_mode = substr(config.hwmode, 2);

This results in:

Mon Dec  9 19:51:49 2024 daemon.notice netifd: radio0 (9127): wifi-scripts: ===> 
config.hwmode=null config.channel=0 <===

Now I changed wireless.wifi-device.json:

--- wireless.wifi-device.json.bak       2024-12-09 11:21:06.000000000 +0100
+++ wireless.wifi-device.json   2024-12-10 15:12:21.000000000 +0100
@@ -360,8 +360,9 @@
                                "EHT20", "EHT40", "EHT80", "EHT160", "EHT320" ]
                },
                "hwmode": {
-                       "type": "alias",
-                       "default": "hw_mode"
+                       "description": "Legacy way, use the band property 
instead",
+                       "type": "string",
+                       "enum": [ "11a", "11b", "11g", "11ad" ]
                },
                "hw_mode": {
                        "description": "Legacy way, use the band property 
instead",

This results in:

Mon Dec  9 19:54:45 2024 daemon.notice netifd: radio0 (9304): wifi-scripts: ===> 
config.hwmode=11a config.channel=0 <===

Regards,
Hartmut

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to