aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2023-06-23 12:42:16 +0200
committerlaforge <laforge@osmocom.org>2023-07-21 10:52:07 +0000
commitcdbd83affde08798d0389a2a25a46de468cdfe49 (patch)
treed7895b40e06be218fbb1bdad35dec7d00b82fe38
parent2ae45aba3f9d9000522b4ba7f0f72b92bce6278f (diff)
ASCI: Add function to reactivate channel
Reactivation will modify parameters on an already activated channel. On a VGCS/VBS channel it can be used to prepare channel for assignment of the mobile station to it. During assignment the channel is reactivated. The timing advance of the mobile station is given. The uplink is activated and is waiting for the mobile station to establish, to complete the assignment. For reference see patent EP 1 858 275 A1. Change-Id: I77f413cf70c2f5f8e8f525686eee40548521c71b Related: OS#4851
-rw-r--r--src/common/rsl.c49
1 files changed, 36 insertions, 13 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 9bdc7303..e0720223 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1795,14 +1795,36 @@ static int rsl_rx_chan_activ(struct msgb *msg)
struct tlv_parsed tp;
const struct tlv_p_entry *ie;
uint8_t type, cause;
+ bool reactivation = false;
int rc;
- if (lchan->state != LCHAN_S_NONE) {
+ if (rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)) < 0) {
+ LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "%s(): rsl_tlv_parse() failed\n", __func__);
+ return rsl_tx_chan_act_nack(lchan, RSL_ERR_PROTO);
+ }
+
+ /* 9.3.3 Activation Type */
+ if (!TLVP_PRESENT(&tp, RSL_IE_ACT_TYPE)) {
+ LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, "missing Activation Type\n");
+ return rsl_tx_chan_act_nack(lchan, RSL_ERR_MAND_IE_ERROR);
+ }
+ type = *TLVP_VAL(&tp, RSL_IE_ACT_TYPE);
+ if ((type & RSL_ACT_TYPE_REACT)) {
+ type -= RSL_ACT_TYPE_REACT;
+ reactivation = true;
+ }
+
+ if (!reactivation && lchan->state != LCHAN_S_NONE) {
LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "error: lchan is not available, but in state: %s.\n",
gsm_lchans_name(lchan->state));
return rsl_tx_chan_act_nack(lchan, RSL_ERR_EQUIPMENT_FAIL);
}
+ if (reactivation && lchan->state == LCHAN_S_NONE) {
+ LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "error: reactivation on inactive lchan.\n");
+ return rsl_tx_chan_act_nack(lchan, RSL_ERR_EQUIPMENT_FAIL);
+ }
+
/* We need to pick the real TS here to check NM state: */
primary_ts = ts->vamos.is_shadow ? ts->vamos.peer : ts;
if (primary_ts->mo.nm_state.operational != NM_OPSTATE_ENABLED ||
@@ -1845,18 +1867,6 @@ static int rsl_rx_chan_activ(struct msgb *msg)
.current = 0,
};
- if (rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)) < 0) {
- LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "%s(): rsl_tlv_parse() failed\n", __func__);
- return rsl_tx_chan_act_nack(lchan, RSL_ERR_PROTO);
- }
-
- /* 9.3.3 Activation Type */
- if (!TLVP_PRESENT(&tp, RSL_IE_ACT_TYPE)) {
- LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, "missing Activation Type\n");
- return rsl_tx_chan_act_nack(lchan, RSL_ERR_MAND_IE_ERROR);
- }
- type = *TLVP_VAL(&tp, RSL_IE_ACT_TYPE);
-
/* 9.3.6 Channel Mode */
if (type != RSL_ACT_OSMO_PDCH) {
if (rsl_handle_chan_mod_ie(lchan, &tp, &cause) != 0)
@@ -2103,6 +2113,19 @@ static int rsl_rx_chan_activ(struct msgb *msg)
else
lchan->top_acch_active = false;
+ /* set ASCI channel into right state */
+ if (reactivation && rsl_chan_rt_is_asci(lchan->rsl_chan_rt))
+ vgcs_lchan_react(lchan);
+
+ /* on reactivation, the channel is already activated */
+ if (reactivation) {
+ rc = rsl_tx_chan_act_ack(lchan);
+ if (rc < 0)
+ LOGP(DRSL, LOGL_ERROR, "%s Cannot send act ack: %d\n",
+ gsm_ts_and_pchan_name(ts), rc);
+ return 0;
+ }
+
/* actually activate the channel in the BTS */
rc = l1sap_chan_act(lchan->ts->trx, dch->chan_nr);
if (rc < 0)