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>
|
|
|
|
|
|
|
|
#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
|
|
|
|
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
|
|
|
|
|
2012-07-08 18:50:02 +00:00
|
|
|
struct pcu_sock_state;
|
|
|
|
|
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;
|
2012-07-08 18:50:02 +00:00
|
|
|
uint16_t mcc, mnc;
|
|
|
|
struct pcu_sock_state *pcu_state;
|
2011-06-27 09:25:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* data structure for BTS related data specific to the BTS role */
|
|
|
|
struct gsm_bts_role_bts {
|
|
|
|
struct {
|
|
|
|
/* Interference Boundaries for OML */
|
|
|
|
int16_t boundary[6];
|
|
|
|
uint8_t intave;
|
|
|
|
} interference;
|
|
|
|
unsigned int t200_ms[7];
|
|
|
|
unsigned int t3105_ms;
|
|
|
|
struct {
|
|
|
|
uint8_t overload_period;
|
|
|
|
struct {
|
|
|
|
/* Input parameters from OML */
|
|
|
|
uint8_t load_ind_thresh; /* percent */
|
|
|
|
uint8_t load_ind_period; /* seconds */
|
|
|
|
/* Internal data */
|
|
|
|
struct osmo_timer_list timer;
|
|
|
|
unsigned int pch_total;
|
|
|
|
unsigned int pch_used;
|
|
|
|
} ccch;
|
|
|
|
struct {
|
|
|
|
/* Input parameters from OML */
|
|
|
|
int16_t busy_thresh; /* in dBm */
|
|
|
|
uint16_t averaging_slots;
|
2012-06-15 03:07:03 +00:00
|
|
|
/* Internal data */
|
|
|
|
unsigned int total; /* total nr */
|
|
|
|
unsigned int busy; /* above busy_thresh */
|
|
|
|
unsigned int access; /* access bursts */
|
2011-06-27 09:25:35 +00:00
|
|
|
} rach;
|
|
|
|
} load;
|
|
|
|
uint8_t ny1;
|
|
|
|
uint8_t max_ta;
|
2014-02-20 12:10:01 +00:00
|
|
|
|
|
|
|
/* AGCH queuing */
|
2011-06-27 09:25:35 +00:00
|
|
|
struct llist_head agch_queue;
|
2014-02-21 14:09:14 +00:00
|
|
|
int agch_queue_length;
|
2014-02-14 15:42:49 +00:00
|
|
|
int agch_max_queue_length;
|
2014-02-20 12:10:01 +00:00
|
|
|
|
2014-02-14 20:15:31 +00:00
|
|
|
int agch_queue_thresh_level; /* Cleanup threshold in percent of max len */
|
|
|
|
int agch_queue_low_level; /* Low water mark in percent of max len */
|
|
|
|
int agch_queue_high_level; /* High water mark in percent of max len */
|
|
|
|
|
2014-02-20 12:10:01 +00:00
|
|
|
/* TODO: Use a rate counter group instead */
|
|
|
|
uint64_t agch_queue_dropped_msgs;
|
|
|
|
uint64_t agch_queue_merged_msgs;
|
|
|
|
uint64_t agch_queue_rejected_msgs;
|
|
|
|
uint64_t agch_queue_agch_msgs;
|
|
|
|
uint64_t agch_queue_pch_msgs;
|
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
struct paging_state *paging_state;
|
2011-09-04 20:42:03 +00:00
|
|
|
char *bsc_oml_host;
|
2011-09-08 13:18:43 +00:00
|
|
|
unsigned int rtp_jitter_buf_ms;
|
2011-11-24 16:46:22 +00:00
|
|
|
struct {
|
2012-12-26 17:55:54 +00:00
|
|
|
uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
|
2011-11-24 16:46:22 +00:00
|
|
|
} support;
|
2012-06-03 05:25:46 +00:00
|
|
|
struct {
|
|
|
|
uint8_t tc4_ctr;
|
|
|
|
} si;
|
2013-02-05 08:06:49 +00:00
|
|
|
uint8_t radio_link_timeout;
|
2013-06-20 15:18:38 +00:00
|
|
|
|
|
|
|
/* used by the sysmoBTS to adjust band */
|
|
|
|
uint8_t auto_band;
|
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,
|
|
|
|
LCHAN_CIPH_TXRX_REQ,
|
|
|
|
LCHAN_CIPH_TXRX_CONF,
|
|
|
|
};
|
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
#define bts_role_bts(x) ((struct gsm_bts_role_bts *)(x)->role)
|
|
|
|
|
2012-12-19 22:53:34 +00:00
|
|
|
#include "openbsc/gsm_data_shared.h"
|
2011-06-27 09:25:35 +00:00
|
|
|
|
|
|
|
struct femtol1_hdl;
|
|
|
|
|
|
|
|
static inline struct femtol1_hdl *trx_femtol1_hdl(struct gsm_bts_trx *trx)
|
|
|
|
{
|
|
|
|
return trx->role_bts.l1h;
|
|
|
|
}
|
|
|
|
|
2012-04-16 18:07:56 +00:00
|
|
|
|
|
|
|
void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state);
|
|
|
|
|
2012-12-26 17:55:54 +00:00
|
|
|
/* cipher code */
|
|
|
|
#define CIPHER_A5(x) (1 << (x-1))
|
|
|
|
|
|
|
|
int bts_supports_cipher(struct gsm_bts_role_bts *bts, int rsl_cipher);
|
|
|
|
|
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
#endif /* _GSM_DATA_H */
|