2008-12-23 20:25:15 +00:00
|
|
|
/* GSM Radio Signalling Link messages on the A-bis interface
|
|
|
|
* 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */
|
|
|
|
|
|
|
|
/* (C) 2008 by Harald Welte <laforge@gnumonks.org>
|
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2011-01-01 14:25:50 +00:00
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2008-12-23 20:25:15 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2011-01-01 14:25:50 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
2008-12-23 20:25:15 +00:00
|
|
|
*
|
2011-01-01 14:25:50 +00:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2008-12-23 20:25:15 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _RSL_H
|
|
|
|
#define _RSL_H
|
|
|
|
|
2016-11-17 19:54:04 +00:00
|
|
|
#include <stdbool.h>
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/gsm/protocol/gsm_08_58.h>
|
2016-07-23 18:08:41 +00:00
|
|
|
#include <osmocom/gsm/gsm_utils.h>
|
2017-06-15 12:59:20 +00:00
|
|
|
#include <osmocom/gsm/sysinfo.h>
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/core/msgb.h>
|
2017-11-27 21:30:47 +00:00
|
|
|
#include <osmocom/bsc/gsm_data.h>
|
2008-12-23 20:25:15 +00:00
|
|
|
|
2010-12-01 21:25:40 +00:00
|
|
|
struct gsm_bts;
|
|
|
|
struct gsm_lchan;
|
2011-01-06 12:47:04 +00:00
|
|
|
struct gsm_bts_trx_ts;
|
2010-12-01 21:25:40 +00:00
|
|
|
|
2016-04-15 14:04:45 +00:00
|
|
|
#define GSM48_LEN2PLEN(a) (((a) << 2) | 1)
|
2010-12-01 21:25:40 +00:00
|
|
|
|
2017-09-06 16:20:36 +00:00
|
|
|
#define rsl_lchan_set_state(lch_, st_) \
|
|
|
|
rsl_lchan_set_state_with_log(lch_, st_, __BASE_FILE__, __LINE__)
|
|
|
|
|
2017-06-15 12:59:20 +00:00
|
|
|
int rsl_bcch_info(const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len);
|
2011-04-18 15:04:00 +00:00
|
|
|
int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type,
|
|
|
|
const uint8_t *data, int len);
|
|
|
|
int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type,
|
2013-10-11 10:55:35 +00:00
|
|
|
uint8_t ho_ref);
|
2009-02-18 03:29:53 +00:00
|
|
|
int rsl_chan_mode_modify_req(struct gsm_lchan *ts);
|
2009-08-30 06:37:11 +00:00
|
|
|
int rsl_encryption_cmd(struct msgb *msg);
|
2011-04-18 15:04:00 +00:00
|
|
|
int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len,
|
2016-11-17 19:54:04 +00:00
|
|
|
uint8_t *ms_ident, uint8_t chan_needed, bool is_gprs);
|
2011-04-18 15:04:00 +00:00
|
|
|
int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val);
|
2008-12-23 20:25:15 +00:00
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
int rsl_data_request(struct msgb *msg, uint8_t link_id);
|
|
|
|
int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id);
|
|
|
|
int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id);
|
2008-12-25 23:28:35 +00:00
|
|
|
|
2016-12-02 04:21:45 +00:00
|
|
|
/* Ericcson vendor specific RSL extensions */
|
|
|
|
int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val);
|
|
|
|
|
2009-08-10 07:51:40 +00:00
|
|
|
/* Siemens vendor-specific RSL extensions */
|
2009-08-10 08:07:33 +00:00
|
|
|
int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
|
2009-08-10 07:51:40 +00:00
|
|
|
|
2009-02-16 21:12:08 +00:00
|
|
|
/* ip.access specfic RSL extensions */
|
2009-11-18 20:06:12 +00:00
|
|
|
int rsl_ipacc_crcx(struct gsm_lchan *lchan);
|
2011-04-18 15:04:00 +00:00
|
|
|
int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip,
|
|
|
|
uint16_t port, uint8_t rtp_payload2);
|
2009-12-20 15:51:09 +00:00
|
|
|
int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan);
|
2010-12-23 11:59:52 +00:00
|
|
|
int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
|
2009-02-16 21:12:08 +00:00
|
|
|
|
2008-12-25 23:28:35 +00:00
|
|
|
int abis_rsl_rcvmsg(struct msgb *msg);
|
|
|
|
|
2012-12-06 11:01:38 +00:00
|
|
|
int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id,
|
|
|
|
enum rsl_rel_mode release_mode);
|
2009-02-04 01:09:20 +00:00
|
|
|
|
2017-09-06 16:20:36 +00:00
|
|
|
int rsl_lchan_set_state_with_log(struct gsm_lchan *lchan, enum gsm_lchan_state state, const char *file, unsigned line);
|
2014-12-28 11:08:28 +00:00
|
|
|
int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken);
|
2010-04-09 22:12:31 +00:00
|
|
|
|
2008-12-25 23:28:35 +00:00
|
|
|
/* to be provided by external code */
|
2009-07-19 16:36:49 +00:00
|
|
|
int rsl_deact_sacch(struct gsm_lchan *lchan);
|
2008-12-23 20:25:15 +00:00
|
|
|
|
2009-02-03 23:24:04 +00:00
|
|
|
/* BCCH related code */
|
|
|
|
int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
|
|
|
|
int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf);
|
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type,
|
|
|
|
const uint8_t *data, int len);
|
2011-01-12 23:08:17 +00:00
|
|
|
|
2009-06-20 16:15:19 +00:00
|
|
|
int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db);
|
|
|
|
int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm);
|
|
|
|
|
2010-07-21 07:54:32 +00:00
|
|
|
/* SMSCB functionality */
|
|
|
|
int rsl_sms_cb_command(struct gsm_bts *bts, uint8_t chan_number,
|
2014-12-28 14:00:45 +00:00
|
|
|
struct rsl_ie_cb_cmd_type cb_command,
|
|
|
|
const uint8_t *data, int len);
|
2010-07-21 07:54:32 +00:00
|
|
|
|
2011-07-27 22:01:50 +00:00
|
|
|
/* some Nokia specific stuff */
|
|
|
|
int rsl_nokia_si_begin(struct gsm_bts_trx *trx);
|
|
|
|
int rsl_nokia_si_end(struct gsm_bts_trx *trx);
|
|
|
|
|
|
|
|
/* required for Nokia BTS power control */
|
|
|
|
int rsl_bs_power_control(struct gsm_bts_trx *trx, uint8_t channel, uint8_t reduction);
|
|
|
|
|
2011-12-27 21:24:17 +00:00
|
|
|
|
|
|
|
int rsl_release_sapis_from(struct gsm_lchan *lchan, int start,
|
|
|
|
enum rsl_rel_mode release_mode);
|
2011-12-28 15:21:05 +00:00
|
|
|
int rsl_start_t3109(struct gsm_lchan *lchan);
|
2011-12-27 21:24:17 +00:00
|
|
|
|
2012-12-25 22:45:14 +00:00
|
|
|
int rsl_direct_rf_release(struct gsm_lchan *lchan);
|
|
|
|
|
2016-07-23 18:08:41 +00:00
|
|
|
void dyn_ts_init(struct gsm_bts_trx_ts *ts);
|
dyn TS: clearly use lchan[0], fixing minor confusion
The dyn_ts_switchover_*() functions made the impression that they act on a
specific lchan of a timeslot. The assumption that we would remember to use e.g.
lchan[1] across a PDCH deactivation is brain damaged to begin with; and
factually we always use lchan[0] anyway (the only case for using lchan[1] would
be when switching to TCH/H, but the channel allocator will always return
lchan[0] for that).
Instead of the brain damaged lchan args, use a ts arg across all
dyn_ts_switchover_*() functions, with one exception: The
dyn_ts_switchover_complete() actually receives an RSL activation ack message on
a specific lchan and needs to evaluate its lchan type. This will always be
lchan[0] as it is now, but we should stick with the lchan the message was sent
for.
For PDCH, a check to use lchan[0] already existed, when composing the ACT
message in rsl_chan_activate_lchan_as_pdch(). Replace with an assertion.
Adjust all callers to pass ts instead of lchan.
In dyn_ts_switchover_start(), there was a dead code check that jumps to
switchover_complete() in case the pchan already matches. This never hits,
because we only call dyn_ts_switchover_start() when pchans mismatch. So avoid
guessing at passing lchan[0] to dyn_ts_switchover_complete() by not calling it
at all but logging an error instead.
In rsl_chan_activate_lchan(), we remember some values before going into
switchover from PDCH. Explicitly store them in lchan[0], because after a PDCH
release we have always and will activate no other than lchan[0].
In dyn_ts_switchover_continue(), move the check for any existing lchan->rqd_ref
further above, and more correctly check all lchans that were so far valid on
the TS, instead of just one.
This partly prepares for a subsequent commit to fix the act_timer use for dyn
TS: with the old lchan arg, we might schedule an activation timer on lchan[1]
but receive an ack on lchan[0] (for PDCH), leading to an act_timer expiry.
Change-Id: I3f5d48a9bdaa49a42a1908d4a03744638c59796a
2016-08-24 14:57:31 +00:00
|
|
|
int dyn_ts_switchover_start(struct gsm_bts_trx_ts *ts,
|
2016-07-23 18:08:41 +00:00
|
|
|
enum gsm_phys_chan_config to_pchan);
|
2016-06-01 23:18:02 +00:00
|
|
|
|
2008-12-23 20:25:15 +00:00
|
|
|
#endif /* RSL_MT_H */
|
|
|
|
|