aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-virtual
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-virtual')
-rw-r--r--src/osmo-bts-virtual/main.c5
-rw-r--r--src/osmo-bts-virtual/scheduler_virtbts.c21
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;
}