mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-02 03:17:48 +00:00
Raise the priority of BDR in case when DR is inactive, so that in the election process BDR is elected as DR. Signed-off-by: Chaitanya Godavarthi <chaitanya.kiran@netexperience.com>
144 lines
3.6 KiB
Diff
144 lines
3.6 KiB
Diff
Index: opensync-2.0.5.0/interfaces/opensync.ovsschema
|
|
===================================================================
|
|
--- opensync-2.0.5.0.orig/interfaces/opensync.ovsschema
|
|
+++ opensync-2.0.5.0/interfaces/opensync.ovsschema
|
|
@@ -9368,6 +9368,69 @@
|
|
}
|
|
},
|
|
"isRoot": true
|
|
+ },
|
|
+ "APC_Config": {
|
|
+ "columns": {
|
|
+ "enabled": {
|
|
+ "type": {
|
|
+ "key": {
|
|
+ "type": "boolean"
|
|
+ },
|
|
+ "min": 0,
|
|
+ "max": 1
|
|
+ }
|
|
+ }
|
|
+ },
|
|
+ "isRoot": true,
|
|
+ "maxRows": 1
|
|
+ },
|
|
+ "APC_State": {
|
|
+ "columns": {
|
|
+ "dr_addr": {
|
|
+ "type": {
|
|
+ "key": {
|
|
+ "type": "string"
|
|
+ }
|
|
+ }
|
|
+ },
|
|
+ "bdr_addr": {
|
|
+ "type": {
|
|
+ "key": {
|
|
+ "type": "string"
|
|
+ }
|
|
+ }
|
|
+ },
|
|
+ "enabled": {
|
|
+ "type": {
|
|
+ "key": {
|
|
+ "type": "boolean"
|
|
+ },
|
|
+ "min": 0,
|
|
+ "max": 1
|
|
+ }
|
|
+ },
|
|
+ "mode": {
|
|
+ "type": {
|
|
+ "key": {
|
|
+ "type": "string",
|
|
+ "enum": [
|
|
+ "set",
|
|
+ [
|
|
+ "DR",
|
|
+ "BDR",
|
|
+ "OR",
|
|
+ "WT",
|
|
+ "NC"
|
|
+ ]
|
|
+ ]
|
|
+ },
|
|
+ "min": 0,
|
|
+ "max": 1
|
|
+ }
|
|
+ }
|
|
+ },
|
|
+ "isRoot": true,
|
|
+ "maxRows": 1
|
|
}
|
|
}
|
|
}
|
|
Index: opensync-2.0.5.0/platform/openwrt/src/lib/target/src/radio_ubus.c
|
|
===================================================================
|
|
--- opensync-2.0.5.0.orig/platform/openwrt/src/lib/target/src/radio_ubus.c
|
|
+++ opensync-2.0.5.0/platform/openwrt/src/lib/target/src/radio_ubus.c
|
|
@@ -10,6 +10,7 @@
|
|
extern struct ev_loop *wifihal_evloop;
|
|
static struct ubus_context *ubus;
|
|
extern struct ev_loop *wifihal_evloop;
|
|
+extern void apc_state_set(struct blob_attr *msg);
|
|
|
|
int hapd_rrm_enable(char *name, int neighbor, int beacon)
|
|
{
|
|
@@ -179,6 +180,7 @@ radio_ubus_add_vif_cb(struct ubus_contex
|
|
return UBUS_STATUS_OK;
|
|
}
|
|
|
|
+
|
|
static const struct ubus_method radio_ubus_methods[] = {
|
|
UBUS_METHOD("dbg_add_vif", radio_ubus_add_vif_cb, add_vif_policy),
|
|
UBUS_METHOD("dummy", radio_ubus_dummy_cb, dummy_policy),
|
|
@@ -201,8 +203,36 @@ static void radio_ubus_connect(struct ub
|
|
ubus_add_object(ubus, &radio_ubus_object);
|
|
}
|
|
|
|
+static int radio_ubus_notify(struct ubus_context *ctx, struct ubus_object *obj,
|
|
+ struct ubus_request_data *req, const char *method,
|
|
+ struct blob_attr *msg)
|
|
+{
|
|
+ char *str;
|
|
+
|
|
+ str = blobmsg_format_json(msg, true);
|
|
+ LOGD("ubus: Received ubus notify '%s': %s\n", method, str);
|
|
+ free(str);
|
|
+
|
|
+ if (!strncmp(method, "apc", 3)) {
|
|
+ LOGD("APC notification Received");
|
|
+ apc_state_set(msg);
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+
|
|
+
|
|
static struct ubus_instance ubus_instance = {
|
|
.connect = radio_ubus_connect,
|
|
+ .notify = radio_ubus_notify,
|
|
+ .list = {
|
|
+ {
|
|
+ .path = "apc",
|
|
+ },
|
|
+ },
|
|
+ .len = 1,
|
|
+
|
|
};
|
|
|
|
int radio_ubus_init(void)
|
|
Index: opensync-2.0.5.0/src/lib/schema/inc/schema_consts.h
|
|
===================================================================
|
|
--- opensync-2.0.5.0.orig/src/lib/schema/inc/schema_consts.h
|
|
+++ opensync-2.0.5.0/src/lib/schema/inc/schema_consts.h
|
|
@@ -154,6 +154,7 @@ typedef enum {
|
|
#define SCHEMA_CONSTS_DISABLE_B_RATES "disable_b_rates"
|
|
#define SCHEMA_CONSTS_IEEE80211k "ieee80211k"
|
|
#define SCHEMA_CONSTS_DYNAMIC_VLAN "dynamic_vlan"
|
|
+#define SCHEMA_CONSTS_RADPROXY "radproxy"
|
|
|
|
/* radio Custom options */
|
|
#define SCHEMA_CONSTS_LOCAL_PWR_CONSTRAINT "local_pwr_constraint"
|