blob: d6d367c844cf9c6b2e474d50ac5e199d8f5d44e2 [file] [log] [blame]
Holger Freytherd0e38c32009-01-04 03:48:30 +00001/* Management functions to allocate/release struct gsm_lchan */
2/* (C) 2008 by Harald Welte <laforge@gnumonks.org>
3 * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
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 General Public License as published by
8 * the Free Software Foundation; either version 2 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 General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 */
Harald Welte8470bf22008-12-25 23:28:35 +000021#ifndef _CHAN_ALLOC_H
22#define _CHAN_ALLOC_H
23
Holger Freytherd0e38c32009-01-04 03:48:30 +000024#include "gsm_subscriber.h"
25
Harald Welte8470bf22008-12-25 23:28:35 +000026/* Special allocator for C0 of BTS */
27struct gsm_bts_trx_ts *ts_c0_alloc(struct gsm_bts *bts,
28 enum gsm_phys_chan_config pchan);
29
30/* Regular physical channel allocator */
31struct gsm_bts_trx_ts *ts_alloc(struct gsm_bts *bts,
32 enum gsm_phys_chan_config pchan);
33
34/* Regular physical channel (TS) */
35void ts_free(struct gsm_bts_trx_ts *ts);
36
Holger Freytherd0e38c32009-01-04 03:48:30 +000037/* Find an allocated channel */
38struct gsm_lchan *lchan_find(struct gsm_bts *bts, struct gsm_subscriber *subscr);
Harald Welte8470bf22008-12-25 23:28:35 +000039
40/* Allocate a logical channel (SDCCH, TCH, ...) */
41struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type);
42
43/* Free a logical channel (SDCCH, TCH, ...) */
44void lchan_free(struct gsm_lchan *lchan);
45
Holger Freyther67b4b9a2009-01-01 03:46:11 +000046/* Consider releasing the channel */
47int lchan_auto_release(struct gsm_lchan *lchan);
48
Harald Welte8470bf22008-12-25 23:28:35 +000049#endif /* _CHAN_ALLOC_H */