Merge pull request #655 from Telecominfraproject/main

Merge for 3.0.2-rc3
This commit is contained in:
jaspreetsachdev
2024-04-12 12:21:01 -04:00
committed by GitHub
7 changed files with 110 additions and 6 deletions

View File

@@ -4,10 +4,10 @@ PKG_NAME:=ucentral-client
PKG_RELEASE:=1
PKG_SOURCE_URL=https://github.com/Telecominfraproject/wlan-ucentral-client.git
PKG_MIRROR_HASH:=62db7913d8e8495648ac35c5b0ed5f910c42fc7cdd1f6d70bb08394e8af56053
PKG_MIRROR_HASH:=3fa810edd53a8c08ce3d8090a095fbc1697c70c50e00a78931400df59fe66eaf
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2022-06-22
PKG_SOURCE_VERSION:=7628b5c7d4d0c5f6276b64abc371deb9c76f0734
PKG_SOURCE_VERSION:=f19b1e86b7f36f4adc544e087cadd7907dabb5f0
PKG_LICENSE:=BSD-3-Clause
PKG_MAINTAINER:=John Crispin <john@phrozen.org>

View File

@@ -224,6 +224,15 @@ handlers = {
ubus.call('network.interface.up_none', 'add_device', msg);
ubus.call('dhcprelay', 'check_devices');
},
vlan_remove: function(notify) {
if (ratelimit) {
let msg = {
device: notify.data.ifname,
};
ubus.call('ratelimit', 'device_delete', msg);
}
},
};

View File

@@ -4,10 +4,10 @@ PKG_NAME:=ucentral-schema
PKG_RELEASE:=1
PKG_SOURCE_URL=https://github.com/Telecominfraproject/wlan-ucentral-schema.git
PKG_MIRROR_HASH:=d081fdd3c4655254b8e4be76f0fa881f53f20a0e8bfcf12f3b547701b6ea126b
PKG_MIRROR_HASH:=5afb439480d12d3e8e5158f056850b034096cf36a91574dbeecd4a98a8830e83
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2022-05-29
PKG_SOURCE_VERSION:=cb1c18db707dc86c7eeb3e8828c8f37a689fe644
PKG_SOURCE_VERSION:=cc0bf95db178248a5e0d3adbc3bcfde1001c4802
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=BSD-3-Clause
@@ -31,7 +31,8 @@ define Build/Compile
endef
define Package/ucentral-schema/install
$(INSTALL_DIR) $(1)/usr/share/ucentral
$(INSTALL_DIR) $(1)/usr/share/ucentral $(1)/etc/ucentral/
$(CP) $(PKG_BUILD_DIR)/schema.json $(1)/etc/ucentral/
$(CP) $(PKG_BUILD_DIR)/schemareader.uc $(1)/usr/share/ucentral
$(CP) $(PKG_BUILD_DIR)/renderer/* $(1)/usr/share/ucentral
$(CP) $(PKG_BUILD_DIR)/command/*.uc $(1)/usr/share/ucentral

View File

@@ -129,6 +129,21 @@ function vlan_add(dev, vid, ad)
vlans[keystr] = true;
}
function vlan_config_push(vlan_config, dev, vid)
{
let vlan_found = false;
for (let v in vlan_config[dev]) {
if (v[0] == vid) {
vlan_found = true;
break;
}
}
if (!vlan_found)
push(vlan_config[dev], [ vid, "rx", "tx"]);
}
function vlan_set_config(config)
{
vlan_config = config;
@@ -221,7 +236,7 @@ function run_service() {
return ubus.STATUS_INVALID_ARGUMENT;
if (!vlan_config[req.args.device])
vlan_config[req.args.device] = [];
push(vlan_config[req.args.device], [ req.args.vlan, "rx", "tx"]);
vlan_config_push(vlan_config, req.args.device, req.args.vlan);
vlan_set_config(vlan_config);
return 0;
},

View File

@@ -0,0 +1,54 @@
Index: hostapd-2021-02-20-59e9794c/src/ap/ubus.c
===================================================================
--- hostapd-2021-02-20-59e9794c.orig/src/ap/ubus.c
+++ hostapd-2021-02-20-59e9794c/src/ap/ubus.c
@@ -25,6 +25,7 @@
#include "airtime_policy.h"
#include "hw_features.h"
#include "radius_client.h"
+#include "dfs.h"
static struct ubus_context *ctx;
static struct blob_buf b;
@@ -857,6 +858,7 @@ hostapd_switch_chan(struct ubus_context
u8 seg0 = 0, seg1 = 0;
int ret = UBUS_STATUS_OK;
int i;
+ int dfs_range = 0;
blobmsg_parse(csa_policy, __CSA_MAX, tb, blob_data(msg), blob_len(msg));
@@ -912,6 +914,17 @@ hostapd_switch_chan(struct ubus_context
break;
}
+ if (css.freq_params.center_freq1)
+ dfs_range += hostapd_is_dfs_overlap(
+ hapd->iface, chwidth, css.freq_params.center_freq1);
+ else
+ dfs_range += hostapd_is_dfs_overlap(
+ hapd->iface, chwidth, css.freq_params.freq);
+
+ if (css.freq_params.center_freq2)
+ dfs_range += hostapd_is_dfs_overlap(
+ hapd->iface, chwidth, css.freq_params.center_freq2);
+
hostapd_set_freq_params(&css.freq_params, iconf->hw_mode,
css.freq_params.freq,
css.freq_params.channel, iconf->enable_edmg,
@@ -925,6 +938,15 @@ hostapd_switch_chan(struct ubus_context
mode ? &mode->he_capab[IEEE80211_MODE_AP] :
NULL);
+ if (dfs_range) {
+ /* Perform CAC and switch channel */
+ freq_params = malloc(sizeof(*freq_params));
+ memcpy(freq_params, &css.freq_params, sizeof(*freq_params));
+ eloop_register_timeout(0, 1, switch_chan_fallback_cb,
+ hapd->iface, freq_params);
+ return 0;
+ }
+
for (i = 0; i < hapd->iface->num_bss; i++) {
struct hostapd_data *bss = hapd->iface->bss[i];

View File

@@ -0,0 +1,25 @@
Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c
===================================================================
--- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c
+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c
@@ -3814,6 +3814,8 @@ hostapd_switch_channel_fallback(struct h
const struct hostapd_freq_params *freq_params)
{
int seg0_idx = 0, seg1_idx = 0, bw = CHANWIDTH_USE_HT;
+ u8 op_class;
+ u8 chan;
wpa_printf(MSG_DEBUG, "Restarting all CSA-related BSSes");
@@ -3846,6 +3848,11 @@ hostapd_switch_channel_fallback(struct h
iface->freq = freq_params->freq;
iface->conf->channel = freq_params->channel;
iface->conf->secondary_channel = freq_params->sec_channel_offset;
+ ieee80211_freq_to_channel_ext(freq_params->freq, freq_params->sec_channel_offset, bw, &op_class, &chan);
+ if (chan != freq_params->channel)
+ wpa_printf(MSG_ERROR, "Channel mismatch: %d -> %d", freq_params->channel, chan);
+
+ iface->conf->op_class = op_class;
hostapd_set_oper_centr_freq_seg0_idx(iface->conf, seg0_idx);
hostapd_set_oper_centr_freq_seg1_idx(iface->conf, seg1_idx);
hostapd_set_oper_chwidth(iface->conf, bw);