[MERGED] openbsc[master]: dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Jun 14 10:18:19 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable
......................................................................


dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable

Add dyn_pdch_init() in new file bsc_dyn_pdch.c (new file to avoid linking
issues; bsc_init.c would create undefined references, and putting in a new file
is the easiest solution).

Call dyn_pdch_init() from nm_statechg_event() whenever a TS is enabled.

Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will
now be set after dyn_pdch_init() sent out the PDCH ACT and when subsequently
the PDCH ACT ACK messages are received in rsl_rx_pdch_act_ack().

Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575
---
M openbsc/include/openbsc/abis_rsl.h
M openbsc/src/libbsc/Makefile.am
A openbsc/src/libbsc/bsc_dyn_pdch.c
M openbsc/src/libbsc/bsc_init.c
M openbsc/src/libbsc/bts_ipaccess_nanobts.c
5 files changed, 50 insertions(+), 4 deletions(-)

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



diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index 100a6d1..6ff8382 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -106,5 +106,7 @@
 
 int rsl_direct_rf_release(struct gsm_lchan *lchan);
 
+void dyn_pdch_init(struct gsm_bts_trx_ts *ts);
+
 #endif /* RSL_MT_H */
 
diff --git a/openbsc/src/libbsc/Makefile.am b/openbsc/src/libbsc/Makefile.am
index 8fa5c7c..48880d9 100644
--- a/openbsc/src/libbsc/Makefile.am
+++ b/openbsc/src/libbsc/Makefile.am
@@ -23,5 +23,6 @@
 			bsc_init.c bts_init.c bsc_rf_ctrl.c \
 			arfcn_range_encode.c bsc_ctrl_commands.c \
 			bsc_ctrl_lookup.c \
-			net_init.c
+			net_init.c \
+			bsc_dyn_pdch.c
 
diff --git a/openbsc/src/libbsc/bsc_dyn_pdch.c b/openbsc/src/libbsc/bsc_dyn_pdch.c
new file mode 100644
index 0000000..717880b
--- /dev/null
+++ b/openbsc/src/libbsc/bsc_dyn_pdch.c
@@ -0,0 +1,42 @@
+/* Dynamic PDCH initialisation implementation shared across NM and RSL */
+
+/* (C) 2016 by sysmocom s.f.m.c. GmbH <info at sysmocom.de>
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <osmocom/core/logging.h>
+#include <openbsc/debug.h>
+#include <openbsc/gsm_data.h>
+#include <openbsc/abis_rsl.h>
+
+void dyn_pdch_init(struct gsm_bts_trx_ts *ts)
+{
+	int rc;
+
+	if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) {
+		LOGP(DRSL, LOGL_DEBUG, "trying to PDCH ACT on"
+		     " BTS %u TRX %u TS %u\n",
+		     ts->trx->bts->nr, ts->trx->nr, ts->nr);
+		rc = rsl_ipacc_pdch_activate(ts, 1);
+		if (rc != 0) {
+			LOGP(DRSL, LOGL_ERROR,
+			     "Failed to activate PDCH on"
+			     " BTS %u TRX %u TS %u: %d\n",
+			     ts->trx->bts->nr, ts->trx->nr, ts->nr, rc);
+		}
+	}
+}
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 04452f7..5c27862 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -329,10 +329,8 @@
 			llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) {
 				int i;
 
-				for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) {
+				for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++)
 					generate_ma_for_ts(&cur_trx->ts[i]);
-					cur_trx->ts[i].flags |= TS_F_PDCH_MODE;
-				}
 			}
 		}
 		if (isd->link_type == E1INP_SIGN_RSL)
diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
index dfb5a45..89d5256 100644
--- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c
+++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
@@ -369,6 +369,9 @@
 			abis_nm_opstart(trx->bts, obj_class,
 					trx->bts->bts_nr, trx->nr, ts->nr);
 		}
+		if (new_state->operational == NM_OPSTATE_ENABLED
+		    && new_state->availability == NM_AVSTATE_OK)
+			dyn_pdch_init(ts);
 		break;
 	case NM_OC_RADIO_CARRIER:
 		trx = obj;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575
Gerrit-PatchSet: 3
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