aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-04-12 14:43:10 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2021-05-28 17:22:59 +0000
commit1b277ec2a22d039f1e32c7ceff7809b2a968e476 (patch)
tree419b561925f969dfe139cd3428aa3c62f4633553 /tests
parent69def1f97e427fa65d242f21110f01cb5d0a2818 (diff)
RSL link: explicitly select rsl_link based on lchan
Prepare for VAMOS, where there will be secondary "shadow" lchans serving secondary MS on the same timeslots. For those, RSL messages will need to reflect a different stream ID aka TEI, via an rsl_link_vamos. Make sure that every code path that sends an RSL message for a specific lchan selects the RSL link via the new function rsl_chan_link(). When VAMOS is implemented, this function can select the proper RSL stream. Rename gsm_bts_trx.rsl_link to rsl_link_primary. This makes sure I'm not missing any uses of the RSL link, and clarifies the code. Related: SYS#5315 OS#4940 Change-Id: Ifbf16bb296e91f151d19e15e39f5c953ad77ff17
Diffstat (limited to 'tests')
-rw-r--r--tests/gsm0408/gsm0408_test.c1
-rw-r--r--tests/handover/handover_test.c14
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index a1aa5f494..7c92c3613 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -992,3 +992,4 @@ void pcu_info_update(struct gsm_bts *bts) {};
int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type, const uint8_t *data, int len) { return 0; }
int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len)
{ return 0; }
+struct e1inp_sign_link *rsl_chan_link(const struct gsm_lchan *lchan) { return NULL; }
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index b2eb5ccf2..0859a0436 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -175,7 +175,7 @@ static void gen_meas_rep(struct gsm_lchan *lchan,
mr->bcch_f_nc6_hi = neighbors[5].bcch_f >> 2;
mr->bcch_f_nc6_lo = neighbors[5].bcch_f & 3;
- msg->dst = lchan->ts->trx->bts->c0->rsl_link;
+ msg->dst = rsl_chan_link(lchan);
msg->l2h = (unsigned char *)dh;
msg->l3h = (unsigned char *)gh;
@@ -231,7 +231,7 @@ static struct gsm_bts *_create_bts(int num_trx, const char * const *ts_args, int
rsl_link = talloc_zero(ctx, struct e1inp_sign_link);
rsl_link->trx = bts->c0;
- bts->c0->rsl_link = rsl_link;
+ bts->c0->rsl_link_primary = rsl_link;
for (trx_i = 0; trx_i < num_trx; trx_i++) {
while (!(trx = gsm_bts_trx_num(bts, trx_i)))
@@ -555,7 +555,7 @@ static void send_chan_act_ack(struct gsm_lchan *lchan, int act)
dh->ie_chan = RSL_IE_CHAN_NR;
dh->chan_nr = gsm_lchan2chan_nr(lchan);
- msg->dst = lchan->ts->trx->bts->c0->rsl_link;
+ msg->dst = rsl_chan_link(lchan);
msg->l2h = (unsigned char *)dh;
abis_rsl_rcvmsg(msg);
@@ -592,7 +592,7 @@ static void send_assignment_complete(struct gsm_lchan *lchan)
gh->proto_discr = GSM48_PDISC_RR;
gh->msg_type = GSM48_MT_RR_ASS_COMPL;
- msg->dst = lchan->ts->trx->rsl_link;
+ msg->dst = rsl_chan_link(lchan);
msg->l2h = (unsigned char *)rh;
msg->l3h = (unsigned char *)gh;
@@ -616,7 +616,7 @@ static void send_est_ind(struct gsm_lchan *lchan)
rh->ie_link_id = RSL_IE_LINK_IDENT;
rh->link_id = 0x00;
- msg->dst = lchan->ts->trx->bts->c0->rsl_link;
+ msg->dst = rsl_chan_link(lchan);
msg->l2h = (unsigned char *)rh;
abis_rsl_rcvmsg(msg);
@@ -638,7 +638,7 @@ static void send_ho_detect(struct gsm_lchan *lchan)
rh->ie_link_id = RSL_IE_LINK_IDENT;
rh->link_id = 0x00;
- msg->dst = lchan->ts->trx->bts->c0->rsl_link;
+ msg->dst = rsl_chan_link(lchan);
msg->l2h = (unsigned char *)rh;
abis_rsl_rcvmsg(msg);
@@ -682,7 +682,7 @@ static void send_ho_complete(struct gsm_lchan *lchan, bool success)
gh->msg_type =
success ? GSM48_MT_RR_HANDO_COMPL : GSM48_MT_RR_HANDO_FAIL;
- msg->dst = lchan->ts->trx->bts->c0->rsl_link;
+ msg->dst = rsl_chan_link(lchan);
msg->l2h = (unsigned char *)rh;
msg->l3h = (unsigned char *)gh;