[PATCH] openbsc[master]: dyn PDCH: track pending PDCH de-/activation

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 Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Jun 16 02:30:00 UTC 2016


Review at  https://gerrit.osmocom.org/282

dyn PDCH: track pending PDCH de-/activation

Set and clear pending flags on the TS according to PDCH de-/activation.

This will allow changing the time we set the channel state to after PDCH
DEACT and before PDCH ACT, in a subsequent commit.

Also add a sanity check on whether we're sending conflicting or superfluous
PDCH de-/activations on the same TS.

Change-Id: Ieae73271df749ded3d90585116aae01f3ad4ee74
---
M openbsc/src/libbsc/abis_rsl.c
1 file changed, 18 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/82/282/1

diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 338c00a..349b3de 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -1204,6 +1204,7 @@
 static int rsl_rx_pdch_act_ack(struct msgb *msg)
 {
 	msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE;
+	msg->lchan->ts->flags &= ~TS_F_PDCH_ACT_PENDING;
 
 	/* We have activated PDCH, so now the channel is available again. */
 	do_lchan_free(msg->lchan);
@@ -1214,6 +1215,7 @@
 static int rsl_rx_pdch_deact_ack(struct msgb *msg)
 {
 	msg->lchan->ts->flags &= ~TS_F_PDCH_ACTIVE;
+	msg->lchan->ts->flags &= ~TS_F_PDCH_DEACT_PENDING;
 
 	rsl_chan_activate_lchan(msg->lchan, msg->lchan->dyn_pdch.act_type,
 				msg->lchan->dyn_pdch.ho_ref);
@@ -1975,10 +1977,24 @@
 	struct abis_rsl_dchan_hdr *dh;
 	uint8_t msg_type;
 
-	if (act)
+	if (ts->flags & TS_F_PDCH_PENDING_MASK) {
+		LOGP(DRSL, LOGL_ERROR,
+		     "%s PDCH %s requested, but a PDCH%s%s is still pending\n",
+		     gsm_ts_name(ts),
+		     act ? "ACT" : "DEACT",
+		     ts->flags & TS_F_PDCH_ACT_PENDING? " ACT" : "",
+		     ts->flags & TS_F_PDCH_DEACT_PENDING? " DEACT" : "");
+		return -EINVAL;
+	}
+
+	if (act){
 		msg_type = RSL_MT_IPAC_PDCH_ACT;
-	else
+		ts->flags |= TS_F_PDCH_ACT_PENDING;
+	} else {
 		msg_type = RSL_MT_IPAC_PDCH_DEACT;
+		ts->flags |= TS_F_PDCH_DEACT_PENDING;
+	}
+	/* TODO add timeout to cancel PDCH DE/ACT */
 
 	dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
 	init_dchan_hdr(dh, msg_type);

-- 
To view, visit https://gerrit.osmocom.org/282
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieae73271df749ded3d90585116aae01f3ad4ee74
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list