2011-06-27 09:25:35 +00:00
|
|
|
#ifndef _GSM_DATA_H
|
|
|
|
#define _GSM_DATA_H
|
|
|
|
|
|
|
|
#include <osmocom/core/timer.h>
|
|
|
|
#include <osmocom/core/linuxlist.h>
|
|
|
|
#include <osmocom/gsm/lapdm.h>
|
2018-02-20 23:38:05 +00:00
|
|
|
#include <osmocom/gsm/gsm23003.h>
|
2011-06-27 09:25:35 +00:00
|
|
|
|
|
|
|
#include <osmo-bts/paging.h>
|
New generic transmit power handling
In order to support transmit power reduction by thermal management
as well as the variety of new internal / external PA configurations
of BTSs, we need a slightly more complex system.
Also, as at high power a single dB can be quite a big difference,
we are now doing all computations in milli-dB(m), i.e. 1/10000 bel.
Ramping is now used both for up and down ramping, as that is useful in
cases where you want to gracefully shut down a cell by shrinking its
radius, gradually handing over subscribers to neighboring cells.
Furthermore, this code is becoming part of the 'common' codebase, as it
is not really specific to how sysmobts is working.
The user can specify a single aggregate value for external system
gain/attenuation. Let's say you have 1dB loss of antenna cable, so you
can put that as 'user-gain -1' into the config, which means that a
'transmit power of 20dBm' will be compensatet for that and the TRX is
instructed to output 21dBm to compensate the cable loss. Similarly,
external PAs can be described by a positive user-gain.
One of the next steps will be to communicate those values and the
nominal power capability of the specific BTS to the BSC, so the BSC will
automatically show correct signal levels in the VTY and log files.
The code includes provisions for future extensions regarding
* an external and an internal PA with calibration tables
* a thermal attenuation setting to be controlled by the site manager
2014-08-22 00:46:15 +00:00
|
|
|
#include <osmo-bts/tx_power.h>
|
2011-06-27 09:25:35 +00:00
|
|
|
|
2016-01-09 16:56:10 +00:00
|
|
|
#define GSM_FR_BITS 260
|
|
|
|
#define GSM_EFR_BITS 244
|
|
|
|
|
|
|
|
#define GSM_FR_BYTES 33 /* TS 101318 Chapter 5.1: 260 bits + 4bit sig */
|
|
|
|
#define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */
|
|
|
|
#define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */
|
|
|
|
|
2016-01-09 17:19:32 +00:00
|
|
|
#define GSM_SUPERFRAME (26*51) /* 1326 TDMA frames */
|
|
|
|
#define GSM_HYPERFRAME (2048*GSM_SUPERFRAME) /* GSM_HYPERFRAME frames */
|
|
|
|
|
2014-02-14 20:15:31 +00:00
|
|
|
#define GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DEFAULT 41
|
|
|
|
#define GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DISABLE 999999
|
|
|
|
#define GSM_BTS_AGCH_QUEUE_LOW_LEVEL_DEFAULT 41
|
|
|
|
#define GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT 91
|
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
struct gsm_network {
|
2011-09-04 20:42:03 +00:00
|
|
|
struct llist_head bts_list;
|
|
|
|
unsigned int num_bts;
|
2018-02-20 23:38:05 +00:00
|
|
|
struct osmo_plmn_id plmn;
|
2012-07-08 18:50:02 +00:00
|
|
|
struct pcu_sock_state *pcu_state;
|
2011-06-27 09:25:35 +00:00
|
|
|
};
|
|
|
|
|
2012-04-19 07:35:03 +00:00
|
|
|
enum lchan_ciph_state {
|
|
|
|
LCHAN_CIPH_NONE,
|
|
|
|
LCHAN_CIPH_RX_REQ,
|
|
|
|
LCHAN_CIPH_RX_CONF,
|
2013-06-16 11:26:14 +00:00
|
|
|
LCHAN_CIPH_RXTX_REQ,
|
|
|
|
LCHAN_CIPH_RX_CONF_TX_REQ,
|
|
|
|
LCHAN_CIPH_RXTX_CONF,
|
2012-04-19 07:35:03 +00:00
|
|
|
};
|
|
|
|
|
2017-10-08 15:56:33 +00:00
|
|
|
#include <osmo-bts/gsm_data_shared.h>
|
2011-06-27 09:25:35 +00:00
|
|
|
|
2012-04-16 18:07:56 +00:00
|
|
|
void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state);
|
2016-07-16 22:32:07 +00:00
|
|
|
int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts,
|
|
|
|
enum gsm_phys_chan_config pchan);
|
2012-04-16 18:07:56 +00:00
|
|
|
|
2012-12-26 17:55:54 +00:00
|
|
|
/* cipher code */
|
|
|
|
#define CIPHER_A5(x) (1 << (x-1))
|
|
|
|
|
2018-03-17 11:22:40 +00:00
|
|
|
int bts_supports_cipher(struct gsm_bts *bts, int rsl_cipher);
|
2012-12-26 17:55:54 +00:00
|
|
|
|
2016-08-09 18:15:09 +00:00
|
|
|
bool ts_is_pdch(const struct gsm_bts_trx_ts *ts);
|
2012-12-26 17:55:54 +00:00
|
|
|
|
2018-01-25 17:59:42 +00:00
|
|
|
int bts_model_check_cm_mode(enum gsm_phys_chan_config pchan, enum gsm48_chan_mode cm);
|
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
#endif /* _GSM_DATA_H */
|