blob: e0d1a63493a41900b0339d7b71695de6f64a96ae [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 Hofmeyr9331df12016-07-06 14:38:20 +020030 /* Clear all dyn PDCH flags */
Neels Hofmeyrc1fbded2016-06-16 04:18:07 +020031 ts->flags &= ~(TS_F_PDCH_PENDING_MASK | TS_F_PDCH_ACTIVE);
32
Neels Hofmeyr9331df12016-07-06 14:38:20 +020033 /* Nothing to do if not a dynamic channel. */
34 if (ts->pchan != GSM_PCHAN_TCH_F_PDCH)
35 return;
36
37 LOGP(DRSL, LOGL_DEBUG, "%s %s: trying to PDCH ACT\n",
38 gsm_ts_name(ts), gsm_pchan_name(ts->pchan));
39
40 rc = rsl_ipacc_pdch_activate(ts, 1);
41 if (rc != 0)
42 LOGP(DRSL, LOGL_ERROR, "%s %s: PDCH ACT failed\n",
43 gsm_ts_name(ts), gsm_pchan_name(ts->pchan));
Neels Hofmeyrb8afb5f2016-06-02 01:18:02 +020044}