blob: 6e5fe83252c30366fc272ff9a6ad7cb33ddc1dea [file] [log] [blame]
Neels Hofmeyrb8afb5f2016-06-02 01:18:02 +02001/* Dynamic PDCH initialisation implementation shared across NM and RSL */
2
3/* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
4 * All Rights Reserved
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#include <osmocom/core/logging.h>
22#include <openbsc/debug.h>
23#include <openbsc/gsm_data.h>
24#include <openbsc/abis_rsl.h>
25
26void dyn_pdch_init(struct gsm_bts_trx_ts *ts)
27{
28 int rc;
29
Neels Hofmeyrc1fbded2016-06-16 04:18:07 +020030 ts->flags &= ~(TS_F_PDCH_PENDING_MASK | TS_F_PDCH_ACTIVE);
31
Neels Hofmeyrb8afb5f2016-06-02 01:18:02 +020032 if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) {
33 LOGP(DRSL, LOGL_DEBUG, "trying to PDCH ACT on"
34 " BTS %u TRX %u TS %u\n",
35 ts->trx->bts->nr, ts->trx->nr, ts->nr);
36 rc = rsl_ipacc_pdch_activate(ts, 1);
37 if (rc != 0) {
38 LOGP(DRSL, LOGL_ERROR,
39 "Failed to activate PDCH on"
40 " BTS %u TRX %u TS %u: %d\n",
41 ts->trx->bts->nr, ts->trx->nr, ts->nr, rc);
42 }
43 }
44}