aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-06-02 01:18:02 +0200
committerHarald Welte <laforge@gnumonks.org>2016-06-14 10:18:19 +0000
commitb8afb5fda251be739fdd862054d28b0eedfd85c9 (patch)
tree62ccb6b0f56d95a083cea51ca3978420b6b4d0d1
parent9df268e217274a0d1ff5cdc169503e4b2d4207f7 (diff)
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
-rw-r--r--openbsc/include/openbsc/abis_rsl.h2
-rw-r--r--openbsc/src/libbsc/Makefile.am3
-rw-r--r--openbsc/src/libbsc/bsc_dyn_pdch.c42
-rw-r--r--openbsc/src/libbsc/bsc_init.c4
-rw-r--r--openbsc/src/libbsc/bts_ipaccess_nanobts.c3
5 files changed, 50 insertions, 4 deletions
diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index 100a6d11f..6ff838279 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -106,5 +106,7 @@ int rsl_start_t3109(struct gsm_lchan *lchan);
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 8fa5c7c1a..48880d965 100644
--- a/openbsc/src/libbsc/Makefile.am
+++ b/openbsc/src/libbsc/Makefile.am
@@ -23,5 +23,6 @@ libbsc_a_SOURCES = abis_nm.c abis_nm_vty.c \
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 000000000..717880b79
--- /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@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 04452f745..5c2786278 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -329,10 +329,8 @@ static int inp_sig_cb(unsigned int subsys, unsigned int signal,
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 dfb5a45bc..89d525636 100644
--- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c
+++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
@@ -369,6 +369,9 @@ static int nm_statechg_event(int evt, struct nm_statechg_signal_data *nsd)
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;