osmith submitted this change.

View Change

Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
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
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/bts.c
M src/osmo-bsc/gsm_data.c
3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 4c1127b..1ac30a7 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -734,6 +734,7 @@
/* 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 87ed44f..774384f 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -612,6 +612,12 @@
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 @@
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 b52b3ff..639a724 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -121,7 +121,7 @@
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);

1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.

To view, visit change 27920. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8475c8c20eb72411e8ca820181d1c8603c22a56d
Gerrit-Change-Number: 27920
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged