mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-02 11:27:48 +00:00
Compare commits
1 Commits
feeds_use_
...
WIFI-14873
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65eb47430f |
@@ -1,50 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. /lib/functions.sh
|
|
||||||
|
|
||||||
board=$(board_name)
|
|
||||||
|
|
||||||
phy_dir="/sys/kernel/debug/ieee80211"
|
|
||||||
# Count the number of phyX
|
|
||||||
phy_count=$(ls -d $phy_dir/phy* 2>/dev/null | wc -l)
|
|
||||||
echo "$phy_count" > /tmp/phy_count
|
|
||||||
|
|
||||||
case "$board" in
|
|
||||||
"edgecore,eap112")
|
|
||||||
phy1_file=/sys/kernel/debug/ieee80211/phy1/mt76/sr_enable
|
|
||||||
phy2_file=/sys/kernel/debug/ieee80211/phy2/mt76/sr_enable
|
|
||||||
|
|
||||||
if [ -f "$phy1_file" ]; then
|
|
||||||
check_phy1=$(cat $phy1_file)
|
|
||||||
[ "$check_phy1" == 0 ] && echo 1 > $phy1_file
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$phy2_file" ]; then
|
|
||||||
check_phy2=$(cat $phy2_file)
|
|
||||||
[ "$check_phy2" == 0 ] && echo 1 > $phy2_file
|
|
||||||
fi
|
|
||||||
|
|
||||||
# note: phy0 is HaLow
|
|
||||||
ln -s /sys/kernel/debug/ieee80211/phy1/mt76/sr_scene_cond /tmp/sr_scene_cond_phy2g
|
|
||||||
ln -s /sys/kernel/debug/ieee80211/phy2/mt76/sr_scene_cond /tmp/sr_scene_cond_phy5g
|
|
||||||
;;
|
|
||||||
"edgecore,eap111")
|
|
||||||
phy0_file=/sys/kernel/debug/ieee80211/phy0/mt76/sr_enable
|
|
||||||
phy1_file=/sys/kernel/debug/ieee80211/phy1/mt76/sr_enable
|
|
||||||
|
|
||||||
if [ -f "$phy0_file" ]; then
|
|
||||||
check_phy0=$(cat $phy0_file)
|
|
||||||
echo "check_phy0 = $check_phy0"
|
|
||||||
[ "$check_phy0" == 0 ] && echo 1 > $phy0_file
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$phy1_file" ]; then
|
|
||||||
check_phy1=$(cat $phy1_file)
|
|
||||||
echo "check_phy1 = $check_phy1"
|
|
||||||
[ "$check_phy1" == 0 ] && echo 1 > $phy1_file
|
|
||||||
fi
|
|
||||||
|
|
||||||
ln -s /sys/kernel/debug/ieee80211/phy0/mt76/sr_scene_cond /tmp/sr_scene_cond_phy2g
|
|
||||||
ln -s /sys/kernel/debug/ieee80211/phy1/mt76/sr_scene_cond /tmp/sr_scene_cond_phy5g
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@@ -78,7 +78,7 @@ function call_est_server(path, cert, target) {
|
|||||||
if (generate_csr(cert))
|
if (generate_csr(cert))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
let ret = system('curl -m 10 -X POST https://' + est_server + '/.well-known/est/' + path + ' -d @/tmp/csr.nohdr.p10 -H "Content-Type: application/pkcs10" --cert ' + cert + ' --key /etc/ucentral/key.pem --cacert /etc/ucentral/insta.pem -o /tmp/operational.nohdr.p7');
|
let ret = system('curl -X POST https://' + est_server + '/.well-known/est/' + path + ' -d @/tmp/csr.nohdr.p10 -H "Content-Type: application/pkcs10" --cert ' + cert + ' --key /etc/ucentral/key.pem --cacert /etc/ucentral/insta.pem -o /tmp/operational.nohdr.p7');
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ulog(LOG_INFO, 'Failed to request operational certificate\n');
|
ulog(LOG_INFO, 'Failed to request operational certificate\n');
|
||||||
return 1;
|
return 1;
|
||||||
@@ -125,7 +125,7 @@ function load_operational_ca() {
|
|||||||
ulog(LOG_INFO, 'Operational CA is present\n');
|
ulog(LOG_INFO, 'Operational CA is present\n');
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
let ret = system('curl -m 10 -X GET https://' + est_server + '/.well-known/est/cacerts --cert /etc/ucentral/' + cert_prefix + '.pem --key /etc/ucentral/key.pem --cacert /etc/ucentral/insta.pem -o /tmp/' + cert_prefix + '.ca.nohdr.p7');
|
let ret = system('curl -X GET https://' + est_server + '/.well-known/est/cacerts --cert /etc/ucentral/' + cert_prefix + '.pem --key /etc/ucentral/key.pem --cacert /etc/ucentral/insta.pem -o /tmp/' + cert_prefix + '.ca.nohdr.p7');
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = p7_too_pem('/tmp/' + cert_prefix + '.ca.nohdr.p7', '/etc/ucentral/' + cert_prefix + '.ca');
|
ret = p7_too_pem('/tmp/' + cert_prefix + '.ca.nohdr.p7', '/etc/ucentral/' + cert_prefix + '.ca');
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ USE_PROCD=1
|
|||||||
start_service() {
|
start_service() {
|
||||||
rm -rf /tmp/threshold_breach_count*
|
rm -rf /tmp/threshold_breach_count*
|
||||||
rm -rf /tmp/fixed_channel*
|
rm -rf /tmp/fixed_channel*
|
||||||
rm -rf /tmp/chanutil_phy*
|
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command /usr/bin/rrmd.uc
|
procd_set_param command /usr/bin/rrmd.uc
|
||||||
|
|||||||
@@ -11,6 +11,19 @@ let config = {
|
|||||||
consecutive_threshold_breach: 1,
|
consecutive_threshold_breach: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// total number of radios: default=2
|
||||||
|
let num_radios = 2;
|
||||||
|
|
||||||
|
let board_name = board_info.board_name;
|
||||||
|
switch(board_name) {
|
||||||
|
case 'edgecore,eap105':
|
||||||
|
case 'edgecore,oap101-6e':
|
||||||
|
case 'edgecore,oap101e-6e':
|
||||||
|
case 'zyxel,nwa130be':
|
||||||
|
num_radios = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
function stats_info_read(path) {
|
function stats_info_read(path) {
|
||||||
let res = trim(fs.readfile(path));
|
let res = trim(fs.readfile(path));
|
||||||
return res || 0;
|
return res || 0;
|
||||||
@@ -24,25 +37,6 @@ function stats_info_write(path, value) {
|
|||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// total number of radios: default=2
|
|
||||||
let num_radios = 2;
|
|
||||||
let phy_count;
|
|
||||||
|
|
||||||
let board_name = board_info.board_name;
|
|
||||||
switch(board_name) {
|
|
||||||
case 'edgecore,eap105':
|
|
||||||
case 'edgecore,oap101-6e':
|
|
||||||
case 'edgecore,oap101e-6e':
|
|
||||||
case 'zyxel,nwa130be':
|
|
||||||
num_radios = 3;
|
|
||||||
break;
|
|
||||||
case 'edgecore,eap112':
|
|
||||||
phy_count = stats_info_read("/tmp/phy_count");
|
|
||||||
if (phy_count)
|
|
||||||
num_radios = int(phy_count);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
function cool_down_check(iface, cool_down_period) {
|
function cool_down_check(iface, cool_down_period) {
|
||||||
let now_t = time();
|
let now_t = time();
|
||||||
let cool_down_f= 0;
|
let cool_down_f= 0;
|
||||||
@@ -157,23 +151,6 @@ function interface_status_check(iface) {
|
|||||||
let radio_status = 'DISABLED';
|
let radio_status = 'DISABLED';
|
||||||
let radio_down_f = 1;
|
let radio_down_f = 1;
|
||||||
|
|
||||||
if (board_info.board_name == 'edgecore,eap112' && phy_count == 3) {
|
|
||||||
// hostapd_cli_s1g status | grep 'Selected interface'| awk -F "\'" '{print $2}'
|
|
||||||
let check_HaLow_iface_cmd = sprintf('hostapd_cli_s1g status | grep \'Selected interface\'| awk -F "\'" \'{print $2}\'');
|
|
||||||
let check_HaLow_iface = fs.popen(check_HaLow_iface_cmd);
|
|
||||||
let _check_HaLow_iface = trim(check_HaLow_iface.read('all'));
|
|
||||||
check_HaLow_iface.close();
|
|
||||||
|
|
||||||
if (_check_HaLow_iface && _check_HaLow_iface == iface) {
|
|
||||||
ulog_info(`[%s] This is a HaLow interface \n`, _check_HaLow_iface);
|
|
||||||
|
|
||||||
// this iface is HaLow interface and we can neither check channel utilization nor switch channel, we can check if it is UP
|
|
||||||
radio_down_f = 2;
|
|
||||||
ulog_info(`[%s] status: ENABLED \n`, iface, radio_status);
|
|
||||||
return radio_down_f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let curr_stat = global.ubus.conn.call(`hostapd.${iface}`, 'get_status');
|
let curr_stat = global.ubus.conn.call(`hostapd.${iface}`, 'get_status');
|
||||||
if (curr_stat) {
|
if (curr_stat) {
|
||||||
radio_status = curr_stat.status;
|
radio_status = curr_stat.status;
|
||||||
@@ -185,12 +162,9 @@ function interface_status_check(iface) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function check_current_channel(iface) {
|
function check_current_channel(iface) {
|
||||||
let current_channel;
|
|
||||||
// get wireless interface's live status & channel using "ubus call hostapd.<iface> get_status"
|
// get wireless interface's live status & channel using "ubus call hostapd.<iface> get_status"
|
||||||
let curr_stat = global.ubus.conn.call(`hostapd.${iface}`, 'get_status');
|
let curr_stat = global.ubus.conn.call(`hostapd.${iface}`, 'get_status');
|
||||||
if (curr_stat)
|
let current_channel = curr_stat.channel;
|
||||||
current_channel = curr_stat.channel;
|
|
||||||
|
|
||||||
if (curr_stat && current_channel) {
|
if (curr_stat && current_channel) {
|
||||||
ulog_info(`[%s] Current channel (from hostapd) = %d \n`, iface, current_channel);
|
ulog_info(`[%s] Current channel (from hostapd) = %d \n`, iface, current_channel);
|
||||||
}
|
}
|
||||||
@@ -212,7 +186,7 @@ function hostapd_switch_channel(msg) {
|
|||||||
if (bandwidth > 20)
|
if (bandwidth > 20)
|
||||||
sec_channel_offset = 1;
|
sec_channel_offset = 1;
|
||||||
|
|
||||||
// use hostapd_cli command
|
// use hostadp_cli command
|
||||||
if (target_freq != null) {
|
if (target_freq != null) {
|
||||||
ulog_info(`Sending to hostapd (Chan %d):: freq=%d, center_freq=%d, sec_channel_offset=%d, bandwidth=%d, mode=%s \n`, msg.channel, target_freq, center_freq, sec_channel_offset, bandwidth, mode);
|
ulog_info(`Sending to hostapd (Chan %d):: freq=%d, center_freq=%d, sec_channel_offset=%d, bandwidth=%d, mode=%s \n`, msg.channel, target_freq, center_freq, sec_channel_offset, bandwidth, mode);
|
||||||
|
|
||||||
@@ -239,9 +213,9 @@ function hostapd_switch_channel(msg) {
|
|||||||
return chan_switch_status;
|
return chan_switch_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
function switch_status_check(iface, dfs_enabled_5g_flag) {
|
function switch_status_check(iface, dfs_enabled_5g_index) {
|
||||||
// need to wait for radio 5GHz interface to be UP, when DFS is enabled
|
// need to wait for radio 5GHz interface to be UP, when DFS is enabled
|
||||||
if (dfs_enabled_5g_flag == 1) {
|
if (dfs_enabled_5g_index == 1) {
|
||||||
ulog_info(`[%s] 5G radio might need some time to be UP (DFS enabled) \n`, iface);
|
ulog_info(`[%s] 5G radio might need some time to be UP (DFS enabled) \n`, iface);
|
||||||
|
|
||||||
let p = 0;
|
let p = 0;
|
||||||
@@ -271,25 +245,24 @@ function switch_status_check(iface, dfs_enabled_5g_flag) {
|
|||||||
return current_chan;
|
return current_chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
function dfs_chan_check(iface, rcs_channel) {
|
function dfs_chan_check(iface_num, rcs_channel) {
|
||||||
let iface_num = replace(iface, /[^0-9]/g, '');
|
|
||||||
let phy_id = 'phy' + iface_num;
|
let phy_id = 'phy' + iface_num;
|
||||||
if (board_name == 'edgecore,eap105') {
|
if (board_name == 'edgecore,eap105') {
|
||||||
phy_id = 'phy00';
|
phy_id = 'phy00';
|
||||||
}
|
}
|
||||||
let dfs_enabled_5g_f = 0;
|
let dfs_enabled_5g = 0;
|
||||||
let dfs_chan_list = global.phy.phys[phy_id].dfs_channels;
|
let dfs_chan_list = global.phy.phys[phy_id].dfs_channels;
|
||||||
|
|
||||||
// check if rcs_channel is in dfs_channel list
|
// check if rcs_channel is in dfs_channel list
|
||||||
for (let dfs_chan in dfs_chan_list) {
|
for (let dfs_chan in dfs_chan_list) {
|
||||||
if (dfs_chan == rcs_channel) {
|
if (dfs_chan == rcs_channel) {
|
||||||
// flag up if dfs channel detected
|
// flag up if dfs channel detected
|
||||||
dfs_enabled_5g_f = 1;
|
dfs_enabled_5g = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dfs_enabled_5g_f;
|
return dfs_enabled_5g;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fixed_channel_config(iface, iface_num, fixed_channel_f, auto_channel_f, fixed_chan_bkp, channel_config) {
|
function fixed_channel_config(iface, iface_num, fixed_channel_f, auto_channel_f, fixed_chan_bkp, channel_config) {
|
||||||
@@ -324,9 +297,7 @@ function get_chan_util(radio_band, sleep_time) {
|
|||||||
txFrameCount: null,
|
txFrameCount: null,
|
||||||
rxFrameCount: null,
|
rxFrameCount: null,
|
||||||
rxClearCount: null,
|
rxClearCount: null,
|
||||||
chanBusyTime: null,
|
|
||||||
cycleCount: null,
|
cycleCount: null,
|
||||||
chanActiveTime: null,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let c = 0; c < 2; c++) {
|
for (let c = 0; c < 2; c++) {
|
||||||
@@ -337,86 +308,67 @@ function get_chan_util(radio_band, sleep_time) {
|
|||||||
txFrameCount: null,
|
txFrameCount: null,
|
||||||
rxFrameCount: null,
|
rxFrameCount: null,
|
||||||
rxClearCount: null,
|
rxClearCount: null,
|
||||||
chanBusyTime: null,
|
|
||||||
cycleCount: null,
|
cycleCount: null,
|
||||||
chanActiveTime: null,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (board_info.board_name == 'edgecore,eap111' || board_info.board_name == 'edgecore,eap112') {
|
pdev_stats = split(stats_info_read(pdev_stats_file), "\n");
|
||||||
// for EAP111 and EAP112 (only 2.4G and 5G radio bands)
|
|
||||||
system(`cat /tmp/sr_scene_cond_phy${radio_band}`);
|
|
||||||
// logread -e "Congestion Ratio" | tail -n 1 | awk -F'= ' '{print $2}' | tr -d '%'
|
|
||||||
let cmd = sprintf('logread -e \"Congestion Ratio\" | tail -n 1 | awk -F\'= \' \'{print $2}\' | tr -d \'\%\'');
|
|
||||||
let chan_util_cmd = fs.popen(cmd);
|
|
||||||
let _chan_util = chan_util_cmd.read('all');
|
|
||||||
chan_util_cmd.close();
|
|
||||||
|
|
||||||
chan_util = int(_chan_util);
|
if (pdev_stats != null) {
|
||||||
break;
|
for (let curr_value in pdev_stats) {
|
||||||
} else {
|
let txFrameCount = match(trim(curr_value), /^TX frame count(\s+\d+)/);
|
||||||
pdev_stats = split(stats_info_read(pdev_stats_file), "\n");
|
if (txFrameCount)
|
||||||
|
curr_values.txFrameCount = trim(txFrameCount[1]);
|
||||||
|
|
||||||
if (pdev_stats != null) {
|
let rxFrameCount = match(trim(curr_value), /^RX frame count(\s+\d+)/);
|
||||||
for (let curr_value in pdev_stats) {
|
if (rxFrameCount)
|
||||||
let txFrameCount = match(trim(curr_value), /^TX frame count(\s+\d+)/);
|
curr_values.rxFrameCount = trim(rxFrameCount[1]);
|
||||||
if (txFrameCount)
|
|
||||||
curr_values.txFrameCount = int(trim(txFrameCount[1]));
|
|
||||||
|
|
||||||
let rxFrameCount = match(trim(curr_value), /^RX frame count(\s+\d+)/);
|
let rxClearCount = match(trim(curr_value), /^RX clear count(\s+\d+)/);
|
||||||
if (rxFrameCount)
|
if (rxClearCount)
|
||||||
curr_values.rxFrameCount = int(trim(rxFrameCount[1]));
|
curr_values.rxClearCount = trim(rxClearCount[1]);
|
||||||
|
|
||||||
let rxClearCount = match(trim(curr_value), /^RX clear count(\s+\d+)/);
|
let cycleCount = match(trim(curr_value), /^Cycle count(\s+\d+)/);
|
||||||
if (rxClearCount)
|
if (cycleCount)
|
||||||
curr_values.rxClearCount = int(trim(rxClearCount[1]));
|
curr_values.cycleCount = trim(cycleCount[1]);
|
||||||
|
|
||||||
let cycleCount = match(trim(curr_value), /^Cycle count(\s+\d+)/);
|
if (curr_values.txFrameCount && curr_values.rxFrameCount && curr_values.rxClearCount && curr_values.cycleCount) {
|
||||||
if (cycleCount)
|
break;
|
||||||
curr_values.cycleCount = int(trim(cycleCount[1]));
|
|
||||||
|
|
||||||
if (curr_values.txFrameCount && curr_values.rxFrameCount && curr_values.rxClearCount && curr_values.cycleCount) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let ignore = 0;
|
|
||||||
|
|
||||||
if (!prev_values.txFrameCount || !prev_values.rxFrameCount || !prev_values.rxClearCount || !prev_values.cycleCount) {
|
|
||||||
ignore = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((curr_values.cycleCount) <= (prev_values.cycleCount) || (curr_values.txFrameCount) < (prev_values.txFrameCount) ||
|
|
||||||
(curr_values.rxFrameCount) < (prev_values.rxFrameCount) || (curr_values.rxClearCount) < (prev_values.rxClearCount)) {
|
|
||||||
ignore = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ignore != 1) {
|
|
||||||
let cycle_count_delta = curr_values.cycleCount - prev_values.cycleCount;
|
|
||||||
let rx_clear_delta = curr_values.rxClearCount - prev_values.rxClearCount;
|
|
||||||
if (cycle_count_delta && cycle_count_delta > 0)
|
|
||||||
total_usage = (rx_clear_delta * 100) / cycle_count_delta;
|
|
||||||
chan_util = total_usage;
|
|
||||||
}
|
|
||||||
|
|
||||||
prev_values.txFrameCount=curr_values.txFrameCount;
|
|
||||||
prev_values.rxFrameCount=curr_values.rxFrameCount;
|
|
||||||
prev_values.rxClearCount=curr_values.rxClearCount;
|
|
||||||
prev_values.cycleCount=curr_values.cycleCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let ignore = 0;
|
||||||
|
|
||||||
|
if (!prev_values.txFrameCount || !prev_values.rxFrameCount || !prev_values.rxClearCount || !prev_values.cycleCount) {
|
||||||
|
ignore = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((curr_values.cycleCount) <= (prev_values.cycleCount) || (curr_values.txFrameCount) < (prev_values.txFrameCount) ||
|
||||||
|
(curr_values.rxFrameCount) < (prev_values.rxFrameCount) || (curr_values.rxClearCount) < (prev_values.rxClearCount)) {
|
||||||
|
ignore = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ignore != 1) {
|
||||||
|
let cycle_count_delta = curr_values.cycleCount - prev_values.cycleCount;
|
||||||
|
let rx_clear_delta = curr_values.rxClearCount - prev_values.rxClearCount;
|
||||||
|
if (cycle_count_delta && cycle_count_delta > 0)
|
||||||
|
total_usage = (rx_clear_delta * 100) / cycle_count_delta;
|
||||||
|
chan_util = total_usage;
|
||||||
|
}
|
||||||
|
|
||||||
|
prev_values.txFrameCount=curr_values.txFrameCount;
|
||||||
|
prev_values.rxFrameCount=curr_values.rxFrameCount;
|
||||||
|
prev_values.rxClearCount=curr_values.rxClearCount;
|
||||||
|
prev_values.cycleCount=curr_values.cycleCount;
|
||||||
}
|
}
|
||||||
sleep(sleep_time);
|
sleep(sleep_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
// record channel utilization
|
|
||||||
stats_info_write("/tmp/chanutil_phy" + radio_band, chan_util);
|
|
||||||
|
|
||||||
return chan_util;
|
return chan_util;
|
||||||
}
|
}
|
||||||
|
|
||||||
function random_channel_selection(iface, band, htmode, chan_list_valid) {
|
function random_channel_selection(iface, iface_num, band, htmode, chan_list_valid) {
|
||||||
let math = require('math');
|
let math = require('math');
|
||||||
let bw = replace(htmode, /[^0-9]/g, '');
|
let bw = replace(htmode, /[^0-9]/g, '');
|
||||||
let iface_num = replace(iface, /[^0-9]/g, '');
|
|
||||||
let phy_id = 'phy' + iface_num;
|
let phy_id = 'phy' + iface_num;
|
||||||
if (board_name == 'edgecore,eap105') {
|
if (board_name == 'edgecore,eap105') {
|
||||||
phy_id = 'phy00';
|
phy_id = 'phy00';
|
||||||
@@ -433,7 +385,7 @@ function random_channel_selection(iface, band, htmode, chan_list_valid) {
|
|||||||
let chan_list_legal = [];
|
let chan_list_legal = [];
|
||||||
|
|
||||||
ulog_info(`[%s] Channel list from the driver = %s \n`, iface, chan_list_cc);
|
ulog_info(`[%s] Channel list from the driver = %s \n`, iface, chan_list_cc);
|
||||||
ulog_info(`[%s] Selected channel list from config (default channel list shall be used in case channels haven't been selected) = %s \n`, iface, (chan_list_valid || '[]'));
|
ulog_info(`[%s] Selected channel list from config (default channel list shall be used in case channels haven't been selected) = %s \n`, iface, chan_list_valid);
|
||||||
|
|
||||||
if (band == '2g' && bw >= 40) {
|
if (band == '2g' && bw >= 40) {
|
||||||
ulog_info(`[%s] It is highly recommended to NOT use %dMHz bandwidth for 2.4G radio \n`, iface, bw);
|
ulog_info(`[%s] It is highly recommended to NOT use %dMHz bandwidth for 2.4G radio \n`, iface, bw);
|
||||||
@@ -493,6 +445,7 @@ function random_channel_selection(iface, band, htmode, chan_list_valid) {
|
|||||||
36,
|
36,
|
||||||
52,
|
52,
|
||||||
100,
|
100,
|
||||||
|
116,
|
||||||
132,
|
132,
|
||||||
149,
|
149,
|
||||||
165
|
165
|
||||||
@@ -501,6 +454,7 @@ function random_channel_selection(iface, band, htmode, chan_list_valid) {
|
|||||||
36, 44,
|
36, 44,
|
||||||
52, 60,
|
52, 60,
|
||||||
100, 108,
|
100, 108,
|
||||||
|
116, 124,
|
||||||
132, 140,
|
132, 140,
|
||||||
149, 157,
|
149, 157,
|
||||||
165
|
165
|
||||||
@@ -509,7 +463,7 @@ function random_channel_selection(iface, band, htmode, chan_list_valid) {
|
|||||||
36, 40, 44, 48,
|
36, 40, 44, 48,
|
||||||
52, 56, 60, 64,
|
52, 56, 60, 64,
|
||||||
100, 104, 108, 112,
|
100, 104, 108, 112,
|
||||||
116,
|
116, 120, 124, 128,
|
||||||
132, 136, 140, 144,
|
132, 136, 140, 144,
|
||||||
149, 153, 157, 161,
|
149, 153, 157, 161,
|
||||||
165
|
165
|
||||||
@@ -568,12 +522,12 @@ function random_channel_selection(iface, band, htmode, chan_list_valid) {
|
|||||||
return random_channel;
|
return random_channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
function algo_rcs(iface, current_channel, band, htmode, selected_channels) {
|
function algo_rcs(iface, iface_num, current_channel, band, htmode, selected_channels) {
|
||||||
let chosen_random_channel = 0;
|
let chosen_random_channel = 0;
|
||||||
let res = 0;
|
let res = 0;
|
||||||
|
|
||||||
// random_channel_selection script will help to select random channel
|
// random_channel_selection script will help to select random channel
|
||||||
chosen_random_channel = random_channel_selection(iface, band, htmode, selected_channels);
|
chosen_random_channel = random_channel_selection(iface, iface_num, band, htmode, selected_channels);
|
||||||
stats_info_write("/tmp/rrm_random_channel_" + iface, chosen_random_channel);
|
stats_info_write("/tmp/rrm_random_channel_" + iface, chosen_random_channel);
|
||||||
|
|
||||||
if (chosen_random_channel == current_channel) {
|
if (chosen_random_channel == current_channel) {
|
||||||
@@ -624,7 +578,7 @@ function channel_optimize() {
|
|||||||
let channel_config = {};
|
let channel_config = {};
|
||||||
let selected_channels = {};
|
let selected_channels = {};
|
||||||
let radio_5G_index = null;
|
let radio_5G_index = null;
|
||||||
let dfs_enabled_5g_f = {};
|
let dfs_enabled_5g = {};
|
||||||
|
|
||||||
// check the channel config used by the customer
|
// check the channel config used by the customer
|
||||||
let fixed_chan_bkp = {};
|
let fixed_chan_bkp = {};
|
||||||
@@ -655,12 +609,10 @@ function channel_optimize() {
|
|||||||
radio_disabled[j] = wireless_status[radio_id].disabled;
|
radio_disabled[j] = wireless_status[radio_id].disabled;
|
||||||
radio_band[j] = wireless_status[radio_id].config.band;
|
radio_band[j] = wireless_status[radio_id].config.band;
|
||||||
|
|
||||||
radio_iface[j] = 'radio ' + radio_band[j];
|
if (radio_disabled[j] == true) {
|
||||||
|
radio_iface[j] = 'radio ' + radio_band[j];
|
||||||
if (radio_disabled[j] == false) {
|
} else {
|
||||||
let interface_created = wireless_status[radio_id].interfaces[0];
|
radio_iface[j] = wireless_status[radio_id].interfaces[0].ifname;
|
||||||
if (interface_created)
|
|
||||||
radio_iface[j] = wireless_status[radio_id].interfaces[0].ifname;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check wlan interface status
|
// check wlan interface status
|
||||||
@@ -683,7 +635,7 @@ function channel_optimize() {
|
|||||||
|
|
||||||
// check if DFS is enabled for 5G radio
|
// check if DFS is enabled for 5G radio
|
||||||
if (acs_exclude_dfs[j] == false) {
|
if (acs_exclude_dfs[j] == false) {
|
||||||
dfs_enabled_5g_f[j] = 1;
|
dfs_enabled_5g[j] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -696,6 +648,7 @@ function channel_optimize() {
|
|||||||
|
|
||||||
if (selected_channels[j]) {
|
if (selected_channels[j]) {
|
||||||
ulog_info(`[%s] Selected channel list (please update the radio config, if not correct) = %s \n`, radio_iface[j], selected_channels[j]);
|
ulog_info(`[%s] Selected channel list (please update the radio config, if not correct) = %s \n`, radio_iface[j], selected_channels[j]);
|
||||||
|
// should I check the validity of the chan list selected by the user??
|
||||||
}
|
}
|
||||||
} else if (selected_algo == "ACS") {
|
} else if (selected_algo == "ACS") {
|
||||||
if (channel_config[j] != '0') {
|
if (channel_config[j] != '0') {
|
||||||
@@ -765,9 +718,6 @@ function channel_optimize() {
|
|||||||
} else {
|
} else {
|
||||||
check_all_cool_down++;
|
check_all_cool_down++;
|
||||||
}
|
}
|
||||||
} else if (current_rf_down[j] == 2) {
|
|
||||||
// this iface is HaLow interface and we can neither check channel utilization not switch channel
|
|
||||||
ulog_info(`[%s] HaLow interface is UP, but RRM cannot be done on this interface \n`, radio_iface[j]);
|
|
||||||
} else {
|
} else {
|
||||||
ulog_info(`[%s] Interface not UP, will be checked in the next interval \n`, radio_iface[j]);
|
ulog_info(`[%s] Interface not UP, will be checked in the next interval \n`, radio_iface[j]);
|
||||||
}
|
}
|
||||||
@@ -809,7 +759,7 @@ function channel_optimize() {
|
|||||||
let assign_max_chan_util = 0;
|
let assign_max_chan_util = 0;
|
||||||
|
|
||||||
// call RCS for multiple random chan
|
// call RCS for multiple random chan
|
||||||
let chan_scan = algo_rcs(radio_iface[l], curr_chan_list[num_chan-1], radio_band[l], htmode[l], selected_channels[l]);
|
let chan_scan = algo_rcs(radio_iface[l], l, curr_chan_list[num_chan-1], radio_band[l], htmode[l], selected_channels[l]);
|
||||||
curr_chan_list[num_chan] = stats_info_read("/tmp/rrm_random_channel_" + radio_iface[l]);
|
curr_chan_list[num_chan] = stats_info_read("/tmp/rrm_random_channel_" + radio_iface[l]);
|
||||||
|
|
||||||
if (chan_scan == 1) {
|
if (chan_scan == 1) {
|
||||||
@@ -822,22 +772,21 @@ function channel_optimize() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (l == radio_5G_index) {
|
if (l == radio_5G_index) {
|
||||||
dfs_enabled_5g_f[l] = dfs_chan_check(radio_iface[l], init_payload.channel);
|
dfs_enabled_5g[l] = dfs_chan_check(radio_5G_index, init_payload.channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
ulog_info(`[%s] Initiated channel switch to random channel %d for comparing Channel utilization \n`, radio_iface[l], init_payload.channel);
|
ulog_info(`[%s] Initiated channel switch to random channel %d for comparing Channel utilization \n`, radio_iface[l], init_payload.channel);
|
||||||
let init_chan_switch_status = hostapd_switch_channel(init_payload);
|
let init_chan_switch_status = hostapd_switch_channel(init_payload);
|
||||||
|
|
||||||
if (init_chan_switch_status != 0) {
|
if (init_chan_switch_status != 0) {
|
||||||
let actual_channel = switch_status_check(radio_iface[l], dfs_enabled_5g_f[l]);
|
let actual_channel = switch_status_check(radio_iface[l], dfs_enabled_5g[l]);
|
||||||
|
|
||||||
if (actual_channel == init_payload.channel) {
|
if (actual_channel == init_payload.channel) {
|
||||||
ulog_info(`[%s] Channel Switch success; Checking Channel utilization ... \n`, radio_iface[l]);
|
ulog_info(`[%s] Channel Switch success; Checking Channel utilization ... \n`, radio_iface[l]);
|
||||||
// get chan util for current assigned random channel
|
// get chan util for current assigned random channel
|
||||||
sleep(5000);
|
|
||||||
chan_util_list[num_chan] = get_chan_util(radio_band[l], sleep_time);
|
chan_util_list[num_chan] = get_chan_util(radio_band[l], sleep_time);
|
||||||
} else {
|
} else {
|
||||||
if (dfs_enabled_5g_f[l] == 1 && interface_status_check(radio_iface[l]) == 1) {
|
if (dfs_enabled_5g[l] == 1 && interface_status_check(radio_iface[l]) == 1) {
|
||||||
// dfs channel not up yet
|
// dfs channel not up yet
|
||||||
ulog_info(`[%s] DFS channel %d taking too long to be UP. Interface status/Channel utilization will be checked in the next interval\n`, radio_iface[l], init_payload.channel);
|
ulog_info(`[%s] DFS channel %d taking too long to be UP. Interface status/Channel utilization will be checked in the next interval\n`, radio_iface[l], init_payload.channel);
|
||||||
// jump back to original channel
|
// jump back to original channel
|
||||||
@@ -894,7 +843,7 @@ function channel_optimize() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (l == radio_5G_index) {
|
if (l == radio_5G_index) {
|
||||||
dfs_enabled_5g_f[l] = dfs_chan_check(radio_iface[l], final_payload.channel);
|
dfs_enabled_5g[l] = dfs_chan_check(radio_5G_index, final_payload.channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (final_payload.channel != curr_chan_list[max_chan-1] || min_util != chan_util_list[max_chan-1]) {
|
if (final_payload.channel != curr_chan_list[max_chan-1] || min_util != chan_util_list[max_chan-1]) {
|
||||||
@@ -902,7 +851,7 @@ function channel_optimize() {
|
|||||||
let final_switch_status = hostapd_switch_channel(final_payload);
|
let final_switch_status = hostapd_switch_channel(final_payload);
|
||||||
|
|
||||||
if (final_switch_status != 0) {
|
if (final_switch_status != 0) {
|
||||||
let final_channel = switch_status_check(radio_iface[l], dfs_enabled_5g_f[l]);
|
let final_channel = switch_status_check(radio_iface[l], dfs_enabled_5g[l]);
|
||||||
|
|
||||||
if (final_channel == final_payload.channel) {
|
if (final_channel == final_payload.channel) {
|
||||||
ulog_info(`[%s] Final channel switch success \n`, radio_iface[l]);
|
ulog_info(`[%s] Final channel switch success \n`, radio_iface[l]);
|
||||||
@@ -997,7 +946,7 @@ function channel_optimize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// need to wait for radio 5GHz interface, when it is DFS enabled && restarted
|
// need to wait for radio 5GHz interface, when it is DFS enabled && restarted
|
||||||
if (radio_5g_restarted == 1 && dfs_enabled_5g_f[radio_5G_index] == 1) {
|
if (radio_5g_restarted == 1 && dfs_enabled_5g[radio_5G_index] == 1) {
|
||||||
ulog_info(`[%s] 5G radio might need some time to be UP (DFS enabled) ... wait for 30 seconds \n`, radio_iface[radio_5G_index]);
|
ulog_info(`[%s] 5G radio might need some time to be UP (DFS enabled) ... wait for 30 seconds \n`, radio_iface[radio_5G_index]);
|
||||||
// 30 sec delay for DFS scan to come finish
|
// 30 sec delay for DFS scan to come finish
|
||||||
sleep(30000);
|
sleep(30000);
|
||||||
@@ -1015,7 +964,7 @@ function channel_optimize() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ulog_info(`RRM with channel optimization finished; next RRM round starts in %d seconds \n`, config.interval/1000);
|
ulog_info(`Interference detection finish; next RRM round starts in %d seconds \n`, config.interval/1000);
|
||||||
|
|
||||||
return config.interval;
|
return config.interval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
From 9afc63f356f10942f924aaa6361f314f06727495 Mon Sep 17 00:00:00 2001
|
|
||||||
From: John Crispin <john@phrozen.org>
|
|
||||||
Date: Mon, 21 Jul 2025 13:27:07 +0200
|
|
||||||
Subject: [PATCH] include/download.mk: switch to using git:// instead of
|
|
||||||
https://
|
|
||||||
|
|
||||||
Signed-off-by: John Crispin <john@phrozen.org>
|
|
||||||
---
|
|
||||||
include/download.mk | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/include/download.mk b/include/download.mk
|
|
||||||
index 9ab0b6c08f..430bd89307 100644
|
|
||||||
--- a/include/download.mk
|
|
||||||
+++ b/include/download.mk
|
|
||||||
@@ -3,7 +3,7 @@
|
|
||||||
# Copyright (C) 2006-2012 OpenWrt.org
|
|
||||||
# Copyright (C) 2016 LEDE project
|
|
||||||
|
|
||||||
-PROJECT_GIT = https://git.openwrt.org
|
|
||||||
+PROJECT_GIT = git://git.openwrt.org
|
|
||||||
|
|
||||||
OPENWRT_GIT = $(PROJECT_GIT)
|
|
||||||
LEDE_GIT = $(PROJECT_GIT)
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
From 0f590999ea33fb91160aec123a9a74c31623584e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Paul White <paul@shasta.cloud>
|
|
||||||
Date: Mon, 21 Jul 2025 22:41:52 +0000
|
|
||||||
Subject: [PATCH] feeds.default.conf: switch to using git:// instead of
|
|
||||||
https://
|
|
||||||
|
|
||||||
Signed-off-by: Paul White <paul@shasta.cloud>
|
|
||||||
---
|
|
||||||
feeds.conf.default | 8 ++++----
|
|
||||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/feeds.conf.default b/feeds.conf.default
|
|
||||||
index d467db5627..bafcf8aa98 100644
|
|
||||||
--- a/feeds.conf.default
|
|
||||||
+++ b/feeds.conf.default
|
|
||||||
@@ -1,4 +1,4 @@
|
|
||||||
-src-git packages https://git.openwrt.org/feed/packages.git;openwrt-23.05
|
|
||||||
-src-git luci https://git.openwrt.org/project/luci.git;openwrt-23.05
|
|
||||||
-src-git routing https://git.openwrt.org/feed/routing.git;openwrt-23.05
|
|
||||||
-src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-23.05
|
|
||||||
+src-git packages git://git.openwrt.org/feed/packages.git;openwrt-23.05
|
|
||||||
+src-git luci git://git.openwrt.org/project/luci.git;openwrt-23.05
|
|
||||||
+src-git routing git://git.openwrt.org/feed/routing.git;openwrt-23.05
|
|
||||||
+src-git telephony git://git.openwrt.org/feed/telephony.git;openwrt-23.05
|
|
||||||
--
|
|
||||||
2.43.0
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user