diff options
author | Andreas.Eversberg <jolly@eversberg.eu> | 2010-10-01 19:24:34 +0000 |
---|---|---|
committer | Andreas.Eversberg <jolly@eversberg.eu> | 2010-10-01 19:24:34 +0000 |
commit | 66ff1cb347ed5d7315aa0f8e2c9b7a53d99d5892 (patch) | |
tree | 101a6d791d38df631cfe14fb5741526d7250ce9e /src/host/layer23/src | |
parent | f867cd207727b2ab4dcb9f302086b4ab149af95b (diff) |
[layer23] Minimum RX-level is now a configuratio option
The default (if config not yet created/updated), is still taken from
settings.c.
Diffstat (limited to 'src/host/layer23/src')
-rw-r--r-- | src/host/layer23/src/mobile/app_mobile.c | 2 | ||||
-rw-r--r-- | src/host/layer23/src/mobile/gsm322.c | 2 | ||||
-rw-r--r-- | src/host/layer23/src/mobile/settings.c | 2 | ||||
-rw-r--r-- | src/host/layer23/src/mobile/vty_interface.c | 13 |
4 files changed, 17 insertions, 2 deletions
diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index ee346a77..60055e9a 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -170,10 +170,10 @@ int l23_app_init(struct osmocom_ms *ms) srand(time(NULL)); + gsm_support_init(ms); gsm_sim_init(ms); gsm_settings_init(ms); gsm48_cc_init(ms); - gsm_support_init(ms); gsm_subscr_init(ms); gsm48_rr_init(ms); gsm48_mm_init(ms); diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c index 6addff68..92287275 100644 --- a/src/host/layer23/src/mobile/gsm322.c +++ b/src/host/layer23/src/mobile/gsm322.c @@ -2418,7 +2418,7 @@ static int gsm322_l1_signal(unsigned int subsys, unsigned int signal, cs->list[i].flags |= GSM322_CS_FLAG_POWER; cs->list[i].flags &= ~GSM322_CS_FLAG_SIGNAL; /* if minimum level is reached or if we stick to a cell */ - if (rxlev2dbm(rxlev) >= ms->support.min_rxlev_db + if (rxlev2dbm(rxlev) >= ms->settings.min_rxlev_db || ms->settings.stick) { cs->list[i].flags |= GSM322_CS_FLAG_SIGNAL; LOGP(DCS, LOGL_INFO, "Found signal (frequency %d " diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c index 6b6a9325..b1e17552 100644 --- a/src/host/layer23/src/mobile/settings.c +++ b/src/host/layer23/src/mobile/settings.c @@ -44,6 +44,8 @@ int gsm_settings_init(struct osmocom_ms *ms) if (sup->half_v1 || sup->half_v3) set->half = 1; + set->min_rxlev_db = sup->min_rxlev_db; + return 0; } diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 66afce28..78488652 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -845,6 +845,7 @@ static void config_write_ms_single(struct vty *vty, struct osmocom_ms *ms) vty_out(vty, " hplmn-search %s%s", (set->test_always) ? "everywhere" : "foreign-country", VTY_NEWLINE); vty_out(vty, " exit%s", VTY_NEWLINE); + vty_out(vty, " min-rxlev %d%s", set->min_rxlev_db, VTY_NEWLINE); if (set->alter_tx_power) if (set->alter_tx_power_value) vty_out(vty, " tx-power %d%s", @@ -1085,6 +1086,17 @@ DEFUN(cfg_no_clir, cfg_ms_no_clir_cmd, "no clir", return CMD_SUCCESS; } +DEFUN(cfg_ms_min_rxlev, cfg_ms_min_rxlev_cmd, "min-rxlev <-110--47>", + "Set the minimum receive level to select a cell\n" + "Minimum receive level from -110 dBm to -47 dBm") +{ + struct osmocom_ms *ms = vty->index; + + ms->settings.min_rxlev_db = atoi(argv[0]); + + return CMD_SUCCESS; +} + DEFUN(cfg_ms_tx_power, cfg_ms_tx_power_cmd, "tx-power (auto|full)", "Set the way to choose transmit power\nControlled by BTS\n" "Always full power\nFixed GSM power value if supported") @@ -1534,6 +1546,7 @@ int ms_vty_init(void) install_element(MS_NODE, &cfg_ms_no_clip_cmd); install_element(MS_NODE, &cfg_ms_no_clir_cmd); install_element(MS_NODE, &cfg_ms_testsim_cmd); + install_element(MS_NODE, &cfg_ms_min_rxlev_cmd); install_element(MS_NODE, &cfg_ms_tx_power_cmd); install_element(MS_NODE, &cfg_ms_tx_power_val_cmd); install_element(MS_NODE, &cfg_ms_sim_delay_cmd); |