aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs/trx_vty.h
blob: 0d5b455c17dbf38cbb534f09e1332915b701ec9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once

#include <osmocom/vty/command.h>

#include "config_defs.h"

extern struct vty_app_info g_vty_info;

#define TRX_CHAN_MAX 8

/* Samples-per-symbol for downlink path
 *     4 - Uses precision modulator (more computation, less distortion)
 *     1 - Uses minimized modulator (less computation, more distortion)
 *
 *     Other values are invalid. Receive path (uplink) is always
 *     downsampled to 1 sps. Default to 4 sps for all cases.
 */
#define DEFAULT_TX_SPS		4

/*
 * Samples-per-symbol for uplink (receiver) path
 *     Do not modify this value. EDGE configures 4 sps automatically on
 *     B200/B210 devices only. Use of 4 sps on the receive path for other
 *     configurations is not supported.
 */
#define DEFAULT_RX_SPS		1

/* Default configuration parameters */
#define DEFAULT_TRX_PORT	5700
#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;
		bool rtsc_set;
		unsigned int rach_delay;
		bool rach_delay_set;
		enum ReferenceType clock_ref;
		enum FillerType filler;
		bool multi_arfcn;
		double offset;
		int freq_offset;
		double rssi_offset;
		bool swap_channels;
		bool egprs;
		unsigned int sched_rr;
		unsigned int num_chans;
		struct trx_chan chans[TRX_CHAN_MAX];
	} cfg;
};

int trx_vty_init(struct trx_ctx* trx);
struct trx_ctx *vty_trx_ctx_alloc(void *talloc_ctx);