aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-02-27 12:37:26 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-03-05 05:37:54 +0100
commitf7a6329bbd5dd621eccc10a05141b58f3b72ec06 (patch)
treead4e9b671dae8de26a4286a27499aff08dd5fd9c
parent4d358c00e1b3389291bdb3d5c40d0da8d6cf4d02 (diff)
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
-rw-r--r--include/osmocom/bsc/common_bsc.h4
-rw-r--r--src/ipaccess/ipaccess-config.c2
-rw-r--r--src/libbsc/bsc_init.c2
-rw-r--r--src/libbsc/net_init.c10
-rw-r--r--src/utils/bs11_config.c2
-rw-r--r--tests/bsc/bsc_test.c2
-rw-r--r--tests/bssap/bssap_test.c2
-rw-r--r--tests/channel/channel_test.c2
-rw-r--r--tests/gsm0408/gsm0408_test.c2
-rw-r--r--tests/handover/handover_test.c2
10 files changed, 14 insertions, 16 deletions
diff --git a/include/osmocom/bsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h
index d3c7ff5..c23d20c 100644
--- a/include/osmocom/bsc/common_bsc.h
+++ b/include/osmocom/bsc/common_bsc.h
@@ -2,6 +2,4 @@
#include <stdint.h>
-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 7e8cafd..a1985b7 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 2fddc80..a2f0504 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 2f65a52..e44c335 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -22,6 +22,7 @@
#include <osmocom/bsc/gsm_04_08_utils.h>
#include <osmocom/bsc/handover_cfg.h>
#include <osmocom/bsc/chan_alloc.h>
+#include <osmocom/bsc/common_bsc.h>
/* 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 8e947eb..bc0f488 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 9c35d2f..541a44c 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 ad8974f..cf60e38 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 f37877e..b41e3d6 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 aeec56f..9f5a5c4 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 d1f75ba..8ba97fd 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);