diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-03-17 12:22:40 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-03-17 13:40:03 +0100 |
commit | d8cd756da48bcff9f9caf9e64fc0af047a165b60 (patch) | |
tree | 136d09901ae8420803500d92646944376ae21f59 /src/osmo-bts-virtual | |
parent | 7c4a22dbc48f51eb199766bf1b29e061bf765cbd (diff) |
Get rid of 'struct gsm_bts_role_bts'
gsm_bts_role_bts was introduced at a time when we still shared
gsm_data_shared.[ch] between BSC and BTS, and where we then subsequently
needed a BTS-private structure. Since that sharing was abandoned quite
some time ago, we can merge gsm_bts_role_bts into gsm_bts and do away
with the bts/btsb dualism in a lot of the code.
Change-Id: I4fdd601ea873d9697f89a748cc77bcf7c978fa3e
Diffstat (limited to 'src/osmo-bts-virtual')
-rw-r--r-- | src/osmo-bts-virtual/main.c | 5 | ||||
-rw-r--r-- | src/osmo-bts-virtual/scheduler_virtbts.c | 21 |
2 files changed, 10 insertions, 16 deletions
diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index 7815a343..62376a74 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -56,10 +56,7 @@ uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) int bts_model_init(struct gsm_bts *bts) { - struct gsm_bts_role_bts *btsb; - - btsb = bts_role_bts(bts); - btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); gsm_bts_set_feature(bts, BTS_FEAT_OML_ALERTS); gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_V1); diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index 5782c0a5..de995e6f 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -566,9 +566,8 @@ static int vbts_sched_fn(struct gsm_bts *bts, uint32_t fn) static void vbts_fn_timer_cb(void *data) { struct gsm_bts *bts = data; - struct gsm_bts_role_bts *btsb = bts_role_bts(bts); struct timeval tv_now; - struct timeval *tv_clock = &btsb->vbts.tv_clock; + struct timeval *tv_clock = &bts->vbts.tv_clock; int32_t elapsed_us; gettimeofday(&tv_now, NULL); @@ -592,30 +591,28 @@ static void vbts_fn_timer_cb(void *data) }; timeradd(tv_clock, &tv_frame, tv_clock); /* increment the frame number in the BTS model instance */ - btsb->vbts.last_fn = (btsb->vbts.last_fn + 1) % GSM_HYPERFRAME; - vbts_sched_fn(bts, btsb->vbts.last_fn); + bts->vbts.last_fn = (bts->vbts.last_fn + 1) % GSM_HYPERFRAME; + vbts_sched_fn(bts, bts->vbts.last_fn); elapsed_us -= FRAME_DURATION_uS; } /* re-schedule the timer */ /* timer is set to frame duration - elapsed time to guarantee that this cb method will be * periodically executed every 4.615ms */ - osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS - elapsed_us); + osmo_timer_schedule(&bts->vbts.fn_timer, 0, FRAME_DURATION_uS - elapsed_us); } int vbts_sched_start(struct gsm_bts *bts) { - struct gsm_bts_role_bts *btsb = bts_role_bts(bts); - LOGP(DL1P, LOGL_NOTICE, "starting VBTS scheduler\n"); - memset(&btsb->vbts.fn_timer, 0, sizeof(btsb->vbts.fn_timer)); - btsb->vbts.fn_timer.cb = vbts_fn_timer_cb; - btsb->vbts.fn_timer.data = bts; + memset(&bts->vbts.fn_timer, 0, sizeof(bts->vbts.fn_timer)); + bts->vbts.fn_timer.cb = vbts_fn_timer_cb; + bts->vbts.fn_timer.data = bts; - gettimeofday(&btsb->vbts.tv_clock, NULL); + gettimeofday(&bts->vbts.tv_clock, NULL); /* trigger the first timer after 4615us (a frame duration) */ - osmo_timer_schedule(&btsb->vbts.fn_timer, 0, FRAME_DURATION_uS); + osmo_timer_schedule(&bts->vbts.fn_timer, 0, FRAME_DURATION_uS); return 0; } |