jolly has uploaded this change for review.

View Change

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
---
M src/common/rsl.c
1 file changed, 56 insertions(+), 13 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/33447/1
diff --git a/src/common/rsl.c b/src/common/rsl.c
index b421024..b63cb31 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1747,14 +1747,36 @@
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 ||
@@ -1797,18 +1819,6 @@
.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)
@@ -2055,6 +2065,19 @@
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)

To view, visit change 33447. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I77f413cf70c2f5f8e8f525686eee40548521c71b
Gerrit-Change-Number: 33447
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas@eversberg.eu>
Gerrit-MessageType: newchange