Move struct gsm_bts_trx: gsm-data.* => bts_trx.*

See rant fro similar recent commit moving stuff to bts.*.

Change-Id: I11758ca3d255d849d77bd068f24bb68bde1f89a5
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 4d2df20..c2a82ce 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -11,6 +11,7 @@
 	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 b38c11a..9b89f4f 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -13,6 +13,7 @@
 #include <osmocom/abis/e1_input.h>
 
 #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 0000000..7e64439
--- /dev/null
+++ b/include/osmocom/bsc/bts_trx.h
@@ -0,0 +1,92 @@
+#pragma once
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <stdbool.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/core/bitvec.h>
+#include <osmocom/gsm/tlv.h>
+
+#include <osmocom/abis/e1_input.h>
+
+#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 f90bfa7..e85be70 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -40,6 +40,7 @@
 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 @@
    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_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 @@
 				   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 @@
 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 @@
 
 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 @@
 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 @@
 /* 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);