[MERGED] openbsc[master]: dyn PDCH: TS flags: rename one, add three, as enum

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
Fri Jun 17 01:17:07 UTC 2016


Neels Hofmeyr has submitted this change and it was merged.

Change subject: dyn PDCH: TS flags: rename one, add three, as enum
......................................................................


dyn PDCH: TS flags: rename one, add three, as enum

Rename TS_F_PDCH_MODE to TS_F_PDCH_ACTIVE, to more accurately reflect the truth
value's meaning.

Add TS_F_PDCH_ACT_PENDING and TS_F_PDCH_DEACT_PENDING for sysmoBTS (and
possibly other BTS implementations) to remember what to do when the PCU replies
with a channel de/activation. Also add TS_F_PDCH_PENDING_MASK to test for both.

Change from #define to an enum.

Note: These flags are also used in the upcoming osmo-bts-sysmo dyn PDCH
commits, so osmo-bts submission depends on this commit.

Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3
---
M openbsc/include/openbsc/gsm_data_shared.h
M openbsc/src/libbsc/abis_rsl.c
M openbsc/src/libbsc/bsc_vty.c
3 files changed, 12 insertions(+), 5 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index 0b6bf60..e46647c 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -332,7 +332,14 @@
 #endif
 };
 
-#define TS_F_PDCH_MODE	0x1000
+enum {
+	TS_F_PDCH_ACTIVE =		0x1000,
+	TS_F_PDCH_ACT_PENDING =		0x2000,
+	TS_F_PDCH_DEACT_PENDING =	0x4000,
+	TS_F_PDCH_PENDING_MASK =	0x6000 /*<
+			TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */
+} gsm_bts_trx_ts_flags;
+
 /* One Timeslot in a TRX */
 struct gsm_bts_trx_ts {
 	struct gsm_bts_trx *trx;
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 59176df..338c00a 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -472,7 +472,7 @@
 
 	/* if channel is in PDCH mode, deactivate PDCH first */
 	if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH
-	    && (lchan->ts->flags & TS_F_PDCH_MODE)) {
+	    && (lchan->ts->flags & TS_F_PDCH_ACTIVE)) {
 		/* store activation type and handover reference */
 		lchan->dyn_pdch.act_type = act_type;
 		lchan->dyn_pdch.ho_ref = ho_ref;
@@ -1203,7 +1203,7 @@
 
 static int rsl_rx_pdch_act_ack(struct msgb *msg)
 {
-	msg->lchan->ts->flags |= TS_F_PDCH_MODE;
+	msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE;
 
 	/* We have activated PDCH, so now the channel is available again. */
 	do_lchan_free(msg->lchan);
@@ -1213,7 +1213,7 @@
 
 static int rsl_rx_pdch_deact_ack(struct msgb *msg)
 {
-	msg->lchan->ts->flags &= ~TS_F_PDCH_MODE;
+	msg->lchan->ts->flags &= ~TS_F_PDCH_ACTIVE;
 
 	rsl_chan_activate_lchan(msg->lchan, msg->lchan->dyn_pdch.act_type,
 				msg->lchan->dyn_pdch.ho_ref);
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index b0f2f62..578b005 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -919,7 +919,7 @@
 		gsm_pchan_name(ts->pchan), gsm_ts_tsc(ts));
 	if (ts->pchan == GSM_PCHAN_TCH_F_PDCH)
 		vty_out(vty, " (%s mode)",
-			ts->flags & TS_F_PDCH_MODE ? "PDCH" : "TCH/F");
+			ts->flags & TS_F_PDCH_ACTIVE ? "PDCH" : "TCH/F");
 	vty_out(vty, "%s", VTY_NEWLINE);
 	vty_out(vty, "  NM State: ");
 	net_dump_nmstate(vty, &ts->mo.nm_state);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list