aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-10-13 17:27:08 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-10-14 12:52:04 +0200
commit93fee1f163054094ec52a87db33ab31e3b5ab74e (patch)
tree2622237fe9df7dd2c49b5cff42a698d268d70a6d /CommonLibs
parente69a56cec53e69cb6a4edef6802c2161972e1a5b (diff)
Transceiver: Pass config struct instead of large list of params
Diffstat (limited to 'CommonLibs')
-rw-r--r--CommonLibs/config_defs.h37
-rw-r--r--CommonLibs/trx_vty.h34
2 files changed, 38 insertions, 33 deletions
diff --git a/CommonLibs/config_defs.h b/CommonLibs/config_defs.h
index 8626166..7d501cd 100644
--- a/CommonLibs/config_defs.h
+++ b/CommonLibs/config_defs.h
@@ -5,6 +5,8 @@
* osmo-trx (CXX, dir Transceiver52)
*/
+#include <stdbool.h>
+
enum FillerType {
FILLER_DUMMY,
FILLER_ZERO,
@@ -18,3 +20,38 @@ enum ReferenceType {
REF_EXTERNAL,
REF_GPS,
};
+
+/* Maximum number of physical RF channels */
+#define TRX_CHAN_MAX 8
+
+struct trx_ctx;
+
+struct trx_chan {
+ struct trx_ctx *trx; /* backpointer */
+ unsigned int idx; /* channel index */
+ char *rx_path;
+ char *tx_path;
+};
+
+struct trx_cfg {
+ char *bind_addr;
+ char *remote_addr;
+ char *dev_args;
+ unsigned int base_port;
+ unsigned int tx_sps;
+ unsigned int rx_sps;
+ unsigned int rtsc;
+ unsigned int rach_delay;
+ enum ReferenceType clock_ref;
+ enum FillerType filler;
+ bool multi_arfcn;
+ double offset;
+ double rssi_offset;
+ bool swap_channels;
+ bool ext_rach;
+ bool egprs;
+ unsigned int sched_rr;
+ unsigned int stack_size;
+ unsigned int num_chans;
+ struct trx_chan chans[TRX_CHAN_MAX];
+};
diff --git a/CommonLibs/trx_vty.h b/CommonLibs/trx_vty.h
index c0d54cf..a6e84e8 100644
--- a/CommonLibs/trx_vty.h
+++ b/CommonLibs/trx_vty.h
@@ -8,8 +8,6 @@ extern struct vty_app_info g_vty_info;
extern const struct value_string clock_ref_names[];
extern const struct value_string filler_names[];
-/* Maximum number of physical RF channels */
-#define TRX_CHAN_MAX 8
/* Maximum number of carriers in multi-ARFCN mode */
#define TRX_MCHAN_MAX 3
@@ -35,38 +33,8 @@ extern const struct value_string filler_names[];
#define DEFAULT_TRX_IP "127.0.0.1"
#define DEFAULT_CHANS 1
-struct trx_ctx;
-
-struct trx_chan {
- struct trx_ctx *trx; /* backpointer */
- unsigned int idx; /* channel index */
- char *rx_path;
- char *tx_path;
-};
-
struct trx_ctx {
- struct {
- char *bind_addr;
- char *remote_addr;
- char *dev_args;
- unsigned int base_port;
- unsigned int tx_sps;
- unsigned int rx_sps;
- unsigned int rtsc;
- unsigned int rach_delay;
- enum ReferenceType clock_ref;
- enum FillerType filler;
- bool multi_arfcn;
- double offset;
- double rssi_offset;
- bool swap_channels;
- bool ext_rach;
- bool egprs;
- unsigned int sched_rr;
- unsigned int stack_size;
- unsigned int num_chans;
- struct trx_chan chans[TRX_CHAN_MAX];
- } cfg;
+ struct trx_cfg cfg;
};
int trx_vty_init(struct trx_ctx* trx);