This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
neels gerrit-no-reply at lists.osmocom.orgneels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24378 )
Change subject: RSL: look up lchan by sign_link, not trx, for VAMOS
......................................................................
RSL: look up lchan by sign_link, not trx, for VAMOS
So far we pass the gsm_bts_trx to the lchan lookup functions to
determine the lchan that a specific RSL message is received for. But for
VAMOS secondary lchans, we introduced a second sign_link for each TRX,
so passing the TRX loses information on which TEI the RSL message was
received from. Pass the sign_link instead of the trx.
If the sign_link is the secondary VAMOS link, return the VAMOS shadow
lchan instead of the primary one for that lchan number.
Related: SYS#5315 OS#4940
Change-Id: I872a3ed9ce0cdbd9fbe41a750081f54008eece8d
---
M include/osmocom/bsc/bts_trx.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bts_trx.c
M tests/handover/handover_test.c
4 files changed, 20 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/78/24378/1
diff --git a/include/osmocom/bsc/bts_trx.h b/include/osmocom/bsc/bts_trx.h
index 94f4021..09afd99 100644
--- a/include/osmocom/bsc/bts_trx.h
+++ b/include/osmocom/bsc/bts_trx.h
@@ -90,7 +90,7 @@
struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
char *gsm_trx_name(const struct gsm_bts_trx *trx);
-struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
+struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, bool vamos,
int *rc);
void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason);
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index e1d8a41..c0d9e4d 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -125,11 +125,15 @@
}
/* call rsl_lchan_lookup and set the log context */
-static struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
+static struct gsm_lchan *lchan_lookup(struct e1inp_sign_link *sign_link, uint8_t chan_nr,
const char *log_name)
{
int rc;
- struct gsm_lchan *lchan = rsl_lchan_lookup(trx, chan_nr, &rc);
+ /* If no VAMOS link was set up, rsl_tei_vamos may reflect the same as rsl_tei_primary. Make sure that the
+ * primary tei matches stronger. */
+ bool vamos = (sign_link->tei != sign_link->trx->rsl_tei_primary)
+ && (sign_link->tei == sign_link->trx->rsl_tei_vamos);
+ struct gsm_lchan *lchan = rsl_lchan_lookup(sign_link->trx, chan_nr, vamos, &rc);
if (!lchan) {
LOGP(DRSL, LOGL_ERROR, "%sunknown chan_nr=0x%02x\n",
@@ -1257,7 +1261,7 @@
return -EINVAL;
}
- msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr,
+ msg->lchan = lchan_lookup(sign_link, rslh->chan_nr,
"Abis RSL rx DCHAN: ");
if (!msg->lchan) {
LOGP(DRSL, LOGL_ERROR,
@@ -1977,7 +1981,7 @@
struct rate_ctr_group *bts_ctrs = sign_link->trx->bts->bts_ctrs;
int rc = 0;
- msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr,
+ msg->lchan = lchan_lookup(sign_link, rslh->chan_nr,
"Abis RSL rx CCHAN: ");
switch (rslh->c.msg_type) {
@@ -2048,7 +2052,7 @@
int rc = 0;
uint8_t sapi = rllh->link_id & 0x7;
- msg->lchan = lchan_lookup(sign_link->trx, rllh->chan_nr, "Abis RSL rx RLL: ");
+ msg->lchan = lchan_lookup(sign_link, rllh->chan_nr, "Abis RSL rx RLL: ");
switch (rllh->c.msg_type) {
case RSL_MT_DATA_IND:
@@ -2454,7 +2458,7 @@
struct abis_rsl_rll_hdr *rllh = msgb_l2(msg);
int rc = 0;
- msg->lchan = lchan_lookup(sign_link->trx, rllh->chan_nr,
+ msg->lchan = lchan_lookup(sign_link, rllh->chan_nr,
"Abis RSL rx IPACC: ");
if (!msg->lchan) {
diff --git a/src/osmo-bsc/bts_trx.c b/src/osmo-bsc/bts_trx.c
index 64c7985..81af898 100644
--- a/src/osmo-bsc/bts_trx.c
+++ b/src/osmo-bsc/bts_trx.c
@@ -144,7 +144,7 @@
}
/* determine logical channel based on TRX and channel number IE */
-struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
+struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, bool vamos,
int *rc)
{
uint8_t ts_nr = chan_nr & 0x07;
@@ -179,6 +179,12 @@
} else
return NULL;
+ if (vamos) {
+ if (!osmo_bts_has_feature(&trx->bts->features, BTS_FEAT_VAMOS))
+ return NULL;
+ lch_idx += ts->max_primary_lchans;
+ }
+
if (rc && ok)
*rc = 0;
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index e00294c..9913956 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -698,7 +698,8 @@
struct abis_rsl_dchan_hdr *dh = (struct abis_rsl_dchan_hdr *) msg->data;
struct e1inp_sign_link *sign_link = msg->dst;
int rc;
- struct gsm_lchan *lchan = rsl_lchan_lookup(sign_link->trx, dh->chan_nr, &rc);
+ struct gsm_lchan *lchan = rsl_lchan_lookup(sign_link->trx, dh->chan_nr,
+ false && (sign_link->tei == sign_link->trx->rsl_tei_vamos), &rc);
struct gsm_lchan *other_lchan;
struct gsm48_hdr *gh;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24378
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I872a3ed9ce0cdbd9fbe41a750081f54008eece8d
Gerrit-Change-Number: 24378
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210523/15536d28/attachment.htm>