[PATCH] openbsc[master]: Attempt at extending dynamic PDCH support to Ericcson RBS2000

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/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Oct 26 12:10:06 UTC 2016


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

Attempt at extending dynamic PDCH support to Ericcson RBS2000

In Ericsson RBS2000, all PDCH's are dynamic, i.e. there is only one
shared PCHAN type for TCH/F, TCH/H and PDCH.  The PDCH needs to be
activated with a RSL CHAN ACT with some proprietary coding of the
Channel Number IE.

Change-Id: I48089fcf8328d52f57e97b003790ffdeed766367
---
M openbsc/include/openbsc/abis_rsl.h
M openbsc/src/libbsc/abis_rsl.c
M openbsc/src/libbsc/bsc_dyn_ts.c
M openbsc/src/libbsc/bsc_vty.c
4 files changed, 61 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/55/1155/1

diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index 758c555..b2c43f0 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -64,7 +64,7 @@
 int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip,
 		   uint16_t port, uint8_t rtp_payload2);
 int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan);
-int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
+int rsl_dyn_pdch_activate(struct gsm_bts_trx_ts *ts, int is_activation);
 
 int abis_rsl_rcvmsg(struct msgb *msg);
 
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 316fc3f..95a18cf 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -53,6 +53,7 @@
 	SACCH_DEACTIVATE,
 };
 
+static int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
 static int rsl_send_imm_assignment(struct gsm_lchan *lchan);
 static void error_timeout_cb(void *data);
 static int dyn_ts_switchover_continue(struct gsm_bts_trx_ts *ts);
@@ -472,6 +473,37 @@
 	return abis_rsl_sendmsg(msg);
 }
 
+static int rsl_rbs2k_pdch_activate(struct gsm_bts_trx_ts *ts, int is_activation)
+{
+	struct gsm_bts_trx *trx = ts->trx;
+	struct gsm_lchan *lchan = &ts->lchan[0];
+	struct abis_rsl_dchan_hdr *dh;
+	struct msgb *msg;
+	uint8_t chan_nr;
+
+	OSMO_ASSERT(trx->bts->type == GSM_BTS_TYPE_RBS2000);
+
+	/* Ericsson proprietary encoding of PDCH channel number */
+	chan_nr = (0x18 << 3) | (ts->nr & 0x7);
+
+	msg = rsl_msgb_alloc();
+	dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
+
+	if (is_activation) {
+		rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ);
+		init_dchan_hdr(dh, RSL_MT_CHAN_ACTIV);
+		dh->chan_nr = chan_nr;
+	} else {
+		rsl_lchan_set_state(lchan, LCHAN_S_REL_REQ);
+		init_dchan_hdr(dh, RSL_MT_RF_CHAN_REL);
+		dh->chan_nr = chan_nr;
+	}
+
+	msg->dst = trx->rsl_link;
+
+	return abis_rsl_sendmsg(msg);
+}
+
 /* Chapter 8.4.1 */
 int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type,
 			    uint8_t ho_ref)
@@ -491,7 +523,7 @@
 		/* store activation type and handover reference */
 		lchan->dyn.act_type = act_type;
 		lchan->dyn.ho_ref = ho_ref;
-		return rsl_ipacc_pdch_activate(lchan->ts, 0);
+		return rsl_dyn_pdch_activate(lchan->ts, 0);
 	}
 
 	/*
@@ -722,6 +754,7 @@
 	return abis_rsl_sendmsg(msg);
 }
 
+
 static bool dyn_ts_should_switch_to_pdch(struct gsm_bts_trx_ts *ts)
 {
 	int ss;
@@ -756,6 +789,19 @@
 	return true;
 }
 
+int rsl_dyn_pdch_activate(struct gsm_bts_trx_ts *ts, int is_activation)
+{
+	switch (ts->trx->bts->type) {
+	case GSM_BTS_TYPE_NANOBTS:
+	case GSM_BTS_TYPE_OSMO_SYSMO:
+		return rsl_ipacc_pdch_activate(ts, is_activation);
+	case GSM_BTS_TYPE_RBS2000:
+		return rsl_rbs2k_pdch_activate(ts, is_activation);
+	default:
+		return -1;
+	}
+}
+
 static void error_timeout_cb(void *data)
 {
 	struct gsm_lchan *lchan = data;
@@ -772,7 +818,7 @@
 	/* Put PDCH channel back into PDCH mode, if GPRS is enabled */
 	if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH
 	    && lchan->ts->trx->bts->gprs.mode != BTS_GPRS_NONE)
-		rsl_ipacc_pdch_activate(lchan->ts, 1);
+		rsl_dyn_pdch_activate(lchan->ts, 1);
 
 	if (dyn_ts_should_switch_to_pdch(lchan->ts))
 		dyn_ts_switchover_start(lchan->ts, GSM_PCHAN_PDCH);
@@ -941,7 +987,8 @@
 		return 0;
 	if (ts->pchan == GSM_PCHAN_TCH_F_PDCH
 	    && lchan->state == LCHAN_S_NONE)
-		return rsl_ipacc_pdch_activate(ts, 1);
+		return rsl_dyn_pdch_activate(lchan->ts, 1);
+
 	return 0;
 }
 
@@ -2210,7 +2257,7 @@
 	return rc;
 }
 
-int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act)
+static int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act)
 {
 	struct msgb *msg = rsl_msgb_alloc();
 	struct abis_rsl_dchan_hdr *dh;
diff --git a/openbsc/src/libbsc/bsc_dyn_ts.c b/openbsc/src/libbsc/bsc_dyn_ts.c
index e5422fc..4bff883 100644
--- a/openbsc/src/libbsc/bsc_dyn_ts.c
+++ b/openbsc/src/libbsc/bsc_dyn_ts.c
@@ -37,7 +37,7 @@
 	LOGP(DRSL, LOGL_DEBUG, "%s: trying to PDCH ACT\n",
 	     gsm_ts_and_pchan_name(ts));
 
-	rc = rsl_ipacc_pdch_activate(ts, 1);
+	rc = rsl_dyn_pdch_activate(ts, 1);
 	if (rc != 0)
 		LOGP(DRSL, LOGL_ERROR, "%s %s: PDCH ACT failed\n",
 		     gsm_ts_name(ts), gsm_pchan_name(ts->pchan));
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index cb0b1d8..a58c064 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -3996,8 +3996,13 @@
 		return CMD_WARNING;
 	}
 
-	if (!is_ipaccess_bts(bts)) {
-		vty_out(vty, "%% This command only works for ipaccess BTS%s",
+	switch (bts->type) {
+	case GSM_BTS_TYPE_RBS2000:
+	case GSM_BTS_TYPE_NANOBTS:
+	case GSM_BTS_TYPE_OSMO_SYSMO:
+		break;
+	default:
+		vty_out(vty, "%% This command only works for IPA and RBS2000 BTS%s",
 			VTY_NEWLINE);
 		return CMD_WARNING;
 	}
@@ -4020,7 +4025,7 @@
 	else
 		activate = 0;
 
-	rsl_ipacc_pdch_activate(ts, activate);
+	rsl_dyn_pdch_activate(ts, activate);
 
 	return CMD_SUCCESS;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I48089fcf8328d52f57e97b003790ffdeed766367
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list