From aca53203d11adcb57c7b922e9b968388083b21b6 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 16 Jul 2020 14:49:36 +0200 Subject: Move struct gsm_bts_trx: gsm-data.* => bts_trx.* See rant fro similar recent commit moving stuff to bts.*. Change-Id: I11758ca3d255d849d77bd068f24bb68bde1f89a5 --- include/osmocom/bsc/Makefile.am | 1 + include/osmocom/bsc/bts.h | 1 + include/osmocom/bsc/bts_trx.h | 92 +++++++++++++++++++++++++++++++++++++++++ include/osmocom/bsc/gsm_data.h | 75 +-------------------------------- 4 files changed, 95 insertions(+), 74 deletions(-) create mode 100644 include/osmocom/bsc/bts_trx.h (limited to 'include/osmocom') diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 4d2df20de..c2a82ce34 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -11,6 +11,7 @@ noinst_HEADERS = \ bsc_subscr_conn_fsm.h \ bss.h \ bts.h \ + bts_trx.h \ bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ codec_pref.h \ diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index b38c11ad7..9b89f4fd1 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -13,6 +13,7 @@ #include #include "osmocom/bsc/gsm_data.h" +#include "osmocom/bsc/bts_trx.h" enum bts_counter_id { BTS_CTR_CHREQ_TOTAL, diff --git a/include/osmocom/bsc/bts_trx.h b/include/osmocom/bsc/bts_trx.h new file mode 100644 index 000000000..7e6443973 --- /dev/null +++ b/include/osmocom/bsc/bts_trx.h @@ -0,0 +1,92 @@ +#pragma once + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "osmocom/bsc/gsm_data.h" + +struct gsm_bts; + +#define TRX_NR_TS 8 + +/* 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; + + /* Timeout for initiating the RSL connection. */ + struct osmo_timer_list rsl_connect_timeout; + + /* 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 */ + + union { + struct { + struct { + struct gsm_abis_mo mo; + } bbsig; + struct { + struct gsm_abis_mo mo; + } pa; + } bs11; + struct { + unsigned int test_state; + uint8_t test_nr; + struct rxlev_stats rxlev_stat; + } ipaccess; + struct { + struct { + struct om2k_mo om2k_mo; + } trxc; + struct { + struct om2k_mo om2k_mo; + } rx; + struct { + struct om2k_mo om2k_mo; + } tx; + } rbs2000; + }; + struct gsm_bts_trx_ts ts[TRX_NR_TS]; +}; + +struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); +char *gsm_trx_name(const struct gsm_bts_trx *trx); + +struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, + int *rc); + +void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason); +bool trx_is_usable(const struct gsm_bts_trx *trx); + +void gsm_trx_all_ts_dispatch(struct gsm_bts_trx *trx, uint32_t ts_ev, void *data); +int trx_count_free_ts(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan); +bool trx_has_valid_pchan_config(const struct gsm_bts_trx *trx); diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index f90bfa7db..e85be7032 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -40,6 +40,7 @@ struct mgcp_client; struct gsm0808_cell_id; struct osmo_mgcpc_ep; struct gsm_bts; +struct gsm_bts_trx; /** annotations for msgb ownership */ #define __uses @@ -330,7 +331,6 @@ enum gsm_chreq_reason_t { use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */ #define CCCH_LCHAN 4 -#define TRX_NR_TS 8 #define TS_MAX_LCHAN 8 #define HARDCODED_ARFCN 123 @@ -713,66 +713,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? */ - struct gsm_e1_subslot rsl_e1_link; - uint8_t rsl_tei; - struct e1inp_sign_link *rsl_link; - - /* Timeout for initiating the RSL connection. */ - struct osmo_timer_list rsl_connect_timeout; - - /* 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 */ - - union { - struct { - struct { - struct gsm_abis_mo mo; - } bbsig; - struct { - struct gsm_abis_mo mo; - } pa; - } bs11; - struct { - unsigned int test_state; - uint8_t test_nr; - struct rxlev_stats rxlev_stat; - } ipaccess; - struct { - struct { - struct om2k_mo om2k_mo; - } trxc; - struct { - struct om2k_mo om2k_mo; - } rx; - struct { - struct om2k_mo om2k_mo; - } tx; - } rbs2000; - }; - struct gsm_bts_trx_ts ts[TRX_NR_TS]; -}; - #define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0]) /* @@ -962,8 +902,6 @@ struct gsm_bts *gsm_bts_by_cell_id(const struct gsm_network *net, const struct gsm0808_cell_id *cell_id, int match_idx); -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); - extern const struct value_string gsm_chreq_descs[]; extern const struct value_string gsm_pchant_names[]; extern const struct value_string gsm_pchant_descs[]; @@ -974,7 +912,6 @@ static inline const char *gsm_pchan_id(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); -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); @@ -1007,9 +944,6 @@ void gsm48_lchan2chan_desc_as_configured(struct gsm48_chan_desc *cd, const struc uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts); -struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, - int *rc); - enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); uint8_t pchan_subslots(enum gsm_phys_chan_config pchan); bool ts_is_tch(struct gsm_bts_trx_ts *ts); @@ -1255,7 +1189,6 @@ struct gsm_bts *bsc_bts_alloc_register(struct gsm_network *net, enum gsm_bts_typ void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss); -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, bool locked, const char *reason); int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx); int gsm_bts_set_system_infos(struct gsm_bts *bts); @@ -1265,17 +1198,11 @@ extern struct e1inp_line_ops bts_isdn_e1inp_line_ops; /* control interface handling */ int bsc_base_ctrl_cmds_install(void); -bool trx_is_usable(const struct gsm_bts_trx *trx); bool ts_is_usable(const struct gsm_bts_trx_ts *ts); int gsm_lchan_type_by_pchan(enum gsm_phys_chan_config pchan); enum gsm_phys_chan_config gsm_pchan_by_lchan_type(enum gsm_chan_t type); -void gsm_trx_all_ts_dispatch(struct gsm_bts_trx *trx, uint32_t ts_ev, void *data); -int trx_count_free_ts(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan); - -bool trx_has_valid_pchan_config(const struct gsm_bts_trx *trx); - enum gsm48_rr_cause bsc_gsm48_rr_cause_from_gsm0808_cause(enum gsm0808_cause c); enum gsm48_rr_cause bsc_gsm48_rr_cause_from_rsl_cause(uint8_t c); -- cgit v1.2.3