Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 1 | /* 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 Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 8 | * 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 Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 10 | * (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 Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 15 | * GNU Affero General Public License for more details. |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 16 | * |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 17 | * 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 Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 19 | * |
| 20 | */ |
| 21 | |
| 22 | #ifndef _RSL_H |
| 23 | #define _RSL_H |
| 24 | |
Harald Welte | 13f5297 | 2010-02-20 18:56:00 +0100 | [diff] [blame] | 25 | #include <osmocore/protocol/gsm_08_58.h> |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 26 | |
Harald Welte | dfe6c7d | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 27 | #include <osmocore/msgb.h> |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 28 | |
Sylvain Munaut | 3f16da2 | 2010-12-01 22:25:40 +0100 | [diff] [blame] | 29 | struct gsm_bts; |
| 30 | struct gsm_lchan; |
| 31 | struct gsm_subscriber; |
Holger Hans Peter Freyther | 5414627 | 2011-01-06 13:47:04 +0100 | [diff] [blame] | 32 | struct gsm_bts_trx_ts; |
Sylvain Munaut | 3f16da2 | 2010-12-01 22:25:40 +0100 | [diff] [blame] | 33 | |
| 34 | |
Harald Welte | e79769b | 2009-02-07 00:48:17 +0000 | [diff] [blame] | 35 | int rsl_bcch_info(struct gsm_bts_trx *trx, u_int8_t type, |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 36 | const u_int8_t *data, int len); |
Harald Welte | e79769b | 2009-02-07 00:48:17 +0000 | [diff] [blame] | 37 | int rsl_sacch_filling(struct gsm_bts_trx *trx, u_int8_t type, |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 38 | const u_int8_t *data, int len); |
Harald Welte | e79769b | 2009-02-07 00:48:17 +0000 | [diff] [blame] | 39 | int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr, |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 40 | u_int8_t act_type, |
| 41 | struct rsl_ie_chan_mode *chan_mode, |
| 42 | struct rsl_ie_chan_ident *chan_ident, |
| 43 | u_int8_t bs_power, u_int8_t ms_power, |
| 44 | u_int8_t ta); |
Harald Welte | da78376 | 2009-02-18 03:29:53 +0000 | [diff] [blame] | 45 | int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type, |
Harald Welte | 8d77b95 | 2009-12-17 00:31:10 +0100 | [diff] [blame] | 46 | u_int8_t ta, u_int8_t ho_ref); |
Harald Welte | da78376 | 2009-02-18 03:29:53 +0000 | [diff] [blame] | 47 | int rsl_chan_mode_modify_req(struct gsm_lchan *ts); |
Harald Welte | 08d91a5 | 2009-08-30 15:37:11 +0900 | [diff] [blame] | 48 | int rsl_encryption_cmd(struct msgb *msg); |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 49 | int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len, |
| 50 | u_int8_t *ms_ident, u_int8_t chan_needed); |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 51 | int rsl_imm_assign_cmd(struct gsm_bts *bts, u_int8_t len, u_int8_t *val); |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 52 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 53 | int rsl_data_request(struct msgb *msg, u_int8_t link_id); |
Harald Welte | edcc527 | 2009-08-09 13:47:35 +0200 | [diff] [blame] | 54 | int rsl_establish_request(struct gsm_lchan *lchan, u_int8_t link_id); |
Harald Welte | d2dc1de | 2009-08-08 13:15:07 +0200 | [diff] [blame] | 55 | int rsl_relase_request(struct gsm_lchan *lchan, u_int8_t link_id); |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 56 | |
Harald Welte | 67fa91b | 2009-08-10 09:51:40 +0200 | [diff] [blame] | 57 | /* Siemens vendor-specific RSL extensions */ |
Harald Welte | 31c4893 | 2009-08-10 10:07:33 +0200 | [diff] [blame] | 58 | int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci); |
Harald Welte | 67fa91b | 2009-08-10 09:51:40 +0200 | [diff] [blame] | 59 | |
Harald Welte | 7509926 | 2009-02-16 21:12:08 +0000 | [diff] [blame] | 60 | /* ip.access specfic RSL extensions */ |
Holger Hans Peter Freyther | 231163d | 2009-11-18 21:06:12 +0100 | [diff] [blame] | 61 | int rsl_ipacc_crcx(struct gsm_lchan *lchan); |
| 62 | int rsl_ipacc_mdcx(struct gsm_lchan *lchan, u_int32_t ip, |
Harald Welte | 5e3d91b | 2009-12-19 16:42:06 +0100 | [diff] [blame] | 63 | u_int16_t port, u_int8_t rtp_payload2); |
Harald Welte | a72273e | 2009-12-20 16:51:09 +0100 | [diff] [blame] | 64 | int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan); |
Harald Welte | 53cd7ac | 2010-12-23 12:59:52 +0100 | [diff] [blame] | 65 | int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act); |
Harald Welte | 7509926 | 2009-02-16 21:12:08 +0000 | [diff] [blame] | 66 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 67 | int abis_rsl_rcvmsg(struct msgb *msg); |
| 68 | |
Holger Freyther | 2976c40 | 2009-02-04 01:09:20 +0000 | [diff] [blame] | 69 | unsigned int get_paging_group(u_int64_t imsi, unsigned int bs_cc_chans, |
| 70 | int n_pag_blocks); |
| 71 | unsigned int n_pag_blocks(int bs_ccch_sdcch_comb, unsigned int bs_ag_blks_res); |
Holger Freyther | 3aa8d6c | 2009-02-04 02:14:45 +0000 | [diff] [blame] | 72 | u_int64_t str_to_imsi(const char *imsi_str); |
Harald Welte | 2476609 | 2009-12-09 19:18:32 +0100 | [diff] [blame] | 73 | u_int8_t lchan2chan_nr(const struct gsm_lchan *lchan); |
Holger Hans Peter Freyther | 4f5848d | 2010-06-08 11:57:45 +0800 | [diff] [blame] | 74 | int rsl_release_request(struct gsm_lchan *lchan, u_int8_t link_id, u_int8_t reason); |
Holger Freyther | 2976c40 | 2009-02-04 01:09:20 +0000 | [diff] [blame] | 75 | |
Holger Hans Peter Freyther | 7441949 | 2010-04-10 00:12:31 +0200 | [diff] [blame] | 76 | int rsl_lchan_set_state(struct gsm_lchan *lchan, int); |
| 77 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 78 | /* to be provided by external code */ |
| 79 | int abis_rsl_sendmsg(struct msgb *msg); |
Harald Welte | ae0f236 | 2009-07-19 18:36:49 +0200 | [diff] [blame] | 80 | int rsl_deact_sacch(struct gsm_lchan *lchan); |
Holger Hans Peter Freyther | 4b85a32 | 2010-07-29 17:09:36 +0800 | [diff] [blame] | 81 | int rsl_lchan_rll_release(struct gsm_lchan *lchan, u_int8_t link_id); |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 82 | |
Holger Freyther | b015544 | 2009-02-03 23:24:04 +0000 | [diff] [blame] | 83 | /* BCCH related code */ |
| 84 | int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); |
| 85 | int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf); |
| 86 | int rsl_number_of_paging_subchannels(struct gsm_bts *bts); |
| 87 | |
Harald Welte | 18b590d | 2011-01-13 00:08:17 +0100 | [diff] [blame^] | 88 | int rsl_sacch_info_modify(struct gsm_lchan *lchan, u_int8_t type, |
| 89 | const u_int8_t *data, int len); |
| 90 | |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 91 | int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db); |
| 92 | int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm); |
| 93 | |
Holger Hans Peter Freyther | 8cb4a0f | 2010-07-21 15:54:32 +0800 | [diff] [blame] | 94 | /* SMSCB functionality */ |
| 95 | int rsl_sms_cb_command(struct gsm_bts *bts, uint8_t chan_number, |
| 96 | uint8_t cb_command, const uint8_t *data, int len); |
| 97 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 98 | #endif /* RSL_MT_H */ |
| 99 | |