2011-06-27 09:25:35 +00:00
|
|
|
#ifndef BTS_MODEL_H
|
|
|
|
#define BTS_MODEL_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include <osmocom/gsm/tlv.h>
|
|
|
|
#include <osmocom/gsm/gsm_utils.h>
|
|
|
|
|
|
|
|
#include <osmo-bts/gsm_data.h>
|
|
|
|
|
2016-01-09 12:13:37 +00:00
|
|
|
struct phy_link;
|
|
|
|
struct phy_instance;
|
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
/* BTS model specific functions needed by the common code */
|
|
|
|
|
|
|
|
int bts_model_init(struct gsm_bts *bts);
|
2018-11-12 11:50:23 +00:00
|
|
|
int bts_model_trx_init(struct gsm_bts_trx *trx);
|
2011-06-27 09:25:35 +00:00
|
|
|
|
|
|
|
int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type,
|
|
|
|
struct tlv_parsed *old_attr, struct tlv_parsed *new_attr,
|
|
|
|
void *obj);
|
|
|
|
|
|
|
|
int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg,
|
2014-03-26 17:00:40 +00:00
|
|
|
struct tlv_parsed *new_attr, int obj_kind, void *obj);
|
2011-06-27 09:25:35 +00:00
|
|
|
|
|
|
|
int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
|
|
|
|
void *obj);
|
|
|
|
|
|
|
|
int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo,
|
|
|
|
void *obj, uint8_t adm_state);
|
|
|
|
|
2011-06-29 18:42:14 +00:00
|
|
|
int bts_model_trx_deact_rf(struct gsm_bts_trx *trx);
|
2020-06-18 17:36:12 +00:00
|
|
|
|
|
|
|
/* Implementation should call bts_model_trx_close_cb when done */
|
|
|
|
void bts_model_trx_close(struct gsm_bts_trx *trx);
|
2011-06-29 18:42:14 +00:00
|
|
|
|
2020-10-31 22:44:23 +00:00
|
|
|
int bts_model_vty_init(void *ctx);
|
2011-09-19 18:46:51 +00:00
|
|
|
|
2020-09-25 02:53:59 +00:00
|
|
|
void bts_model_config_write_bts(struct vty *vty, const struct gsm_bts *bts);
|
|
|
|
void bts_model_config_write_trx(struct vty *vty, const struct gsm_bts_trx *trx);
|
|
|
|
void bts_model_config_write_phy(struct vty *vty, const struct phy_link *plink);
|
|
|
|
void bts_model_config_write_phy_inst(struct vty *vty, const struct phy_instance *pinst);
|
2011-10-12 11:36:22 +00:00
|
|
|
|
2013-06-30 19:19:27 +00:00
|
|
|
int bts_model_oml_estab(struct gsm_bts *bts);
|
|
|
|
|
2020-06-25 11:52:44 +00:00
|
|
|
/* Implementation should call power_trx_change_compl() to confirm power change applied */
|
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
|
|
|
int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm);
|
2014-12-06 19:30:52 +00:00
|
|
|
int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan);
|
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
|
|
|
|
2013-07-29 07:42:23 +00:00
|
|
|
int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap);
|
|
|
|
|
2016-11-11 16:44:57 +00:00
|
|
|
int bts_model_lchan_deactivate(struct gsm_lchan *lchan);
|
|
|
|
int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan);
|
|
|
|
|
2013-02-05 15:47:57 +00:00
|
|
|
void bts_model_abis_close(struct gsm_bts *bts);
|
|
|
|
|
2016-01-09 08:49:09 +00:00
|
|
|
int bts_model_ctrl_cmds_install(struct gsm_bts *bts);
|
|
|
|
|
2016-01-09 11:34:18 +00:00
|
|
|
int bts_model_handle_options(int argc, char **argv);
|
|
|
|
void bts_model_print_help();
|
|
|
|
|
2016-01-09 12:13:37 +00:00
|
|
|
void bts_model_phy_link_set_defaults(struct phy_link *plink);
|
|
|
|
void bts_model_phy_instance_set_defaults(struct phy_instance *pinst);
|
|
|
|
|
2016-06-16 15:11:27 +00:00
|
|
|
int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts);
|
2018-11-26 12:53:52 +00:00
|
|
|
void bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan);
|
2016-06-16 15:11:27 +00:00
|
|
|
|
2020-06-18 17:36:12 +00:00
|
|
|
/* BTS model specific implementations are expected to call these functions as a
|
|
|
|
* response to some of the APIs above:
|
|
|
|
*/
|
|
|
|
|
|
|
|
void bts_model_trx_close_cb(struct gsm_bts_trx *trx, int rc);
|
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
#endif
|