diff options
author | Oliver Smith <osmith@sysmocom.de> | 2022-04-25 12:20:21 +0200 |
---|---|---|
committer | osmith <osmith@sysmocom.de> | 2022-04-26 12:06:47 +0000 |
commit | d05549307159437ef25db51a05a88ccc08e89437 (patch) | |
tree | c86ce98951f67bd476fae920b0d29bf33a59392f | |
parent | 5586149d73fb127724e70da2b97daa1a36550a55 (diff) |
gsm_data: add gsm_set_bts_model
Let all changes of the bts model go through this function, so we can in
a future patch copy over the bts model's features to the bts.
Related: SYS#5922, OS#5538
Change-Id: I8475c8c20eb72411e8ca820181d1c8603c22a56d
-rw-r--r-- | include/osmocom/bsc/bts.h | 1 | ||||
-rw-r--r-- | src/osmo-bsc/bts.c | 8 | ||||
-rw-r--r-- | src/osmo-bsc/gsm_data.c | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index 4c1127bb8..1ac30a75a 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -734,6 +734,7 @@ int gsm_bts_local_neighbor_del(struct gsm_bts *bts, const struct gsm_bts *neighb /* return the gsm_lchan for the CBCH (if it exists at all) */ struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); +int gsm_set_bts_model(struct gsm_bts *bts, struct gsm_bts_model *model); int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c index 87ed44f44..774384f1d 100644 --- a/src/osmo-bsc/bts.c +++ b/src/osmo-bsc/bts.c @@ -612,6 +612,12 @@ struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) return NULL; } +int gsm_set_bts_model(struct gsm_bts *bts, struct gsm_bts_model *model) +{ + bts->model = model; + return 0; +} + int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) { struct gsm_bts_model *model; @@ -624,7 +630,7 @@ int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) return -EINVAL; bts->type = type; - bts->model = model; + gsm_set_bts_model(bts, model); if (model->start && !model->started) { int ret = model->start(bts->network); diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index b52b3ff3e..639a7247e 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -121,7 +121,7 @@ struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_typ net->num_bts++; bts->type = type; - bts->model = model; + gsm_set_bts_model(bts, model); bts->bsic = bsic; llist_add_tail(&bts->list, &net->bts_list); |