diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-05-26 12:41:18 +0200 |
---|---|---|
committer | neels <nhofmeyr@sysmocom.de> | 2020-05-29 20:16:40 +0000 |
commit | 06a14d289bf20f218d22380b11c4ad81ca5f54d2 (patch) | |
tree | db4a8071784e43a9689033786230453afd5624c5 /src/osmo-bsc/bsc_init.c | |
parent | b281b1cdb670dbd26354c1f45ce85a477bf5ed15 (diff) |
flatten: move network->bsc_data->* to network->*
The separate struct osmo_bsc_data is like another separate struct gsm_network
for no reason. It is labeled "per-BSC data". These days, all of this is a
single BSC and there will not be different sets of osmo_bsc_data.
Drop struct osmo_bsc_data, move its members directly into gsm_network.
Some places tested 'if (net->bsc_data)', which is always true. Modify those
cases to rather do checks like 'if (net->rf_ctrl)', which are also always true
AFAICT, to keep as much unmodified logic as possible in this patch.
Change-Id: Ic7ae65e3b36e6e4b279eb01ad594f1226b5929e0
Diffstat (limited to 'src/osmo-bsc/bsc_init.c')
-rw-r--r-- | src/osmo-bsc/bsc_init.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/osmo-bsc/bsc_init.c b/src/osmo-bsc/bsc_init.c index d08e9c861..7f145efb1 100644 --- a/src/osmo-bsc/bsc_init.c +++ b/src/osmo-bsc/bsc_init.c @@ -254,21 +254,15 @@ static struct gsm_network *bsc_network_init(void *ctx) { struct gsm_network *net = gsm_network_init(ctx); - net->bsc_data = talloc_zero(net, struct osmo_bsc_data); - if (!net->bsc_data) { - talloc_free(net); - return NULL; - } - net->bsc_data->cbc = talloc_zero(net->bsc_data, struct bsc_cbc_link); - if (!net->bsc_data->cbc) { + net->cbc = talloc_zero(net, struct bsc_cbc_link); + if (!net->cbc) { talloc_free(net); return NULL; } /* Init back pointer */ - net->bsc_data->auto_off_timeout = -1; - net->bsc_data->network = net; - INIT_LLIST_HEAD(&net->bsc_data->mscs); + net->auto_off_timeout = -1; + INIT_LLIST_HEAD(&net->mscs); net->ho = ho_cfg_init(net, NULL); net->hodec2.congestion_check_interval_s = HO_CFG_CONGESTION_CHECK_DEFAULT; @@ -298,12 +292,12 @@ static struct gsm_network *bsc_network_init(void *ctx) osmo_timer_setup(&net->t3122_chan_load_timer, update_t3122_chan_load_timer, net); osmo_timer_schedule(&net->t3122_chan_load_timer, T3122_CHAN_LOAD_SAMPLE_INTERVAL, 0); - net->bsc_data->cbc->net = net; + net->cbc->net = net; /* no cbc_hostname: client not started by default */ - net->bsc_data->cbc->config.cbc_port = CBSP_TCP_PORT; + net->cbc->config.cbc_port = CBSP_TCP_PORT; /* listen_port == -1: server not started by default */ - net->bsc_data->cbc->config.listen_port = -1; - net->bsc_data->cbc->config.listen_hostname = talloc_strdup(net->bsc_data->cbc, "127.0.0.1"); + net->cbc->config.listen_port = -1; + net->cbc->config.listen_hostname = talloc_strdup(net->cbc, "127.0.0.1"); return net; } |