blob: 4f9d483d995840213f9d0485ec6f907c08bc7ce2 [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 Welte13f52972010-02-20 18:56:00 +010025#include <osmocore/protocol/gsm_08_58.h>
Harald Welte52b1f982008-12-23 20:25:15 +000026
Harald Weltedfe6c7d2010-02-20 16:24:02 +010027#include <osmocore/msgb.h>
Harald Welte52b1f982008-12-23 20:25:15 +000028
Sylvain Munaut3f16da22010-12-01 22:25:40 +010029struct gsm_bts;
30struct gsm_lchan;
31struct gsm_subscriber;
32
33
Harald Weltee79769b2009-02-07 00:48:17 +000034int rsl_bcch_info(struct gsm_bts_trx *trx, u_int8_t type,
Harald Welte52b1f982008-12-23 20:25:15 +000035 const u_int8_t *data, int len);
Harald Weltee79769b2009-02-07 00:48:17 +000036int rsl_sacch_filling(struct gsm_bts_trx *trx, u_int8_t type,
Harald Welte52b1f982008-12-23 20:25:15 +000037 const u_int8_t *data, int len);
Harald Weltee79769b2009-02-07 00:48:17 +000038int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr,
Harald Welte52b1f982008-12-23 20:25:15 +000039 u_int8_t act_type,
40 struct rsl_ie_chan_mode *chan_mode,
41 struct rsl_ie_chan_ident *chan_ident,
42 u_int8_t bs_power, u_int8_t ms_power,
43 u_int8_t ta);
Harald Welteda783762009-02-18 03:29:53 +000044int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type,
Harald Welte8d77b952009-12-17 00:31:10 +010045 u_int8_t ta, u_int8_t ho_ref);
Harald Welteda783762009-02-18 03:29:53 +000046int rsl_chan_mode_modify_req(struct gsm_lchan *ts);
Harald Welte08d91a52009-08-30 15:37:11 +090047int rsl_encryption_cmd(struct msgb *msg);
Harald Welte52b1f982008-12-23 20:25:15 +000048int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len,
49 u_int8_t *ms_ident, u_int8_t chan_needed);
Harald Welte52b1f982008-12-23 20:25:15 +000050int rsl_imm_assign_cmd(struct gsm_bts *bts, u_int8_t len, u_int8_t *val);
Harald Welte52b1f982008-12-23 20:25:15 +000051
Harald Welte8470bf22008-12-25 23:28:35 +000052int rsl_data_request(struct msgb *msg, u_int8_t link_id);
Harald Welteedcc5272009-08-09 13:47:35 +020053int rsl_establish_request(struct gsm_lchan *lchan, u_int8_t link_id);
Harald Welted2dc1de2009-08-08 13:15:07 +020054int rsl_relase_request(struct gsm_lchan *lchan, u_int8_t link_id);
Harald Welte8470bf22008-12-25 23:28:35 +000055
Harald Welte67fa91b2009-08-10 09:51:40 +020056/* Siemens vendor-specific RSL extensions */
Harald Welte31c48932009-08-10 10:07:33 +020057int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
Harald Welte67fa91b2009-08-10 09:51:40 +020058
Harald Welte75099262009-02-16 21:12:08 +000059/* ip.access specfic RSL extensions */
Holger Hans Peter Freyther231163d2009-11-18 21:06:12 +010060int rsl_ipacc_crcx(struct gsm_lchan *lchan);
61int rsl_ipacc_mdcx(struct gsm_lchan *lchan, u_int32_t ip,
Harald Welte5e3d91b2009-12-19 16:42:06 +010062 u_int16_t port, u_int8_t rtp_payload2);
Harald Weltea72273e2009-12-20 16:51:09 +010063int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan);
Harald Welte53cd7ac2010-12-23 12:59:52 +010064int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
Harald Welte75099262009-02-16 21:12:08 +000065
Harald Welte8470bf22008-12-25 23:28:35 +000066int abis_rsl_rcvmsg(struct msgb *msg);
67
Holger Freyther2976c402009-02-04 01:09:20 +000068unsigned int get_paging_group(u_int64_t imsi, unsigned int bs_cc_chans,
69 int n_pag_blocks);
70unsigned int n_pag_blocks(int bs_ccch_sdcch_comb, unsigned int bs_ag_blks_res);
Holger Freyther3aa8d6c2009-02-04 02:14:45 +000071u_int64_t str_to_imsi(const char *imsi_str);
Harald Welte24766092009-12-09 19:18:32 +010072u_int8_t lchan2chan_nr(const struct gsm_lchan *lchan);
Holger Hans Peter Freyther4f5848d2010-06-08 11:57:45 +080073int rsl_release_request(struct gsm_lchan *lchan, u_int8_t link_id, u_int8_t reason);
Holger Freyther2976c402009-02-04 01:09:20 +000074
Holger Hans Peter Freyther74419492010-04-10 00:12:31 +020075int rsl_lchan_set_state(struct gsm_lchan *lchan, int);
76
Harald Welte8470bf22008-12-25 23:28:35 +000077/* to be provided by external code */
78int abis_rsl_sendmsg(struct msgb *msg);
Harald Welteae0f2362009-07-19 18:36:49 +020079int rsl_deact_sacch(struct gsm_lchan *lchan);
Holger Hans Peter Freyther4b85a322010-07-29 17:09:36 +080080int rsl_lchan_rll_release(struct gsm_lchan *lchan, u_int8_t link_id);
Harald Welte52b1f982008-12-23 20:25:15 +000081
Holger Freytherb0155442009-02-03 23:24:04 +000082/* BCCH related code */
83int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
84int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf);
85int rsl_number_of_paging_subchannels(struct gsm_bts *bts);
86
Harald Weltefcd24452009-06-20 18:15:19 +020087int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db);
88int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm);
89
Holger Hans Peter Freyther8cb4a0f2010-07-21 15:54:32 +080090/* SMSCB functionality */
91int rsl_sms_cb_command(struct gsm_bts *bts, uint8_t chan_number,
92 uint8_t cb_command, const uint8_t *data, int len);
93
Harald Welte52b1f982008-12-23 20:25:15 +000094#endif /* RSL_MT_H */
95