From f7a6329bbd5dd621eccc10a05141b58f3b72ec06 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 27 Feb 2018 12:37:26 +0100 Subject: cosmetic: bsc_network_init(): imply default 001-01 PLMN All callers pass mcc=1, mnc=1, so just have it as default. (Prepare for net->country_code etc to be replaced by net->plmn) Change-Id: Ic16bc0bab3f2d4721e86a1a04f9d9f988d777df2 --- include/osmocom/bsc/common_bsc.h | 4 +--- src/ipaccess/ipaccess-config.c | 2 +- src/libbsc/bsc_init.c | 2 +- src/libbsc/net_init.c | 10 +++++----- src/utils/bs11_config.c | 2 +- tests/bsc/bsc_test.c | 2 +- tests/bssap/bssap_test.c | 2 +- tests/channel/channel_test.c | 2 +- tests/gsm0408/gsm0408_test.c | 2 +- tests/handover/handover_test.c | 2 +- 10 files changed, 14 insertions(+), 16 deletions(-) diff --git a/include/osmocom/bsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h index d3c7ff5bf..c23d20cb5 100644 --- a/include/osmocom/bsc/common_bsc.h +++ b/include/osmocom/bsc/common_bsc.h @@ -2,6 +2,4 @@ #include -struct gsm_network *bsc_network_init(void *ctx, - uint16_t country_code, - uint16_t network_code); +struct gsm_network *bsc_network_init(void *ctx); diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c index 7e8cafdba..a1985b761 100644 --- a/src/ipaccess/ipaccess-config.c +++ b/src/ipaccess/ipaccess-config.c @@ -992,7 +992,7 @@ int main(int argc, char **argv) } libosmo_abis_init(tall_ctx_config); - bsc_gsmnet = bsc_network_init(tall_bsc_ctx, 1, 1); + bsc_gsmnet = bsc_network_init(tall_bsc_ctx); if (!bsc_gsmnet) exit(1); diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 2fddc80e1..a2f0504e1 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -547,7 +547,7 @@ static int bootstrap_bts(struct gsm_bts *bts) int bsc_network_alloc(void) { /* initialize our data structures */ - bsc_gsmnet = bsc_network_init(tall_bsc_ctx, 1, 1); + bsc_gsmnet = bsc_network_init(tall_bsc_ctx); if (!bsc_gsmnet) return -ENOMEM; diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 2f65a5208..e44c335d1 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -22,6 +22,7 @@ #include #include #include +#include /* XXX hard-coded for now */ #define T3122_CHAN_LOAD_SAMPLE_INTERVAL 1 /* in seconds */ @@ -38,9 +39,7 @@ static void update_t3122_chan_load_timer(void *data) osmo_timer_schedule(&net->t3122_chan_load_timer, T3122_CHAN_LOAD_SAMPLE_INTERVAL, 0); } -struct gsm_network *bsc_network_init(void *ctx, - uint16_t country_code, - uint16_t network_code) +struct gsm_network *bsc_network_init(void *ctx) { struct gsm_network *net; @@ -48,8 +47,9 @@ struct gsm_network *bsc_network_init(void *ctx, if (!net) return NULL; - net->country_code = country_code; - net->network_code = network_code; + net->country_code = 1; + net->network_code = 1; + /* Permit a compile-time default of A5/3 and A5/1 */ net->a5_encryption_mask = (1 << 3) | (1 << 1); diff --git a/src/utils/bs11_config.c b/src/utils/bs11_config.c index 8e947eb3e..bc0f488d4 100644 --- a/src/utils/bs11_config.c +++ b/src/utils/bs11_config.c @@ -915,7 +915,7 @@ int main(int argc, char **argv) handle_options(argc, argv); bts_model_bs11_init(); - gsmnet = bsc_network_init(tall_bs11cfg_ctx, 1, 1); + gsmnet = bsc_network_init(tall_bs11cfg_ctx); if (!gsmnet) { fprintf(stderr, "Unable to allocate gsm network\n"); exit(1); diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c index 9c35d2f60..541a44caf 100644 --- a/tests/bsc/bsc_test.c +++ b/tests/bsc/bsc_test.c @@ -122,7 +122,7 @@ static void test_scan(void) { int i; - struct gsm_network *net = bsc_network_init(NULL, 1, 1); + struct gsm_network *net = bsc_network_init(NULL); struct gsm_bts *bts = gsm_bts_alloc(net, 0); struct bsc_msc_data *msc; struct gsm_subscriber_connection *conn; diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index ad8974f73..cf60e3871 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -89,7 +89,7 @@ void test_cell_identifier() struct bsc_msc_data *msc; struct gsm_bts *bts; - bsc_gsmnet = bsc_network_init(NULL, 1, 1); + bsc_gsmnet = bsc_network_init(NULL); bsc_gsmnet->bsc_data->rf_ctrl = talloc_zero(NULL, struct osmo_bsc_rf); bsc_gsmnet->bsc_data->rf_ctrl->policy = S_RF_ON; diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c index f37877e94..b41e3d6a7 100644 --- a/tests/channel/channel_test.c +++ b/tests/channel/channel_test.c @@ -38,7 +38,7 @@ void test_bts_debug_print(void) printf("Testing the lchan printing:"); /* Create a dummy network */ - network = bsc_network_init(tall_bsc_ctx, 1, 1); + network = bsc_network_init(tall_bsc_ctx); if (!network) exit(1); /* Add a BTS with some reasonanbly non-zero id */ diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index aeec56f4c..9f5a5c41f 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -834,7 +834,7 @@ int main(int argc, char **argv) osmo_init_logging(&log_info); log_set_log_level(osmo_stderr_target, LOGL_INFO); - net = bsc_network_init(tall_bsc_ctx, 1, 1); + net = bsc_network_init(tall_bsc_ctx); if (!net) { printf("Network init failure.\n"); return EXIT_FAILURE; diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index d1f75ba4e..8ba97fd8e 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -1293,7 +1293,7 @@ int main(int argc, char **argv) log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME); /* Create a dummy network */ - bsc_gsmnet = bsc_network_init(NULL, 1, 1); + bsc_gsmnet = bsc_network_init(NULL); if (!bsc_gsmnet) exit(1); -- cgit v1.2.3