diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-11-12 12:50:23 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-11-18 20:29:40 +0000 |
commit | eebb6a4216f136132400831ca35ed70e7502e92a (patch) | |
tree | 0b987086e93e19d08360cd4d647af4f15d11688f /src/common/main.c | |
parent | e5f4654ee34c5a346a0b85805c706115464e96e1 (diff) |
bts: Allocate TRX for BTS dynamically, deprecate -t
No need to pass -t num_trx anymore to specify number of TRX to use. It
is calculated based on dynamic allocation from VTY config.
Using parameter -t is flagged as deprecated and is transformed into a
NOOP por backward compatibility.
As a result, TRX now are allocated after the BTS is allocated and
initial config (pre-VTY) is applied.
A new function bts_trx_init() is added, to set default config on each
TRX during allocation and before setting VTY config on it.
A new per BTS model function bts_model_trx_init() is added, to allow
per model specific default configuration of each TRX.
Change-Id: Iab1a754ab12a626759f9f90aa66f87bdce65ac9c
Diffstat (limited to 'src/common/main.c')
-rw-r--r-- | src/common/main.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/common/main.c b/src/common/main.c index 9121a2ab..f90a4d4d 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -59,7 +59,6 @@ int quit = 0; static const char *config_file = "osmo-bts.cfg"; static int daemonize = 0; static int rt_prio = -1; -static int trx_num = 1; static char *gsmtap_ip = 0; extern int g_vty_port_num; @@ -76,8 +75,6 @@ static void print_help() " -e --log-level Set a global log-level\n" " -r --realtime PRIO Use SCHED_RR with the specified priority\n" " -i --gsmtap-ip The destination IP used for GSMTAP.\n" - " -t --trx-num Set number of TRX (default=%d)\n", - trx_num ); bts_model_print_help(); } @@ -152,9 +149,8 @@ static void handle_options(int argc, char **argv) gsmtap_ip = optarg; break; case 't': - trx_num = atoi(optarg); - if (trx_num < 1) - trx_num = 1; + fprintf(stderr, "Parameter -t is deprecated and does nothing, " + "TRX num is calculated from VTY\n"); break; case '?': case 1: @@ -228,7 +224,7 @@ int bts_main(int argc, char **argv) { struct gsm_bts_trx *trx; struct e1inp_line *line; - int rc, i; + int rc; printf("((*))\n |\n / \\ OsmoBTS\n"); @@ -251,13 +247,7 @@ int bts_main(int argc, char **argv) fprintf(stderr, "Failed to create BTS structure\n"); exit(1); } - for (i = 1; i < trx_num; i++) { - trx = gsm_bts_trx_alloc(bts); - if (!trx) { - fprintf(stderr, "Failed to create TRX structure\n"); - exit(1); - } - } + e1inp_vty_init(); bts_vty_init(bts, &bts_log_info); |