csaba.sipos has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/39290?usp=email )
Change subject: nokia_site: introduce hopping control for Nokia *Site ......................................................................
nokia_site: introduce hopping control for Nokia *Site
nokia_site hopping-type 0 sets baseband hopping nokia_site hopping-type 1 sets sythesizer (RF) hopping
Signed-off-by: csaba.sipos metro4@freemail.hu Change-Id: Idb1d269d2ee80d72ede2394125e8acedf0ee8b06 --- M include/osmocom/bsc/bts.h M src/osmo-bsc/bts_nokia_site.c M src/osmo-bsc/bts_vty.c 3 files changed, 49 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/90/39290/1
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index 248c746..cb49361 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -488,7 +488,8 @@ no_loc_rel_cnf:1, /* don't wait for RSL REL CONF */ bts_reset_timer_cnf, /* timer for BTS RESET */ did_reset:1, /* we received a RESET ACK */ - wait_reset:2; /* we are waiting for reset to complete */ + wait_reset:2, /* we are waiting for reset to complete */ + nokia_hopping:1; /* hopping type selection for Nokia */ struct osmo_timer_list reset_timer; } nokia; }; diff --git a/src/osmo-bsc/bts_nokia_site.c b/src/osmo-bsc/bts_nokia_site.c index 14d4388..3a12b57 100644 --- a/src/osmo-bsc/bts_nokia_site.c +++ b/src/osmo-bsc/bts_nokia_site.c @@ -1102,7 +1102,7 @@ */
static int make_bts_config(struct gsm_bts *bts, uint8_t bts_type, int n_trx, uint8_t * fu_config, - int need_hopping) + int need_hopping, int hopping_type) { /* is it an InSite BTS ? */ if (bts_type == 0x0E || bts_type == 0x0F || bts_type == 0x10) { /* TODO */ @@ -1132,11 +1132,27 @@ len += (sizeof(bts_config_1) + (n_trx - 1));
memcpy(fu_config + len, bts_config_2, sizeof(bts_config_2)); - /* set hopping mode (Baseband and RF hopping work for the MetroSite) */ - if (need_hopping) - fu_config[len + 2 + 1] = 1; /* 0: no hopping, 1: Baseband hopping, 2: RF hopping */ + /* set hopping mode */ + if (need_hopping) { + switch (hopping_type) { + /* 0: no hopping, 1: Baseband hopping, 2: RF hopping */ + case 0: + LOG_BTS(bts, DNM, LOGL_INFO, "Baseband hopping selected!\n"); + fu_config[len + 2 + 1] = 1; + break; + case 1: + LOG_BTS(bts, DNM, LOGL_INFO, "Synthesizer (RF) hopping selected!\n"); + fu_config[len + 2 + 1] = 2; + break; + default: + LOG_BTS(bts, DNM, LOGL_INFO, "No hopping is selected!\n"); + fu_config[len + 2 + 1] = 0; + break; + } + } len += sizeof(bts_config_2);
+ /* set extended cell radius for each TRX */ for (i = 0; i < n_trx; i++) { memcpy(fu_config + len, bts_config_3, sizeof(bts_config_3)); @@ -1381,6 +1397,9 @@ int ret; int hopping = 0; int need_hopping = 0; + int hopping_type = 0; + + hopping_type = bts->nokia.nokia_hopping;
memset(config, 0, sizeof(config));
@@ -1407,7 +1426,7 @@ idx++; }
- ret = make_bts_config(bts, bts_type, idx, config + len, need_hopping); + ret = make_bts_config(bts, bts_type, idx, config + len, need_hopping, hopping_type); len += ret;
#if 0 /* debugging */ diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index f6ee514..a023591 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -464,6 +464,28 @@
return CMD_SUCCESS; } + +DEFUN_ATTR(cfg_bts_nokia_site_hopping_type, + cfg_bts_nokia_site_hopping_type_cmd, + "nokia_site nokia_hopping (0|1)", + NOKIA_STR + "This parameter sets the frequency hopping type for Nokia *Site\n" + "0=Baseband hopping, 1=Synthesizer (RF) hopping\n", + CMD_ATTR_IMMEDIATE) +{ + struct gsm_bts *bts = vty->index; + + if (!is_nokia_bts(bts)) { + vty_out(vty, "%% BTS is not of Nokia *Site type%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + bts->nokia.nokia_hopping = atoi(argv[0]); + + return CMD_SUCCESS; +} + #define OML_STR "Organization & Maintenance Link\n" #define IPA_STR "A-bis/IP Specific Options\n"
@@ -4926,6 +4948,7 @@ install_element(BTS_NODE, &cfg_bts_nokia_site_skip_reset_cmd); install_element(BTS_NODE, &cfg_bts_nokia_site_no_loc_rel_cnf_cmd); install_element(BTS_NODE, &cfg_bts_nokia_site_bts_reset_timer_cnf_cmd); + install_element(BTS_NODE, &cfg_bts_nokia_site_hopping_type_cmd); install_element(BTS_NODE, &cfg_bts_stream_id_cmd); install_element(BTS_NODE, &cfg_bts_deprecated_stream_id_cmd); install_element(BTS_NODE, &cfg_bts_oml_e1_cmd);