diff --git a/src/core/cntlr.c b/src/core/cntlr.c index fb345de911ce553a6946b1d9262ff3a0703850c9..10b64842ea108b8523069052ff56c56bb804f9a5 100644 --- a/src/core/cntlr.c +++ b/src/core/cntlr.c @@ -1675,7 +1675,6 @@ static void cntlr_query_nodes(struct uloop_timeout *t) send_cmdu(c, cmdu); cmdu_free(cmdu); } - } uloop_timeout_set(&c->query_nodes, 60 * 1000); diff --git a/src/core/cntlr_map.c b/src/core/cntlr_map.c index a1b656a8407b9abd79ecf03a3b16ffbcfc6582a6..f6edf1a8287ef279aa3203b42d56d4c6d5f43959 100644 --- a/src/core/cntlr_map.c +++ b/src/core/cntlr_map.c @@ -752,9 +752,6 @@ int handle_ap_metrics_response(void *cntlr, struct cmdu_buff *cmdu) return 0; } -#define STA_LINK_UL_RCPI_TH_1905 170 -#define STA_LINK_UL_RCPI_TH_NON1905 220 - int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu) { int i; @@ -801,14 +798,14 @@ int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu) offset += sizeof(*b); } - if (s->type == IEEE1905 && s->ul_rcpi < STA_LINK_UL_RCPI_TH_1905) { + if (s->type == IEEE1905 && s->ul_rcpi < c->cfg.rcpi_threshold) { struct cmdu_buff *bcn_cmdu; uint8_t wildcard[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; if (!c->cfg.enable_bsta_steer) { trace("|%s:%d| rcpi below %d, but will not query for beacon \ metrics to steer as 'enable_bsta_steer' not set!\n", - __func__, __LINE__, STA_LINK_UL_RCPI_TH_1905); + __func__, __LINE__, c->cfg.rcpi_threshold); return 0; } @@ -821,7 +818,7 @@ int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu) send_cmdu(c, bcn_cmdu); cmdu_free(bcn_cmdu); } - } else if (s->type == NON_IEEE1905 && s->ul_rcpi < STA_LINK_UL_RCPI_TH_NON1905) { + } else if (s->type == NON_IEEE1905 && s->ul_rcpi < c->cfg.rcpi_threshold) { struct cmdu_buff *bcn_cmdu; int i; uint8_t wildcard[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; diff --git a/src/core/config.c b/src/core/config.c index 3d74fff40914f5dd2b59ea9718c2a450e9fce20b..b2cca24a506afc532b609408f1d56c4c266cb003 100644 --- a/src/core/config.c +++ b/src/core/config.c @@ -417,6 +417,7 @@ static int cntlr_config_get_base(struct controller_config *c, CNTLR_AL_BRIDGE, CNTLR_ENABLE_STA_STEER, CNTLR_ENABLE_BSTA_STEER, + CNTLR_RCPI_STEER_THRESHOLD, NUM_CNTLR_ATTRS }; const struct uci_parse_option opts[] = { @@ -426,6 +427,7 @@ static int cntlr_config_get_base(struct controller_config *c, { .name = "al_bridge", .type = UCI_TYPE_STRING }, { .name = "enable_sta_steer", .type = UCI_TYPE_STRING }, { .name = "enable_bsta_steer", .type = UCI_TYPE_STRING }, + { .name = "rcpi_threshold", .type = UCI_TYPE_STRING }, }; struct uci_option *tb[NUM_CNTLR_ATTRS]; @@ -473,6 +475,13 @@ static int cntlr_config_get_base(struct controller_config *c, c->enable_bsta_steer = atoi(val) == 1 ? true : false; } + if (tb[CNTLR_RCPI_STEER_THRESHOLD]) { + const char *val = tb[CNTLR_RCPI_STEER_THRESHOLD]->v.string; + + c->rcpi_threshold = atoi(val); + } else + c->rcpi_threshold = 120; + return 0; } diff --git a/src/core/config.h b/src/core/config.h index 28f0ba9452efaa973ea3b5e64e638c3203c2bb45..bb0899b6f000c3661a7e3f81d10cdd0e36d0bee5 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -100,6 +100,7 @@ struct controller_config { char al_bridge[16]; bool enable_sta_steer; bool enable_bsta_steer; + int rcpi_threshold; int num_bss; int num_vlans; int num_apolicy;