From ae5a3c419a50b97d61f65f0939935bc3c22abe92 Mon Sep 17 00:00:00 2001 From: Filip Matusiak <filip.matusiak@iopsys.eu> Date: Fri, 26 Aug 2022 12:06:47 +0200 Subject: [PATCH] Add cfg option for initial channel scan feature Signed-off-by: Filip Matusiak <filip.matusiak@iopsys.eu> --- README.md | 11 +++++++++++ src/cntlr_map.c | 7 +++++-- src/config.c | 8 ++++++++ src/config.h | 1 + 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ba0624c3..368631dd 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ config controller 'controller' option enable_bsta_steer '0' option use_bcn_metrics '0' option use_usta_metrics '0' + option initial_channel_scan '0' option primary_vid '1' option primary_pcp '0' option allow_bgdfs '0' @@ -400,8 +401,18 @@ config: config controller 'controller' option enable_sta_steer '1' option use_bcn_metrics '1' + option initial_channel_scan '1' ``` +BTM steering may also work fine w/o the initial_channel_scan set - it +depends on the bottom layer implementation. + +Setting the initial_channel_scan option itself will cause a radio scan request +to be issued towards given node and it's reported radios, providing there was +no prior scan results reported on given radio. This radio channel scan will +be issued once controller obtains first scan capability information tlv from +given node. Radios, opclasses and channels to scan depend on these scan caps. + The steering decision is based upon drop of the STA RCPI below certain threshold, which can be modified per radio via UCI config: diff --git a/src/cntlr_map.c b/src/cntlr_map.c index d1e74e9f..0437c29f 100644 --- a/src/cntlr_map.c +++ b/src/cntlr_map.c @@ -1009,14 +1009,17 @@ static int cntlr_parse_radio_scan_caps(struct controller *c, struct node *n, /* put addr into an array of radio MACs to be scanned */ - memcpy(&radio_id[num_radio], + if (c->cfg.initial_channel_scan) + memcpy(&radio_id[num_radio], nr->radio_el->macaddr, 6); + num_radio++; } /* issue a channel scan on reported radios */ - cntlr_initial_channel_scan_from_caps(c, n, radio_id, num_radio); + if (c->cfg.initial_channel_scan) + cntlr_initial_channel_scan_from_caps(c, n, radio_id, num_radio); return 0; } diff --git a/src/config.c b/src/config.c index 16d0742f..594600c6 100644 --- a/src/config.c +++ b/src/config.c @@ -563,6 +563,7 @@ static int cntlr_config_get_base(struct controller_config *c, CNTLR_ENABLE_BSTA_STEER, CNTLR_USE_BCN_METRICS, CNTLR_USE_USTA_METRICS, + CNTLR_INITIAL_CHANNEL_SCAN, CNTLR_STEER_MODULE, CNTLR_CHANNEL_PLAN_TIMEOUT, CNTLR_BGDFS_TIMEOUT, @@ -580,6 +581,7 @@ static int cntlr_config_get_base(struct controller_config *c, { .name = "enable_bsta_steer", .type = UCI_TYPE_STRING }, { .name = "use_bcn_metrics", .type = UCI_TYPE_STRING }, { .name = "use_usta_metrics", .type = UCI_TYPE_STRING }, + { .name = "initial_channel_scan", .type = UCI_TYPE_STRING }, { .name = "steer_module", .type = UCI_TYPE_LIST }, { .name = "channel_plan", .type = UCI_TYPE_STRING }, { .name = "allow_bgdfs", .type = UCI_TYPE_STRING }, @@ -643,6 +645,12 @@ static int cntlr_config_get_base(struct controller_config *c, c->use_usta_metrics = atoi(val) == 1 ? true : false; } + if (tb[CNTLR_INITIAL_CHANNEL_SCAN]) { + const char *val = tb[CNTLR_INITIAL_CHANNEL_SCAN]->v.string; + + c->initial_channel_scan = atoi(val) == 1 ? true : false; + } + if (tb[CNTLR_STEER_MODULE]) { struct uci_element *e; struct steer_control_config *sc; diff --git a/src/config.h b/src/config.h index d55395ef..7b57d07e 100644 --- a/src/config.h +++ b/src/config.h @@ -127,6 +127,7 @@ struct controller_config { bool enable_bsta_steer; bool use_bcn_metrics; bool use_usta_metrics; + bool initial_channel_scan; int num_bss; int num_apolicy; int acs_timeout; -- GitLab