aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/abis_rsl.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-08-07 03:41:37 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2021-08-16 02:13:17 +0200
commitc746509d3c244f2acc832f8a5fcc52a529f192d0 (patch)
tree5b2a81df22ee74001246a0086cf0e3c3aaea33e6 /src/osmo-bsc/abis_rsl.c
parenteec43fa5327a15969af158ef53711eabcc0e9695 (diff)
early IMM ASS 3/n: implement 'pre-ts-ack'
Add experimental 'pre-ts-ack' to the 'immediate-assignment' options: send the IMM ASS even before a dynamic timeslot is switched. This possibly saves an Abis roundtrip, but may be racy. When pre-ts-ack is chosen, already do the IMM ASS before the dyn TS pchan switch is ACKed. In Immediate Assignment, in case the dyn TS is not ready yet, get the pchan kind from lchan->type, which already reflects the target type, and not from ts->pchan_is, which still reflects the previous pchan type. Related test is in I2ae28cd92910d4bc341a88571599347a64a18fe5 Related: SYS#5559 Change-Id: I19e6a3d614aa5ae24d64eed96caf53e6f0e8bb74
Diffstat (limited to 'src/osmo-bsc/abis_rsl.c')
-rw-r--r--src/osmo-bsc/abis_rsl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index df319821d..26231ac9d 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -2072,6 +2072,7 @@ int rsl_tx_imm_assignment(struct gsm_lchan *lchan)
struct gsm_bts *bts = lchan->ts->trx->bts;
uint8_t buf[GSM_MACBLOCK_LEN];
struct gsm48_imm_ass *ia = (struct gsm48_imm_ass *) buf;
+ enum gsm_phys_chan_config pchan;
/* create IMMEDIATE ASSIGN 04.08 message */
memset(ia, 0, sizeof(*ia));
@@ -2079,7 +2080,15 @@ int rsl_tx_imm_assignment(struct gsm_lchan *lchan)
ia->proto_discr = GSM48_PDISC_RR;
ia->msg_type = GSM48_MT_RR_IMM_ASS;
ia->page_mode = GSM48_PM_SAME;
- rc = gsm48_lchan2chan_desc(&ia->chan_desc, lchan, lchan->tsc, true);
+
+ /* In case the dyn TS is not ready yet, ts->pchan_is still reflects the previous pchan type; so get the pchan
+ * kind from lchan->type, which already reflects the target type. This only happens for dynamic timeslots.
+ * gsm_pchan_by_lchan_type() isn't always exact, which is fine for dyn TS with their limited pchan kinds. */
+ if (lchan_state_is(lchan, LCHAN_ST_WAIT_TS_READY))
+ pchan = gsm_pchan_by_lchan_type(lchan->type);
+ else
+ pchan = lchan->ts->pchan_is;
+ rc = gsm48_lchan_and_pchan2chan_desc(&ia->chan_desc, lchan, pchan, lchan->tsc, true);
if (rc) {
LOG_LCHAN(lchan, LOGL_ERROR, "Error encoding Channel Number\n");
return rc;