diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-07-03 17:27:01 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2020-07-14 09:44:06 +0000 |
commit | 122ff83dd06e0a839dccc6d7a25ff87e69875784 (patch) | |
tree | e2b1df943e23ea8c96169c82a7554e9c34901ad8 /include | |
parent | d5107c05836f3517958dd76abfa51cfc39a93f49 (diff) |
Move struct gsm_bts_trx: gsm_data.* & bts.* => bts_trx.*
Move all struct gsm_bts_trx references from bulky gsm_data to its own
file containing all related definitions and implementations. Also move a
few functions clearly related to that object which were placed in bts.*
Change-Id: Iebaf5b221c48b571f45408af867ce6f9c0cd9f4a
Diffstat (limited to 'include')
-rw-r--r-- | include/osmo-bts/Makefile.am | 1 | ||||
-rw-r--r-- | include/osmo-bts/bts.h | 10 | ||||
-rw-r--r-- | include/osmo-bts/bts_trx.h | 65 | ||||
-rw-r--r-- | include/osmo-bts/gsm_data.h | 53 | ||||
-rw-r--r-- | include/osmo-bts/phy_link.h | 3 |
5 files changed, 72 insertions, 60 deletions
diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index 310fce2a..cdbaa4f9 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -3,6 +3,7 @@ noinst_HEADERS = \ bts.h \ bts_model.h \ bts_shutdown_fsm.h \ + bts_trx.h \ gsm_data.h \ logging.h \ measurement.h \ diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index cb8787f4..da321b06 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -3,6 +3,10 @@ #include <osmocom/core/rate_ctr.h> #include <osmo-bts/gsm_data.h> +#include <osmo-bts/bts_trx.h> + + +struct gsm_bts_trx; enum bts_global_status { BTS_STATUS_RF_ACTIVE, @@ -318,12 +322,9 @@ struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); int bts_init(struct gsm_bts *bts); -int bts_trx_init(struct gsm_bts_trx *trx); void bts_shutdown(struct gsm_bts *bts, const char *reason); int bts_link_estab(struct gsm_bts *bts); -int trx_link_estab(struct gsm_bts_trx *trx); -int trx_set_available(struct gsm_bts_trx *trx, int avail); int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg); struct msgb *bts_agch_dequeue(struct gsm_bts *bts); @@ -337,11 +338,8 @@ uint8_t *lchan_sacch_get(struct gsm_lchan *lchan); int lchan_init_lapdm(struct gsm_lchan *lchan); void load_timer_start(struct gsm_bts *bts); -uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg); void bts_update_status(enum bts_global_status which, int on); -bool trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx); - struct gsm_time *get_time(struct gsm_bts *bts); int bts_main(int argc, char **argv); diff --git a/include/osmo-bts/bts_trx.h b/include/osmo-bts/bts_trx.h new file mode 100644 index 00000000..ae87528d --- /dev/null +++ b/include/osmo-bts/bts_trx.h @@ -0,0 +1,65 @@ +#pragma once + +#include <osmo-bts/gsm_data.h> + +/* 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? */ + uint8_t rsl_tei; + struct e1inp_sign_link *rsl_link; + + /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ + struct e1inp_sign_link *oml_link; + + struct gsm_abis_mo mo; + struct tlv_parsed nm_attr; + struct { + struct gsm_abis_mo mo; + } bb_transc; + + uint16_t arfcn; + int nominal_power; /* in dBm */ + unsigned int max_power_red; /* in actual dB */ + uint8_t max_power_backoff_8psk; /* in actual dB OC-2G only */ + uint8_t c0_idle_power_red; /* in actual dB OC-2G only */ + + + struct trx_power_params power_params; + bool ms_pwr_ctl_soft; /* is power control loop done by osmocom software? */ + + struct { + void *l1h; + } role_bts; + + union { + struct { + unsigned int test_state; + uint8_t test_nr; + struct rxlev_stats rxlev_stat; + } ipaccess; + }; + struct gsm_bts_trx_ts ts[TRX_NR_TS]; +}; + + +struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); +int bts_trx_init(struct gsm_bts_trx *trx); +struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); +char *gsm_trx_name(const struct gsm_bts_trx *trx); +const char *gsm_trx_unit_id(struct gsm_bts_trx *trx); + +int trx_link_estab(struct gsm_bts_trx *trx); +int trx_set_available(struct gsm_bts_trx *trx, int avail); + +uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg); +bool trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx); + +#define LOGPTRX(trx, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_trx_name(trx), ## args) diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 0bb77612..0402f117 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -43,7 +43,6 @@ #define GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT 91 #define LOGPLCHAN(lchan, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_lchan_name(lchan), ## args) -#define LOGPTRX(trx, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_trx_name(trx), ## args) struct gsm_network { struct llist_head bts_list; @@ -339,53 +338,6 @@ struct gsm_bts_trx_ts { 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? */ - uint8_t rsl_tei; - struct e1inp_sign_link *rsl_link; - - /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ - struct e1inp_sign_link *oml_link; - - struct gsm_abis_mo mo; - struct tlv_parsed nm_attr; - struct { - struct gsm_abis_mo mo; - } bb_transc; - - uint16_t arfcn; - int nominal_power; /* in dBm */ - unsigned int max_power_red; /* in actual dB */ - uint8_t max_power_backoff_8psk; /* in actual dB OC-2G only */ - uint8_t c0_idle_power_red; /* in actual dB OC-2G only */ - - - struct trx_power_params power_params; - bool ms_pwr_ctl_soft; /* is power control loop done by osmocom software? */ - - struct { - void *l1h; - } role_bts; - - union { - struct { - unsigned int test_state; - uint8_t test_nr; - struct rxlev_stats rxlev_stat; - } ipaccess; - }; - struct gsm_bts_trx_ts ts[TRX_NR_TS]; -}; - #define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0]) enum gprs_rlc_par { @@ -424,16 +376,12 @@ enum gprs_cs { * OML connection will cause a special warning to be logged. */ #define OSMO_BTS_OML_CONN_EARLY_DISCONNECT 10 /* in seconds */ -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); -struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); - extern const struct value_string gsm_pchant_names[13]; extern const struct value_string gsm_pchant_descs[13]; 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); -char *gsm_trx_name(const struct gsm_bts_trx *trx); char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); char *gsm_lchan_name_compute(const struct gsm_lchan *lchan); @@ -458,7 +406,6 @@ struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); bool ts_is_tch(struct gsm_bts_trx_ts *ts); -const char *gsm_trx_unit_id(struct gsm_bts_trx *trx); int lchan2ecu_codec(const struct gsm_lchan *lchan); diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 2a53d91f..ce4ea45f 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -5,11 +5,12 @@ #include <osmocom/core/linuxlist.h> #include <osmo-bts/scheduler.h> +#include <osmo-bts/bts_trx.h> #include <linux/if_packet.h> #include "btsconfig.h" -struct gsm_bts_trx; + struct virt_um_inst; enum phy_link_type { |