2011-05-25 11:10:08 +00:00
|
|
|
#ifndef _GSM_DATA_SHAREDH
|
|
|
|
#define _GSM_DATA_SHAREDH
|
|
|
|
|
2011-06-09 19:48:49 +00:00
|
|
|
#include <regex.h>
|
2011-05-25 11:10:08 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include <osmocom/core/timer.h>
|
|
|
|
#include <osmocom/core/bitvec.h>
|
|
|
|
#include <osmocom/core/statistics.h>
|
|
|
|
#include <osmocom/core/utils.h>
|
|
|
|
#include <osmocom/gsm/gsm_utils.h>
|
|
|
|
#include <osmocom/gsm/tlv.h>
|
|
|
|
#include <osmocom/gsm/rxlev_stat.h>
|
|
|
|
#include <osmocom/gsm/sysinfo.h>
|
2013-03-07 18:38:09 +00:00
|
|
|
#include <osmocom/gsm/meas_rep.h>
|
2016-05-11 10:45:13 +00:00
|
|
|
#include <osmocom/gsm/protocol/gsm_04_08.h>
|
2011-05-25 11:10:08 +00:00
|
|
|
#include <osmocom/gsm/protocol/gsm_08_58.h>
|
2011-06-05 11:31:33 +00:00
|
|
|
#include <osmocom/gsm/protocol/gsm_12_21.h>
|
2011-05-25 11:10:08 +00:00
|
|
|
|
2011-08-24 11:52:07 +00:00
|
|
|
#include <osmocom/abis/e1_input.h>
|
|
|
|
|
2012-12-20 18:03:18 +00:00
|
|
|
#ifndef ROLE_BSC
|
|
|
|
#include <osmocom/gsm/lapdm.h>
|
|
|
|
#endif
|
|
|
|
|
2016-05-10 11:30:17 +00:00
|
|
|
#include <openbsc/common_cs.h>
|
|
|
|
|
2011-08-15 13:53:00 +00:00
|
|
|
struct osmo_bsc_data;
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
struct osmo_bsc_sccp_con;
|
|
|
|
struct gsm_sms_queue;
|
|
|
|
|
|
|
|
/* RRLP mode of operation */
|
|
|
|
enum rrlp_mode {
|
|
|
|
RRLP_MODE_NONE,
|
|
|
|
RRLP_MODE_MS_BASED,
|
|
|
|
RRLP_MODE_MS_PREF,
|
|
|
|
RRLP_MODE_ASS_PREF,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Channel Request reason */
|
|
|
|
enum gsm_chreq_reason_t {
|
|
|
|
GSM_CHREQ_REASON_EMERG,
|
|
|
|
GSM_CHREQ_REASON_PAG,
|
|
|
|
GSM_CHREQ_REASON_CALL,
|
|
|
|
GSM_CHREQ_REASON_LOCATION_UPD,
|
|
|
|
GSM_CHREQ_REASON_OTHER,
|
2016-11-28 22:26:50 +00:00
|
|
|
GSM_CHREQ_REASON_PDCH,
|
2011-05-25 11:10:08 +00:00
|
|
|
};
|
|
|
|
|
2016-10-18 14:19:33 +00:00
|
|
|
/* lchans 0..3 are SDCCH in combined channel configuration,
|
|
|
|
use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */
|
|
|
|
#define CCCH_LCHAN 4
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
#define TRX_NR_TS 8
|
|
|
|
#define TS_MAX_LCHAN 8
|
|
|
|
|
|
|
|
#define HARDCODED_ARFCN 123
|
|
|
|
#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */
|
|
|
|
|
|
|
|
/* for multi-drop config */
|
|
|
|
#define HARDCODED_BTS0_TS 1
|
|
|
|
#define HARDCODED_BTS1_TS 6
|
|
|
|
#define HARDCODED_BTS2_TS 11
|
|
|
|
|
2017-03-23 11:01:07 +00:00
|
|
|
#define MAX_VERSION_LENGTH 64
|
|
|
|
|
2017-05-09 13:19:15 +00:00
|
|
|
#define MAX_BTS_FEATURES 128
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
enum gsm_hooks {
|
|
|
|
GSM_HOOK_NM_SWLOAD,
|
|
|
|
GSM_HOOK_RR_PAGING,
|
|
|
|
GSM_HOOK_RR_SECURITY,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum gsm_paging_event {
|
|
|
|
GSM_PAGING_SUCCEEDED,
|
|
|
|
GSM_PAGING_EXPIRED,
|
|
|
|
GSM_PAGING_OOM,
|
|
|
|
GSM_PAGING_BUSY,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum bts_gprs_mode {
|
|
|
|
BTS_GPRS_NONE = 0,
|
|
|
|
BTS_GPRS_GPRS = 1,
|
|
|
|
BTS_GPRS_EGPRS = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct gsm_lchan;
|
|
|
|
struct gsm_subscriber;
|
|
|
|
struct gsm_mncc;
|
2011-09-04 11:53:26 +00:00
|
|
|
struct osmo_rtp_socket;
|
2011-05-25 11:10:08 +00:00
|
|
|
struct rtp_socket;
|
|
|
|
struct bsc_api;
|
|
|
|
|
|
|
|
/* Network Management State */
|
|
|
|
struct gsm_nm_state {
|
|
|
|
uint8_t operational;
|
|
|
|
uint8_t administrative;
|
|
|
|
uint8_t availability;
|
|
|
|
};
|
|
|
|
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo {
|
2011-06-05 11:31:33 +00:00
|
|
|
uint8_t obj_class;
|
2013-11-05 15:06:17 +00:00
|
|
|
uint8_t procedure_pending;
|
2011-06-05 11:31:33 +00:00
|
|
|
struct abis_om_obj_inst obj_inst;
|
2011-05-30 10:07:53 +00:00
|
|
|
const char *name;
|
|
|
|
struct gsm_nm_state nm_state;
|
|
|
|
struct tlv_parsed *nm_attr;
|
2011-06-06 16:58:48 +00:00
|
|
|
struct gsm_bts *bts;
|
2011-05-30 10:07:53 +00:00
|
|
|
};
|
|
|
|
|
2016-07-09 20:20:57 +00:00
|
|
|
/* Ericsson OM2000 Managed Object */
|
|
|
|
struct abis_om2k_mo {
|
|
|
|
uint8_t class;
|
|
|
|
uint8_t bts;
|
|
|
|
uint8_t assoc_so;
|
|
|
|
uint8_t inst;
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
struct om2k_mo {
|
|
|
|
struct abis_om2k_mo addr;
|
|
|
|
struct osmo_fsm_inst *fsm;
|
|
|
|
};
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
#define A38_XOR_MIN_KEY_LEN 12
|
|
|
|
#define A38_XOR_MAX_KEY_LEN 16
|
|
|
|
#define A38_COMP128_KEY_LEN 16
|
|
|
|
#define RSL_ENC_ALG_A5(x) (x+1)
|
2016-04-20 13:57:12 +00:00
|
|
|
#define MAX_EARFCN_LIST 32
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
/* is the data link established? who established it? */
|
|
|
|
#define LCHAN_SAPI_UNUSED 0
|
|
|
|
#define LCHAN_SAPI_MS 1
|
|
|
|
#define LCHAN_SAPI_NET 2
|
2013-12-05 12:25:06 +00:00
|
|
|
#define LCHAN_SAPI_REL 3
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
/* state of a logical channel */
|
|
|
|
enum gsm_lchan_state {
|
|
|
|
LCHAN_S_NONE, /* channel is not active */
|
2012-01-14 23:02:17 +00:00
|
|
|
LCHAN_S_ACT_REQ, /* channel activation requested */
|
2011-05-25 11:10:08 +00:00
|
|
|
LCHAN_S_ACTIVE, /* channel is active and operational */
|
|
|
|
LCHAN_S_REL_REQ, /* channel release has been requested */
|
|
|
|
LCHAN_S_REL_ERR, /* channel is in an error state */
|
2012-12-06 18:25:06 +00:00
|
|
|
LCHAN_S_BROKEN, /* channel is somehow unusable */
|
2011-05-25 11:10:08 +00:00
|
|
|
LCHAN_S_INACTIVE, /* channel is set inactive */
|
|
|
|
};
|
|
|
|
|
2011-06-29 08:38:34 +00:00
|
|
|
/* BTS ONLY */
|
|
|
|
#define MAX_NUM_UL_MEAS 104
|
|
|
|
#define LC_UL_M_F_L1_VALID (1 << 0)
|
|
|
|
#define LC_UL_M_F_RES_VALID (1 << 1)
|
|
|
|
|
|
|
|
struct bts_ul_meas {
|
|
|
|
/* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */
|
|
|
|
uint16_t ber10k;
|
|
|
|
/* timing advance offset (in quarter bits) */
|
|
|
|
int16_t ta_offs_qbits;
|
|
|
|
/* C/I ratio in dB */
|
|
|
|
float c_i;
|
|
|
|
/* flags */
|
|
|
|
uint8_t is_sub:1;
|
|
|
|
/* RSSI in dBm * -1 */
|
|
|
|
uint8_t inv_rssi;
|
|
|
|
};
|
2011-09-06 20:14:43 +00:00
|
|
|
|
2013-12-07 17:32:28 +00:00
|
|
|
struct bts_codec_conf {
|
|
|
|
uint8_t hr;
|
|
|
|
uint8_t efr;
|
|
|
|
uint8_t amr;
|
|
|
|
};
|
|
|
|
|
2011-09-06 20:14:43 +00:00
|
|
|
struct amr_mode {
|
|
|
|
uint8_t mode;
|
2015-09-24 09:30:58 +00:00
|
|
|
uint8_t threshold;
|
|
|
|
uint8_t hysteresis;
|
2011-09-06 20:14:43 +00:00
|
|
|
};
|
2015-09-24 09:30:58 +00:00
|
|
|
|
2011-09-06 20:14:43 +00:00
|
|
|
struct amr_multirate_conf {
|
|
|
|
uint8_t gsm48_ie[2];
|
2015-09-24 09:30:58 +00:00
|
|
|
struct amr_mode ms_mode[4];
|
|
|
|
struct amr_mode bts_mode[4];
|
2011-09-06 20:14:43 +00:00
|
|
|
uint8_t num_modes;
|
|
|
|
};
|
2011-06-29 08:38:34 +00:00
|
|
|
/* /BTS ONLY */
|
|
|
|
|
2012-08-24 13:33:56 +00:00
|
|
|
enum lchan_csd_mode {
|
|
|
|
LCHAN_CSD_M_NT,
|
|
|
|
LCHAN_CSD_M_T_1200_75,
|
|
|
|
LCHAN_CSD_M_T_600,
|
|
|
|
LCHAN_CSD_M_T_1200,
|
|
|
|
LCHAN_CSD_M_T_2400,
|
|
|
|
LCHAN_CSD_M_T_9600,
|
|
|
|
LCHAN_CSD_M_T_14400,
|
|
|
|
LCHAN_CSD_M_T_29000,
|
|
|
|
LCHAN_CSD_M_T_32000,
|
|
|
|
};
|
|
|
|
|
2012-12-29 11:32:30 +00:00
|
|
|
/* State of the SAPIs in the lchan */
|
|
|
|
enum lchan_sapi_state {
|
|
|
|
LCHAN_SAPI_S_NONE,
|
|
|
|
LCHAN_SAPI_S_REQ,
|
|
|
|
LCHAN_SAPI_S_ASSIGNED,
|
|
|
|
LCHAN_SAPI_S_REL,
|
|
|
|
LCHAN_SAPI_S_ERROR,
|
|
|
|
};
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
struct gsm_lchan {
|
|
|
|
/* The TS that we're part of */
|
|
|
|
struct gsm_bts_trx_ts *ts;
|
|
|
|
/* The logical subslot number in the TS */
|
|
|
|
uint8_t nr;
|
|
|
|
/* The logical channel type */
|
|
|
|
enum gsm_chan_t type;
|
|
|
|
/* RSL channel mode */
|
|
|
|
enum rsl_cmod_spd rsl_cmode;
|
|
|
|
/* If TCH, traffic channel mode */
|
|
|
|
enum gsm48_chan_mode tch_mode;
|
2012-08-24 13:33:56 +00:00
|
|
|
enum lchan_csd_mode csd_mode;
|
2011-05-25 11:10:08 +00:00
|
|
|
/* State */
|
|
|
|
enum gsm_lchan_state state;
|
2014-12-28 11:08:28 +00:00
|
|
|
const char *broken_reason;
|
2011-05-25 11:10:08 +00:00
|
|
|
/* Power levels for MS and BTS */
|
|
|
|
uint8_t bs_power;
|
|
|
|
uint8_t ms_power;
|
|
|
|
/* Encryption information */
|
2016-05-10 11:30:17 +00:00
|
|
|
struct gsm_encr encr;
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
/* AMR bits */
|
2014-01-19 10:47:44 +00:00
|
|
|
uint8_t mr_ms_lv[7];
|
|
|
|
uint8_t mr_bts_lv[7];
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
/* Established data link layer services */
|
|
|
|
uint8_t sapis[8];
|
2013-01-01 18:20:28 +00:00
|
|
|
int sacch_deact;
|
2011-12-27 19:49:53 +00:00
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
struct {
|
|
|
|
uint32_t bound_ip;
|
|
|
|
uint32_t connect_ip;
|
|
|
|
uint16_t bound_port;
|
|
|
|
uint16_t connect_port;
|
|
|
|
uint16_t conn_id;
|
|
|
|
uint8_t rtp_payload;
|
|
|
|
uint8_t rtp_payload2;
|
|
|
|
uint8_t speech_mode;
|
2011-09-04 11:53:26 +00:00
|
|
|
#ifdef ROLE_BSC
|
2011-05-25 11:10:08 +00:00
|
|
|
struct rtp_socket *rtp_socket;
|
2011-09-04 11:53:26 +00:00
|
|
|
#else
|
|
|
|
struct osmo_rtp_socket *rtp_socket;
|
|
|
|
#endif
|
2011-05-25 11:10:08 +00:00
|
|
|
} abis_ip;
|
|
|
|
|
2011-06-26 12:13:37 +00:00
|
|
|
uint8_t rqd_ta;
|
|
|
|
|
2015-12-05 15:19:21 +00:00
|
|
|
char *name;
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
#ifdef ROLE_BSC
|
|
|
|
struct osmo_timer_list T3101;
|
2011-12-28 15:21:05 +00:00
|
|
|
struct osmo_timer_list T3109;
|
2011-05-25 11:10:08 +00:00
|
|
|
struct osmo_timer_list T3111;
|
|
|
|
struct osmo_timer_list error_timer;
|
2011-08-10 21:26:33 +00:00
|
|
|
struct osmo_timer_list act_timer;
|
2013-12-05 12:25:06 +00:00
|
|
|
struct osmo_timer_list rel_work;
|
2012-12-06 18:25:06 +00:00
|
|
|
uint8_t error_cause;
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
/* table of neighbor cell measurements */
|
|
|
|
struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];
|
|
|
|
|
|
|
|
/* cache of last measurement reports on this lchan */
|
|
|
|
struct gsm_meas_rep meas_rep[6];
|
|
|
|
int meas_rep_idx;
|
|
|
|
|
|
|
|
/* GSM Random Access data */
|
|
|
|
struct gsm48_req_ref *rqd_ref;
|
|
|
|
|
|
|
|
struct gsm_subscriber_connection *conn;
|
2013-10-11 11:32:30 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
/* channel activation type and handover ref */
|
|
|
|
uint8_t act_type;
|
|
|
|
uint8_t ho_ref;
|
2016-07-23 17:45:15 +00:00
|
|
|
struct gsm48_req_ref *rqd_ref;
|
|
|
|
uint8_t rqd_ta;
|
2016-07-23 19:00:51 +00:00
|
|
|
} dyn;
|
2011-06-25 08:02:33 +00:00
|
|
|
#else
|
2012-12-29 11:32:30 +00:00
|
|
|
/* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23.
|
|
|
|
* Currently we don't share these headers so this is a magic number. */
|
2013-04-05 16:41:45 +00:00
|
|
|
struct llist_head sapi_cmds;
|
2012-12-29 11:32:30 +00:00
|
|
|
uint8_t sapis_dl[23];
|
|
|
|
uint8_t sapis_ul[23];
|
2011-06-25 08:02:33 +00:00
|
|
|
struct lapdm_channel lapdm_ch;
|
2011-09-04 11:53:26 +00:00
|
|
|
struct llist_head dl_tch_queue;
|
2011-06-26 12:13:37 +00:00
|
|
|
struct {
|
|
|
|
/* bitmask of all SI that are present/valid in si_buf */
|
|
|
|
uint32_t valid;
|
|
|
|
uint32_t last;
|
|
|
|
/* buffers where we put the pre-computed SI */
|
|
|
|
sysinfo_buf_t buf[_MAX_SYSINFO_TYPE];
|
|
|
|
} si;
|
2011-06-29 08:38:34 +00:00
|
|
|
struct {
|
|
|
|
uint8_t flags;
|
|
|
|
/* RSL measurment result number, 0 at lchan_act */
|
|
|
|
uint8_t res_nr;
|
|
|
|
/* current Tx power level of the BTS */
|
|
|
|
uint8_t bts_tx_pwr;
|
|
|
|
/* number of measurements stored in array below */
|
|
|
|
uint8_t num_ul_meas;
|
|
|
|
struct bts_ul_meas uplink[MAX_NUM_UL_MEAS];
|
|
|
|
/* last L1 header from the MS */
|
|
|
|
uint8_t l1_info[2];
|
2013-03-07 18:38:09 +00:00
|
|
|
struct gsm_meas_rep_unidir ul_res;
|
2011-06-29 08:38:34 +00:00
|
|
|
} meas;
|
2011-09-06 20:14:43 +00:00
|
|
|
struct {
|
|
|
|
struct amr_multirate_conf amr_mr;
|
2011-09-07 10:41:38 +00:00
|
|
|
struct {
|
2016-10-05 15:29:02 +00:00
|
|
|
struct osmo_fsm_inst *dl_amr_fsm;
|
2016-10-25 18:22:16 +00:00
|
|
|
/* TCH cache */
|
2016-10-05 15:29:02 +00:00
|
|
|
uint8_t cache[20];
|
2016-10-25 18:22:16 +00:00
|
|
|
/* FACCH cache */
|
|
|
|
uint8_t facch[GSM_MACBLOCK_LEN];
|
2011-09-07 10:41:38 +00:00
|
|
|
uint8_t len;
|
2016-06-10 12:09:07 +00:00
|
|
|
uint32_t fn;
|
|
|
|
bool is_update;
|
2016-10-05 15:29:02 +00:00
|
|
|
/* set for each SID frame to detect talkspurt for codecs
|
|
|
|
without explicit ONSET event */
|
|
|
|
bool ul_sid;
|
|
|
|
/* indicates if DTXd was active during DL measurement
|
|
|
|
period */
|
|
|
|
bool dl_active;
|
|
|
|
} dtx;
|
2014-07-24 19:05:32 +00:00
|
|
|
uint8_t last_cmr;
|
2016-06-03 10:06:26 +00:00
|
|
|
uint32_t last_fn;
|
2011-09-06 20:14:43 +00:00
|
|
|
} tch;
|
2017-01-25 15:19:20 +00:00
|
|
|
|
|
|
|
/* 3GPP TS 48.058 § 9.3.37: [0; 255] ok, -1 means invalid*/
|
|
|
|
int16_t ms_t_offs;
|
|
|
|
/* 3GPP TS 45.010 § 1.2 round trip propagation delay (in symbols) or -1 */
|
|
|
|
int16_t p_offs;
|
|
|
|
|
2012-04-08 18:23:28 +00:00
|
|
|
/* BTS-side ciphering state (rx only, bi-directional, ...) */
|
|
|
|
uint8_t ciph_state;
|
2014-08-09 07:43:53 +00:00
|
|
|
uint8_t ciph_ns;
|
2012-04-19 21:13:35 +00:00
|
|
|
uint8_t loopback;
|
2012-06-16 06:57:08 +00:00
|
|
|
struct {
|
|
|
|
uint8_t active;
|
|
|
|
uint8_t ref;
|
|
|
|
/* T3105: PHYS INF retransmission */
|
|
|
|
struct osmo_timer_list t3105;
|
|
|
|
/* counts up to Ny1 */
|
|
|
|
unsigned int phys_info_count;
|
|
|
|
} ho;
|
2013-02-20 15:06:20 +00:00
|
|
|
/* S counter for link loss */
|
|
|
|
int s;
|
2013-10-25 16:58:30 +00:00
|
|
|
/* Kind of the release/activation. E.g. RSL or PCU */
|
|
|
|
int rel_act_kind;
|
2016-05-18 14:42:16 +00:00
|
|
|
/* RTP header Marker bit to indicate beginning of speech after pause */
|
|
|
|
bool rtp_tx_marker;
|
2015-02-05 21:25:03 +00:00
|
|
|
/* power handling */
|
|
|
|
struct {
|
|
|
|
uint8_t current;
|
|
|
|
uint8_t fixed;
|
|
|
|
} ms_power_ctrl;
|
2017-01-18 15:49:00 +00:00
|
|
|
|
|
|
|
struct msgb *pending_rel_ind_msg;
|
2011-05-25 11:10:08 +00:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2016-06-14 12:08:35 +00:00
|
|
|
enum {
|
|
|
|
TS_F_PDCH_ACTIVE = 0x1000,
|
|
|
|
TS_F_PDCH_ACT_PENDING = 0x2000,
|
|
|
|
TS_F_PDCH_DEACT_PENDING = 0x4000,
|
|
|
|
TS_F_PDCH_PENDING_MASK = 0x6000 /*<
|
|
|
|
TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */
|
|
|
|
} gsm_bts_trx_ts_flags;
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
/* One Timeslot in a TRX */
|
|
|
|
struct gsm_bts_trx_ts {
|
|
|
|
struct gsm_bts_trx *trx;
|
|
|
|
/* number of this timeslot at the TRX */
|
|
|
|
uint8_t nr;
|
|
|
|
|
|
|
|
enum gsm_phys_chan_config pchan;
|
|
|
|
|
2016-07-23 14:14:06 +00:00
|
|
|
struct {
|
|
|
|
enum gsm_phys_chan_config pchan_is;
|
|
|
|
enum gsm_phys_chan_config pchan_want;
|
|
|
|
struct msgb *pending_chan_activ;
|
|
|
|
} dyn;
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
unsigned int flags;
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
struct tlv_parsed nm_attr;
|
|
|
|
uint8_t nm_chan_comb;
|
2011-05-30 10:09:13 +00:00
|
|
|
int tsc; /* -1 == use BTS TSC */
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
/* Parameters below are configured by VTY */
|
|
|
|
int enabled;
|
|
|
|
uint8_t maio;
|
|
|
|
uint8_t hsn;
|
|
|
|
struct bitvec arfcns;
|
|
|
|
uint8_t arfcns_data[1024/8];
|
|
|
|
/* This is the pre-computed MA for channel assignments */
|
|
|
|
struct bitvec ma;
|
|
|
|
uint8_t ma_len; /* part of ma_data that is used */
|
|
|
|
uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */
|
|
|
|
} hopping;
|
|
|
|
|
|
|
|
/* To which E1 subslot are we connected */
|
|
|
|
struct gsm_e1_subslot e1_link;
|
|
|
|
|
2016-07-09 20:20:57 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
struct om2k_mo om2k_mo;
|
|
|
|
} rbs2000;
|
|
|
|
};
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
struct gsm_lchan lchan[TS_MAX_LCHAN];
|
|
|
|
};
|
|
|
|
|
|
|
|
/* One TRX in a BTS */
|
|
|
|
struct gsm_bts_trx {
|
|
|
|
/* list header in bts->trx_list */
|
|
|
|
struct llist_head list;
|
|
|
|
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
/* number of this TRX in the BTS */
|
|
|
|
uint8_t nr;
|
|
|
|
/* human readable name / description */
|
|
|
|
char *description;
|
|
|
|
/* how do we talk RSL with this TRX? */
|
|
|
|
struct gsm_e1_subslot rsl_e1_link;
|
|
|
|
uint8_t rsl_tei;
|
|
|
|
struct e1inp_sign_link *rsl_link;
|
2013-10-06 13:52:14 +00:00
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
/* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */
|
|
|
|
struct e1inp_sign_link *oml_link;
|
|
|
|
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
struct tlv_parsed nm_attr;
|
|
|
|
struct {
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
} bb_transc;
|
|
|
|
|
|
|
|
uint16_t arfcn;
|
|
|
|
int nominal_power; /* in dBm */
|
|
|
|
unsigned int max_power_red; /* in actual dB */
|
2014-07-30 16:20:51 +00:00
|
|
|
|
|
|
|
#ifndef ROLE_BSC
|
2014-08-22 14:12:03 +00:00
|
|
|
struct trx_power_params power_params;
|
2015-02-05 21:25:03 +00:00
|
|
|
int ms_power_control;
|
2011-05-25 11:10:08 +00:00
|
|
|
|
2011-06-06 22:12:53 +00:00
|
|
|
struct {
|
|
|
|
void *l1h;
|
|
|
|
} role_bts;
|
2014-07-30 16:20:51 +00:00
|
|
|
#endif
|
2011-06-06 22:12:53 +00:00
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
struct {
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
} bbsig;
|
|
|
|
struct {
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
} pa;
|
|
|
|
} bs11;
|
|
|
|
struct {
|
|
|
|
unsigned int test_state;
|
|
|
|
uint8_t test_nr;
|
|
|
|
struct rxlev_stats rxlev_stat;
|
|
|
|
} ipaccess;
|
2016-07-09 20:20:57 +00:00
|
|
|
struct {
|
|
|
|
struct {
|
|
|
|
struct om2k_mo om2k_mo;
|
|
|
|
} trxc;
|
|
|
|
struct {
|
|
|
|
struct om2k_mo om2k_mo;
|
|
|
|
} rx;
|
|
|
|
struct {
|
|
|
|
struct om2k_mo om2k_mo;
|
|
|
|
} tx;
|
|
|
|
} rbs2000;
|
2011-05-25 11:10:08 +00:00
|
|
|
};
|
|
|
|
struct gsm_bts_trx_ts ts[TRX_NR_TS];
|
|
|
|
};
|
|
|
|
|
2017-05-12 15:00:30 +00:00
|
|
|
#define GSM_BTS_SI2Q(bts) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater])
|
2017-04-12 13:30:54 +00:00
|
|
|
#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i])
|
|
|
|
#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i])
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
enum gsm_bts_type {
|
|
|
|
GSM_BTS_TYPE_UNKNOWN,
|
|
|
|
GSM_BTS_TYPE_BS11,
|
|
|
|
GSM_BTS_TYPE_NANOBTS,
|
|
|
|
GSM_BTS_TYPE_RBS2000,
|
2011-07-27 22:01:50 +00:00
|
|
|
GSM_BTS_TYPE_NOKIA_SITE,
|
2017-03-23 11:01:07 +00:00
|
|
|
GSM_BTS_TYPE_OSMOBTS,
|
2012-08-17 11:02:12 +00:00
|
|
|
_NUM_GSM_BTS_TYPE
|
2011-05-25 11:10:08 +00:00
|
|
|
};
|
|
|
|
|
2017-03-23 11:01:07 +00:00
|
|
|
enum gsm_bts_type_variant {
|
|
|
|
BTS_UNKNOWN,
|
|
|
|
BTS_OSMO_LITECELL15,
|
|
|
|
BTS_OSMO_OCTPHY,
|
|
|
|
BTS_OSMO_SYSMO,
|
|
|
|
BTS_OSMO_TRX,
|
|
|
|
_NUM_BTS_VARIANT
|
|
|
|
};
|
|
|
|
|
2017-04-10 11:59:14 +00:00
|
|
|
/* Used by OML layer for BTS Attribute reporting */
|
|
|
|
enum bts_attribute {
|
|
|
|
BTS_TYPE_VARIANT,
|
|
|
|
BTS_SUB_MODEL,
|
|
|
|
};
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
struct vty;
|
|
|
|
|
|
|
|
struct gsm_bts_model {
|
|
|
|
struct llist_head list;
|
|
|
|
|
|
|
|
enum gsm_bts_type type;
|
2017-03-23 11:01:07 +00:00
|
|
|
enum gsm_bts_type_variant variant;
|
2011-05-25 11:10:08 +00:00
|
|
|
const char *name;
|
|
|
|
|
|
|
|
bool started;
|
|
|
|
int (*start)(struct gsm_network *net);
|
|
|
|
int (*oml_rcvmsg)(struct msgb *msg);
|
|
|
|
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
void (*e1line_bind_ops)(struct e1inp_line *line);
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts);
|
|
|
|
void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx);
|
|
|
|
void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts);
|
|
|
|
|
|
|
|
struct tlv_definition nm_att_tlvdef;
|
|
|
|
|
2017-05-31 10:15:54 +00:00
|
|
|
/* features of a given BTS model set via gsm_bts_model_register() locally */
|
2011-05-25 11:10:08 +00:00
|
|
|
struct bitvec features;
|
2017-05-09 13:19:15 +00:00
|
|
|
uint8_t _features_data[MAX_BTS_FEATURES/8];
|
2011-05-25 11:10:08 +00:00
|
|
|
};
|
|
|
|
|
2017-05-31 10:15:54 +00:00
|
|
|
/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility
|
|
|
|
with BTS compiled against earlier version of this header */
|
2011-05-25 11:10:08 +00:00
|
|
|
enum gsm_bts_features {
|
|
|
|
BTS_FEAT_HSCSD,
|
|
|
|
BTS_FEAT_GPRS,
|
|
|
|
BTS_FEAT_EGPRS,
|
|
|
|
BTS_FEAT_ECSD,
|
|
|
|
BTS_FEAT_HOPPING,
|
2014-01-19 16:10:50 +00:00
|
|
|
BTS_FEAT_MULTI_TSC,
|
2017-05-10 10:21:17 +00:00
|
|
|
BTS_FEAT_OML_ALERTS,
|
|
|
|
BTS_FEAT_AGCH_PCH_PROP,
|
|
|
|
BTS_FEAT_CBCH,
|
2017-05-31 10:15:54 +00:00
|
|
|
_NUM_BTS_FEAT
|
2011-05-25 11:10:08 +00:00
|
|
|
};
|
|
|
|
|
2017-05-31 10:15:54 +00:00
|
|
|
extern const struct value_string gsm_bts_features_descs[];
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
/*
|
|
|
|
* This keeps track of the paging status of one BTS. It
|
|
|
|
* includes a number of pending requests, a back pointer
|
|
|
|
* to the gsm_bts, a timer and some more state.
|
|
|
|
*/
|
|
|
|
struct gsm_bts_paging_state {
|
|
|
|
/* pending requests */
|
|
|
|
struct llist_head pending_requests;
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
|
|
|
|
struct osmo_timer_list work_timer;
|
|
|
|
struct osmo_timer_list credit_timer;
|
|
|
|
|
|
|
|
/* free chans needed */
|
|
|
|
int free_chans_need;
|
|
|
|
|
|
|
|
/* load */
|
|
|
|
uint16_t available_slots;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct gsm_envabtse {
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct gsm_bts_gprs_nsvc {
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
/* data read via VTY config file, to configure the BTS
|
|
|
|
* via OML from BSC */
|
|
|
|
int id;
|
|
|
|
uint16_t nsvci;
|
|
|
|
uint16_t local_port; /* on the BTS */
|
|
|
|
uint16_t remote_port; /* on the SGSN */
|
|
|
|
uint32_t remote_ip; /* on the SGSN */
|
|
|
|
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
};
|
|
|
|
|
2012-06-28 06:43:14 +00:00
|
|
|
enum gprs_rlc_par {
|
|
|
|
RLC_T3142,
|
|
|
|
RLC_T3169,
|
|
|
|
RLC_T3191,
|
|
|
|
RLC_T3193,
|
|
|
|
RLC_T3195,
|
|
|
|
RLC_N3101,
|
|
|
|
RLC_N3103,
|
|
|
|
RLC_N3105,
|
|
|
|
CV_COUNTDOWN,
|
|
|
|
T_DL_TBF_EXT, /* ms */
|
|
|
|
T_UL_TBF_EXT, /* ms */
|
|
|
|
_NUM_RLC_PAR
|
|
|
|
};
|
|
|
|
|
|
|
|
enum gprs_cs {
|
|
|
|
GPRS_CS1,
|
|
|
|
GPRS_CS2,
|
|
|
|
GPRS_CS3,
|
|
|
|
GPRS_CS4,
|
|
|
|
GPRS_MCS1,
|
|
|
|
GPRS_MCS2,
|
|
|
|
GPRS_MCS3,
|
|
|
|
GPRS_MCS4,
|
|
|
|
GPRS_MCS5,
|
|
|
|
GPRS_MCS6,
|
|
|
|
GPRS_MCS7,
|
|
|
|
GPRS_MCS8,
|
|
|
|
GPRS_MCS9,
|
|
|
|
_NUM_GRPS_CS
|
|
|
|
};
|
|
|
|
|
|
|
|
struct gprs_rlc_cfg {
|
|
|
|
uint16_t parameter[_NUM_RLC_PAR];
|
|
|
|
struct {
|
|
|
|
uint16_t repeat_time; /* ms */
|
|
|
|
uint8_t repeat_count;
|
|
|
|
} paging;
|
|
|
|
uint32_t cs_mask; /* bitmask of gprs_cs */
|
|
|
|
uint8_t initial_cs;
|
|
|
|
uint8_t initial_mcs;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
enum neigh_list_manual_mode {
|
|
|
|
NL_MODE_AUTOMATIC = 0,
|
|
|
|
NL_MODE_MANUAL = 1,
|
|
|
|
NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */
|
|
|
|
};
|
|
|
|
|
2011-08-05 11:51:27 +00:00
|
|
|
enum bts_loc_fix {
|
|
|
|
BTS_LOC_FIX_INVALID = 0,
|
|
|
|
BTS_LOC_FIX_2D = 1,
|
|
|
|
BTS_LOC_FIX_3D = 2,
|
|
|
|
};
|
|
|
|
|
2012-05-14 16:43:23 +00:00
|
|
|
extern const struct value_string bts_loc_fix_names[];
|
|
|
|
|
2011-08-05 11:51:27 +00:00
|
|
|
struct bts_location {
|
|
|
|
struct llist_head list;
|
|
|
|
time_t tstamp;
|
|
|
|
enum bts_loc_fix valid;
|
|
|
|
double lat;
|
|
|
|
double lon;
|
|
|
|
double height;
|
|
|
|
};
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
/* One BTS */
|
|
|
|
struct gsm_bts {
|
|
|
|
/* list header in net->bts_list */
|
|
|
|
struct llist_head list;
|
|
|
|
|
2011-08-05 11:51:27 +00:00
|
|
|
/* Geographical location of the BTS */
|
|
|
|
struct llist_head loc_list;
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
/* number of ths BTS in network */
|
|
|
|
uint8_t nr;
|
|
|
|
/* human readable name / description */
|
|
|
|
char *description;
|
|
|
|
/* Cell Identity */
|
|
|
|
uint16_t cell_identity;
|
|
|
|
/* location area code of this BTS */
|
|
|
|
uint16_t location_area_code;
|
2015-11-20 09:43:31 +00:00
|
|
|
/* Base Station Identification Code (BSIC), lower 3 bits is BCC,
|
|
|
|
* which is used as TSC for the CCCH */
|
2011-05-25 11:10:08 +00:00
|
|
|
uint8_t bsic;
|
|
|
|
/* type of BTS */
|
|
|
|
enum gsm_bts_type type;
|
2017-04-11 16:23:47 +00:00
|
|
|
enum gsm_bts_type_variant variant;
|
2011-05-25 11:10:08 +00:00
|
|
|
struct gsm_bts_model *model;
|
|
|
|
enum gsm_band band;
|
2017-03-23 11:01:07 +00:00
|
|
|
char version[MAX_VERSION_LENGTH];
|
2017-05-10 10:21:17 +00:00
|
|
|
char sub_model[MAX_VERSION_LENGTH];
|
2017-03-23 11:01:07 +00:00
|
|
|
|
2017-05-31 10:15:54 +00:00
|
|
|
/* features of a given BTS set/reported via OML */
|
|
|
|
struct bitvec features;
|
|
|
|
uint8_t _features_data[MAX_BTS_FEATURES/8];
|
|
|
|
|
2017-03-23 11:01:07 +00:00
|
|
|
/* Connected PCU version (if any) */
|
|
|
|
char pcu_version[MAX_VERSION_LENGTH];
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
/* maximum Tx power that the MS is permitted to use in this cell */
|
|
|
|
int ms_max_power;
|
|
|
|
|
|
|
|
/* how do we talk OML with this TRX? */
|
|
|
|
struct gsm_e1_subslot oml_e1_link;
|
|
|
|
uint8_t oml_tei;
|
|
|
|
struct e1inp_sign_link *oml_link;
|
|
|
|
|
|
|
|
/* Abis network management O&M handle */
|
|
|
|
struct abis_nm_h *nmh;
|
2011-05-30 10:07:53 +00:00
|
|
|
|
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
/* number of this BTS on given E1 link */
|
|
|
|
uint8_t bts_nr;
|
|
|
|
|
2016-05-11 10:45:13 +00:00
|
|
|
/* DTX features of this BTS */
|
|
|
|
enum gsm48_dtx_mode dtxu;
|
|
|
|
bool dtxd;
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
/* paging state and control */
|
|
|
|
struct gsm_bts_paging_state paging;
|
|
|
|
|
|
|
|
/* CCCH is on C0 */
|
|
|
|
struct gsm_bts_trx *c0;
|
|
|
|
|
|
|
|
struct {
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
} site_mgr;
|
|
|
|
|
|
|
|
/* bitmask of all SI that are present/valid in si_buf */
|
|
|
|
uint32_t si_valid;
|
2017-04-12 13:30:54 +00:00
|
|
|
/* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */
|
2017-05-12 15:00:30 +00:00
|
|
|
uint8_t si2q_index; /* distinguish individual SI2quater messages */
|
|
|
|
uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */
|
2011-05-25 11:10:08 +00:00
|
|
|
/* buffers where we put the pre-computed SI */
|
|
|
|
sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE];
|
2017-05-12 15:00:30 +00:00
|
|
|
/* offsets used while generating SI2quater */
|
|
|
|
size_t e_offset;
|
|
|
|
size_t u_offset;
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
/* ip.accesss Unit ID's have Site/BTS/TRX layout */
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
uint16_t site_id;
|
|
|
|
uint16_t bts_id;
|
|
|
|
uint32_t flags;
|
2013-03-12 12:57:05 +00:00
|
|
|
uint32_t rsl_ip;
|
2011-05-25 11:10:08 +00:00
|
|
|
} ip_access;
|
|
|
|
struct {
|
|
|
|
struct {
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
} cclk;
|
|
|
|
struct {
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
} rack;
|
|
|
|
struct gsm_envabtse envabtse[4];
|
|
|
|
} bs11;
|
|
|
|
struct {
|
|
|
|
struct {
|
2016-07-09 20:20:57 +00:00
|
|
|
struct om2k_mo om2k_mo;
|
|
|
|
struct gsm_abis_mo mo;
|
|
|
|
struct llist_head conn_groups;
|
|
|
|
} cf;
|
|
|
|
struct {
|
|
|
|
struct om2k_mo om2k_mo;
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
struct llist_head conn_groups;
|
|
|
|
} is;
|
|
|
|
struct {
|
2016-07-09 20:20:57 +00:00
|
|
|
struct om2k_mo om2k_mo;
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
struct llist_head conn_groups;
|
|
|
|
} con;
|
|
|
|
struct {
|
2016-07-09 20:20:57 +00:00
|
|
|
struct om2k_mo om2k_mo;
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
} dp;
|
|
|
|
struct {
|
2016-07-09 20:20:57 +00:00
|
|
|
struct om2k_mo om2k_mo;
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
} tf;
|
2016-11-15 21:59:24 +00:00
|
|
|
uint32_t use_superchannel:1;
|
2011-05-25 11:10:08 +00:00
|
|
|
} rbs2000;
|
2011-07-27 22:22:17 +00:00
|
|
|
struct {
|
|
|
|
uint8_t bts_type;
|
2012-03-02 13:14:33 +00:00
|
|
|
unsigned int configured:1,
|
|
|
|
skip_reset:1,
|
2013-12-05 12:25:06 +00:00
|
|
|
no_loc_rel_cnf:1,
|
2015-02-07 12:27:36 +00:00
|
|
|
bts_reset_timer_cnf,
|
2012-03-02 13:14:33 +00:00
|
|
|
did_reset:1,
|
|
|
|
wait_reset:1;
|
2011-07-27 22:22:17 +00:00
|
|
|
struct osmo_timer_list reset_timer;
|
|
|
|
} nokia;
|
2011-05-25 11:10:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Not entirely sure how ip.access specific this is */
|
|
|
|
struct {
|
2016-07-21 05:44:34 +00:00
|
|
|
uint8_t supports_egprs_11bit_rach;
|
2011-05-25 11:10:08 +00:00
|
|
|
enum bts_gprs_mode mode;
|
|
|
|
struct {
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
uint16_t nsei;
|
|
|
|
uint8_t timer[7];
|
|
|
|
} nse;
|
|
|
|
struct {
|
2011-05-30 10:07:53 +00:00
|
|
|
struct gsm_abis_mo mo;
|
2011-05-25 11:10:08 +00:00
|
|
|
uint16_t bvci;
|
|
|
|
uint8_t timer[11];
|
2012-06-28 06:43:14 +00:00
|
|
|
struct gprs_rlc_cfg rlc_cfg;
|
2011-05-25 11:10:08 +00:00
|
|
|
} cell;
|
|
|
|
struct gsm_bts_gprs_nsvc nsvc[2];
|
|
|
|
uint8_t rac;
|
2013-03-16 15:31:26 +00:00
|
|
|
uint8_t net_ctrl_ord;
|
2016-07-28 09:55:37 +00:00
|
|
|
bool ctrl_ack_type_use_block;
|
2011-05-25 11:10:08 +00:00
|
|
|
} gprs;
|
|
|
|
|
|
|
|
/* RACH NM values */
|
|
|
|
int rach_b_thresh;
|
|
|
|
int rach_ldavg_slots;
|
|
|
|
|
|
|
|
/* transceivers */
|
|
|
|
int num_trx;
|
|
|
|
struct llist_head trx_list;
|
|
|
|
|
2014-11-21 09:00:39 +00:00
|
|
|
/* SI related items */
|
2014-01-16 10:02:14 +00:00
|
|
|
int force_combined_si;
|
2014-11-21 09:00:39 +00:00
|
|
|
int bcch_change_mark;
|
2014-01-16 10:02:14 +00:00
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
#ifdef ROLE_BSC
|
|
|
|
/* Abis NM queue */
|
|
|
|
struct llist_head abis_queue;
|
|
|
|
int abis_nm_pend;
|
|
|
|
|
|
|
|
struct gsm_network *network;
|
|
|
|
|
|
|
|
/* should the channel allocator allocate channels from high TRX to TRX0,
|
|
|
|
* rather than starting from TRX0 and go upwards? */
|
|
|
|
int chan_alloc_reverse;
|
|
|
|
|
|
|
|
enum neigh_list_manual_mode neigh_list_manual_mode;
|
|
|
|
/* parameters from which we build SYSTEM INFORMATION */
|
|
|
|
struct {
|
|
|
|
struct gsm48_rach_control rach_control;
|
|
|
|
uint8_t ncc_permitted;
|
|
|
|
struct gsm48_cell_sel_par cell_sel_par;
|
|
|
|
struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */
|
|
|
|
struct gsm48_cell_options cell_options;
|
|
|
|
struct gsm48_control_channel_descr chan_desc;
|
|
|
|
struct bitvec neigh_list;
|
|
|
|
struct bitvec cell_alloc;
|
|
|
|
struct bitvec si5_neigh_list;
|
2016-04-15 14:04:46 +00:00
|
|
|
struct osmo_earfcn_si2q si2quater_neigh_list;
|
2016-04-20 13:57:13 +00:00
|
|
|
size_t uarfcn_length; /* index for uarfcn and scramble lists */
|
2011-05-25 11:10:08 +00:00
|
|
|
struct {
|
|
|
|
/* bitmask large enough for all possible ARFCN's */
|
|
|
|
uint8_t neigh_list[1024/8];
|
|
|
|
uint8_t cell_alloc[1024/8];
|
|
|
|
/* If the user wants a different neighbor list in SI5 than in SI2 */
|
|
|
|
uint8_t si5_neigh_list[1024/8];
|
2016-04-15 14:04:46 +00:00
|
|
|
uint8_t meas_bw_list[MAX_EARFCN_LIST];
|
|
|
|
uint16_t earfcn_list[MAX_EARFCN_LIST];
|
2016-04-20 13:57:13 +00:00
|
|
|
uint16_t uarfcn_list[MAX_EARFCN_LIST];
|
|
|
|
uint16_t scramble_list[MAX_EARFCN_LIST];
|
2011-05-25 11:10:08 +00:00
|
|
|
} data;
|
|
|
|
} si_common;
|
2017-01-12 23:10:32 +00:00
|
|
|
bool early_classmark_allowed;
|
2011-05-25 11:10:08 +00:00
|
|
|
|
|
|
|
/* do we use static (user-defined) system information messages? (bitmask) */
|
|
|
|
uint32_t si_mode_static;
|
2012-07-20 08:27:31 +00:00
|
|
|
|
|
|
|
/* exclude the BTS from the global RF Lock handling */
|
|
|
|
int excl_from_rf_lock;
|
2013-12-07 17:32:28 +00:00
|
|
|
|
|
|
|
/* supported codecs beside FR */
|
|
|
|
struct bts_codec_conf codec;
|
2014-12-17 13:46:17 +00:00
|
|
|
|
|
|
|
/* BTS dependencies bit field */
|
|
|
|
uint32_t depends_on[256/(8*4)];
|
2014-01-19 10:47:44 +00:00
|
|
|
|
|
|
|
/* full and half rate multirate config */
|
|
|
|
struct amr_multirate_conf mr_full;
|
|
|
|
struct amr_multirate_conf mr_half;
|
|
|
|
|
2016-10-26 13:19:41 +00:00
|
|
|
/* PCU socket state */
|
2017-05-29 11:42:19 +00:00
|
|
|
char *pcu_sock_path;
|
2016-10-26 13:19:41 +00:00
|
|
|
struct pcu_sock_state *pcu_state;
|
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
#endif /* ROLE_BSC */
|
2011-06-06 16:31:20 +00:00
|
|
|
void *role;
|
2011-05-25 11:10:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-06-05 11:31:33 +00:00
|
|
|
struct gsm_bts *gsm_bts_alloc(void *talloc_ctx);
|
2014-08-24 07:50:10 +00:00
|
|
|
struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num);
|
2011-05-25 11:10:08 +00:00
|
|
|
|
2014-08-24 07:50:10 +00:00
|
|
|
struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
|
2011-09-19 12:21:51 +00:00
|
|
|
struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num);
|
2011-05-25 11:10:08 +00:00
|
|
|
|
2017-04-10 11:59:14 +00:00
|
|
|
enum gsm_bts_type str2btstype(const char *arg);
|
|
|
|
const char *btstype2str(enum gsm_bts_type type);
|
|
|
|
|
|
|
|
enum bts_attribute str2btsattr(const char *s);
|
|
|
|
const char *btsatttr2str(enum bts_attribute v);
|
|
|
|
|
|
|
|
enum gsm_bts_type_variant str2btsvariant(const char *arg);
|
|
|
|
const char *btsvariant2str(enum gsm_bts_type_variant v);
|
2012-08-17 10:42:06 +00:00
|
|
|
|
2017-02-24 14:18:08 +00:00
|
|
|
extern const struct value_string gsm_chreq_descs[];
|
2016-07-23 14:14:06 +00:00
|
|
|
const struct value_string gsm_pchant_names[13];
|
|
|
|
const struct value_string gsm_pchant_descs[13];
|
2011-05-25 11:10:08 +00:00
|
|
|
const char *gsm_pchan_name(enum gsm_phys_chan_config c);
|
|
|
|
enum gsm_phys_chan_config gsm_pchan_parse(const char *name);
|
|
|
|
const char *gsm_lchant_name(enum gsm_chan_t c);
|
|
|
|
const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
|
2011-09-19 12:21:51 +00:00
|
|
|
char *gsm_trx_name(const struct gsm_bts_trx *trx);
|
|
|
|
char *gsm_ts_name(const struct gsm_bts_trx_ts *ts);
|
2016-07-16 21:59:32 +00:00
|
|
|
char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts);
|
2015-12-05 15:19:21 +00:00
|
|
|
char *gsm_lchan_name_compute(const struct gsm_lchan *lchan);
|
2011-05-25 11:10:08 +00:00
|
|
|
const char *gsm_lchans_name(enum gsm_lchan_state s);
|
|
|
|
|
2015-12-05 15:19:21 +00:00
|
|
|
static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)
|
|
|
|
{
|
|
|
|
return lchan->name;
|
|
|
|
}
|
2011-05-25 11:10:08 +00:00
|
|
|
|
2017-05-31 10:15:54 +00:00
|
|
|
static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat)
|
|
|
|
{
|
|
|
|
OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
|
|
|
|
return bitvec_set_bit_pos(&bts->features, feat, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat)
|
|
|
|
{
|
|
|
|
OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
|
|
|
|
return bitvec_get_bit_pos(&bts->features, feat);
|
|
|
|
}
|
|
|
|
|
2011-06-29 14:49:03 +00:00
|
|
|
void gsm_abis_mo_reset(struct gsm_abis_mo *mo);
|
|
|
|
|
2011-06-06 16:31:20 +00:00
|
|
|
struct gsm_abis_mo *
|
|
|
|
gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class,
|
2011-09-19 12:21:51 +00:00
|
|
|
const struct abis_om_obj_inst *obj_inst);
|
2011-06-06 16:31:20 +00:00
|
|
|
|
|
|
|
struct gsm_nm_state *
|
|
|
|
gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class,
|
2011-09-19 12:21:51 +00:00
|
|
|
const struct abis_om_obj_inst *obj_inst);
|
2011-06-06 16:31:20 +00:00
|
|
|
void *
|
|
|
|
gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class,
|
2011-09-19 12:21:51 +00:00
|
|
|
const struct abis_om_obj_inst *obj_inst);
|
2011-06-06 16:31:20 +00:00
|
|
|
|
2011-06-29 14:49:03 +00:00
|
|
|
/* reset the state of all MO in the BTS */
|
|
|
|
void gsm_bts_mo_reset(struct gsm_bts *bts);
|
|
|
|
|
2016-07-18 21:43:44 +00:00
|
|
|
uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan,
|
|
|
|
uint8_t ts_nr, uint8_t lchan_nr);
|
2011-06-25 08:02:33 +00:00
|
|
|
uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan);
|
2016-07-18 21:43:44 +00:00
|
|
|
uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan,
|
|
|
|
enum gsm_phys_chan_config as_pchan);
|
2011-06-25 08:02:33 +00:00
|
|
|
|
2014-12-29 16:47:08 +00:00
|
|
|
/* return the gsm_lchan for the CBCH (if it exists at all) */
|
|
|
|
struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts);
|
|
|
|
|
2011-06-09 19:48:49 +00:00
|
|
|
/*
|
|
|
|
* help with parsing regexps
|
|
|
|
*/
|
|
|
|
int gsm_parse_reg(void *ctx, regex_t *reg, char **str,
|
|
|
|
int argc, const char **argv) __attribute__ ((warn_unused_result));
|
|
|
|
|
2014-01-19 16:18:21 +00:00
|
|
|
static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts)
|
|
|
|
{
|
|
|
|
if (ts->tsc != -1)
|
|
|
|
return ts->tsc;
|
|
|
|
else
|
2015-11-20 09:43:31 +00:00
|
|
|
return ts->trx->bts->bsic & 7;
|
2014-01-19 16:18:21 +00:00
|
|
|
}
|
2011-06-09 19:48:49 +00:00
|
|
|
|
2016-07-23 15:38:22 +00:00
|
|
|
struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
|
|
|
|
int *rc);
|
2011-06-09 19:48:49 +00:00
|
|
|
|
2016-10-16 23:03:53 +00:00
|
|
|
enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts);
|
2016-07-29 16:12:06 +00:00
|
|
|
uint8_t ts_subslots(struct gsm_bts_trx_ts *ts);
|
2016-09-25 13:07:01 +00:00
|
|
|
bool ts_is_tch(struct gsm_bts_trx_ts *ts);
|
2016-07-29 16:12:06 +00:00
|
|
|
|
2011-05-25 11:10:08 +00:00
|
|
|
#endif
|