aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-oc2g
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-09-27 15:55:45 +0200
committerpespin <pespin@sysmocom.de>2019-10-05 20:50:13 +0000
commit972c24314694396c9b66fd8175cdcd40f01bdd39 (patch)
tree89b9a353434133e96d83df7c0efab23bf8c42861 /src/osmo-bts-oc2g
parent41c7b052838aaf17cd96daa8d7478b434bf4ab2a (diff)
struct gsm_bts: Add model_priv pointer handing bts_model specific data
Currently there's bts-virtual specific fields in gsm_bts which is not used by other models and are always allocated. An alternative would be having a union with different structs inside, one per model, but since we already have the bts_model abstraction, in this case it makes more sense to use that abstraction instead of filling code with preprocessor ifdefs to guard against non-defined types, etc. Existing model specific data is moved there. This new infra will be user further in forthcoming commits. Related: OS#4215 Change-Id: Ib17a752cdbaa7d5eb8c5dfa0b197f80a4f38b38e
Diffstat (limited to 'src/osmo-bts-oc2g')
-rw-r--r--src/osmo-bts-oc2g/l1_if.h7
-rw-r--r--src/osmo-bts-oc2g/main.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/src/osmo-bts-oc2g/l1_if.h b/src/osmo-bts-oc2g/l1_if.h
index 38699e01..e4b8feb4 100644
--- a/src/osmo-bts-oc2g/l1_if.h
+++ b/src/osmo-bts-oc2g/l1_if.h
@@ -30,6 +30,13 @@ enum {
_NUM_MQ_WRITE
};
+/* gsm_bts->model_priv, specific to Open Cellular 2G BTS */
+struct bts_oc2g_priv {
+ uint8_t led_ctrl_mode; /* 0: control by BTS, 1: not control by BTS */
+ struct llist_head ceased_alarm_list; /* ceased alarm list*/
+ unsigned int rtp_drift_thres_ms; /* RTP timestamp drift detection threshold */
+};
+
struct calib_send_state {
FILE *fp;
const char *path;
diff --git a/src/osmo-bts-oc2g/main.c b/src/osmo-bts-oc2g/main.c
index 5b66c6f3..abecba14 100644
--- a/src/osmo-bts-oc2g/main.c
+++ b/src/osmo-bts-oc2g/main.c
@@ -87,15 +87,17 @@ int bts_model_init(struct gsm_bts *bts)
static struct osmo_fd accept_fd, read_fd;
int rc;
+ struct bts_oc2g_priv *bts_oc2g = talloc(bts, struct bts_oc2g_priv);
+ bts->model_priv = bts_oc2g;
bts->variant = BTS_OSMO_OC2G;
bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3);
/* specific default values for OC2G platform */
/* TODO(oramadan) MERGE
- bts->oc2g.led_ctrl_mode = OC2G_BTS_LED_CTRL_MODE_DEFAULT;
+ bts_oc2g->led_ctrl_mode = OC2G_BTS_LED_CTRL_MODE_DEFAULT;
*/
/* RTP drift threshold default */
- /* bts->oc2g.rtp_drift_thres_ms = OC2G_BTS_RTP_DRIFT_THRES_DEFAULT; */
+ /* bts_oc2g->rtp_drift_thres_ms = OC2G_BTS_RTP_DRIFT_THRES_DEFAULT; */
rc = oml_router_init(bts, OML_ROUTER_PATH, &accept_fd, &read_fd);
if (rc < 0) {