blob: 400e09f67bee65c31b44597dbeaae42196f63790 [file] [log] [blame]
Harald Welte52b1f982008-12-23 20:25:15 +00001/* GSM Radio Signalling Link messages on the A-bis interface
2 * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */
3
4/* (C) 2008 by Harald Welte <laforge@gnumonks.org>
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
Harald Welte9af6ddf2011-01-01 15:25:50 +01008 * it under the terms of the GNU Affero General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
Harald Welte52b1f982008-12-23 20:25:15 +000010 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Harald Welte9af6ddf2011-01-01 15:25:50 +010015 * GNU Affero General Public License for more details.
Harald Welte52b1f982008-12-23 20:25:15 +000016 *
Harald Welte9af6ddf2011-01-01 15:25:50 +010017 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Harald Welte52b1f982008-12-23 20:25:15 +000019 *
20 */
21
22#ifndef _RSL_H
23#define _RSL_H
24
Harald Weltebaaf3e22016-11-17 20:54:04 +010025#include <stdbool.h>
Pablo Neira Ayuso136f4532011-03-22 16:47:59 +010026#include <osmocom/gsm/protocol/gsm_08_58.h>
Neels Hofmeyrd3b7fa82016-07-23 20:08:41 +020027#include <osmocom/gsm/gsm_utils.h>
Max8b1a2f82017-06-15 14:59:20 +020028#include <osmocom/gsm/sysinfo.h>
Pablo Neira Ayuso136f4532011-03-22 16:47:59 +010029#include <osmocom/core/msgb.h>
Harald Welte52b1f982008-12-23 20:25:15 +000030
Sylvain Munaut3f16da22010-12-01 22:25:40 +010031struct gsm_bts;
32struct gsm_lchan;
33struct gsm_subscriber;
Holger Hans Peter Freyther54146272011-01-06 13:47:04 +010034struct gsm_bts_trx_ts;
Sylvain Munaut3f16da22010-12-01 22:25:40 +010035
Max5fa7e362016-04-15 16:04:45 +020036#define GSM48_LEN2PLEN(a) (((a) << 2) | 1)
Sylvain Munaut3f16da22010-12-01 22:25:40 +010037
Max8b1a2f82017-06-15 14:59:20 +020038int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len);
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020039int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type,
40 const uint8_t *data, int len);
41int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr,
42 uint8_t act_type,
Harald Welte52b1f982008-12-23 20:25:15 +000043 struct rsl_ie_chan_mode *chan_mode,
44 struct rsl_ie_chan_ident *chan_ident,
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020045 uint8_t bs_power, uint8_t ms_power,
46 uint8_t ta);
47int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type,
Andreas Eversberg723a7512013-10-11 12:55:35 +020048 uint8_t ho_ref);
Harald Welteda783762009-02-18 03:29:53 +000049int rsl_chan_mode_modify_req(struct gsm_lchan *ts);
Harald Welte08d91a52009-08-30 15:37:11 +090050int rsl_encryption_cmd(struct msgb *msg);
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020051int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len,
Harald Weltebaaf3e22016-11-17 20:54:04 +010052 uint8_t *ms_ident, uint8_t chan_needed, bool is_gprs);
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020053int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val);
Harald Welte52b1f982008-12-23 20:25:15 +000054
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020055int rsl_data_request(struct msgb *msg, uint8_t link_id);
56int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id);
57int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id);
Harald Welte8470bf22008-12-25 23:28:35 +000058
Alexander Couzens16dcf2a2016-12-02 05:21:45 +010059/* Ericcson vendor specific RSL extensions */
60int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val);
61
Harald Welte67fa91b2009-08-10 09:51:40 +020062/* Siemens vendor-specific RSL extensions */
Harald Welte31c48932009-08-10 10:07:33 +020063int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
Harald Welte67fa91b2009-08-10 09:51:40 +020064
Harald Welte75099262009-02-16 21:12:08 +000065/* ip.access specfic RSL extensions */
Holger Hans Peter Freyther231163d2009-11-18 21:06:12 +010066int rsl_ipacc_crcx(struct gsm_lchan *lchan);
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020067int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip,
68 uint16_t port, uint8_t rtp_payload2);
Harald Weltea72273e2009-12-20 16:51:09 +010069int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan);
Harald Welte53cd7ac2010-12-23 12:59:52 +010070int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
Harald Welte75099262009-02-16 21:12:08 +000071
Harald Welte8470bf22008-12-25 23:28:35 +000072int abis_rsl_rcvmsg(struct msgb *msg);
73
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020074uint64_t str_to_imsi(const char *imsi_str);
Holger Hans Peter Freyther5ca825e2012-12-06 12:01:38 +010075int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id,
76 enum rsl_rel_mode release_mode);
Holger Freyther2976c402009-02-04 01:09:20 +000077
Holger Hans Peter Freyther74419492010-04-10 00:12:31 +020078int rsl_lchan_set_state(struct gsm_lchan *lchan, int);
Holger Hans Peter Freyther454140e2014-12-28 12:08:28 +010079int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken);
Holger Hans Peter Freyther74419492010-04-10 00:12:31 +020080
Harald Welte8470bf22008-12-25 23:28:35 +000081/* to be provided by external code */
Harald Welteae0f2362009-07-19 18:36:49 +020082int rsl_deact_sacch(struct gsm_lchan *lchan);
Harald Welte52b1f982008-12-23 20:25:15 +000083
Holger Freytherb0155442009-02-03 23:24:04 +000084/* BCCH related code */
85int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
86int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf);
Holger Freytherb0155442009-02-03 23:24:04 +000087
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +020088int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type,
89 const uint8_t *data, int len);
Harald Welte18b590d2011-01-13 00:08:17 +010090
Harald Weltefcd24452009-06-20 18:15:19 +020091int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db);
92int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm);
93
Holger Hans Peter Freyther8cb4a0f2010-07-21 15:54:32 +080094/* SMSCB functionality */
95int rsl_sms_cb_command(struct gsm_bts *bts, uint8_t chan_number,
Harald Welte30f1f372014-12-28 15:00:45 +010096 struct rsl_ie_cb_cmd_type cb_command,
97 const uint8_t *data, int len);
Holger Hans Peter Freyther8cb4a0f2010-07-21 15:54:32 +080098
Dieter Spaar16646022011-07-28 00:01:50 +020099/* some Nokia specific stuff */
100int rsl_nokia_si_begin(struct gsm_bts_trx *trx);
101int rsl_nokia_si_end(struct gsm_bts_trx *trx);
102
103/* required for Nokia BTS power control */
104int rsl_bs_power_control(struct gsm_bts_trx *trx, uint8_t channel, uint8_t reduction);
105
Holger Hans Peter Freyther85825352011-12-27 22:24:17 +0100106
107int rsl_release_sapis_from(struct gsm_lchan *lchan, int start,
108 enum rsl_rel_mode release_mode);
Holger Hans Peter Freytherb3489392011-12-28 16:21:05 +0100109int rsl_start_t3109(struct gsm_lchan *lchan);
Holger Hans Peter Freyther85825352011-12-27 22:24:17 +0100110
Holger Hans Peter Freyther006e3d82012-12-25 23:45:14 +0100111int rsl_direct_rf_release(struct gsm_lchan *lchan);
112
Neels Hofmeyrd3b7fa82016-07-23 20:08:41 +0200113void dyn_ts_init(struct gsm_bts_trx_ts *ts);
Neels Hofmeyrb74a2c82016-08-24 16:57:31 +0200114int dyn_ts_switchover_start(struct gsm_bts_trx_ts *ts,
Neels Hofmeyrd3b7fa82016-07-23 20:08:41 +0200115 enum gsm_phys_chan_config to_pchan);
Neels Hofmeyrb8afb5f2016-06-02 01:18:02 +0200116
Harald Welte52b1f982008-12-23 20:25:15 +0000117#endif /* RSL_MT_H */
118