blob: 8d251eef5b78c637582bf95bc0ef60a983ebcbd0 [file] [log] [blame]
Pau Espin Pedrol5ea18172018-02-20 16:48:15 +01001#pragma once
2
3#include <osmocom/vty/command.h>
4
Pau Espin Pedrola3ab8c22018-02-21 15:41:03 +01005#include "config_defs.h"
6
Pau Espin Pedrol5ea18172018-02-20 16:48:15 +01007extern struct vty_app_info g_vty_info;
8
Pau Espin Pedrola3ab8c22018-02-21 15:41:03 +01009#define TRX_CHAN_MAX 8
10
11/* Samples-per-symbol for downlink path
12 * 4 - Uses precision modulator (more computation, less distortion)
13 * 1 - Uses minimized modulator (less computation, more distortion)
14 *
15 * Other values are invalid. Receive path (uplink) is always
16 * downsampled to 1 sps. Default to 4 sps for all cases.
17 */
18#define DEFAULT_TX_SPS 4
19
20/*
21 * Samples-per-symbol for uplink (receiver) path
22 * Do not modify this value. EDGE configures 4 sps automatically on
23 * B200/B210 devices only. Use of 4 sps on the receive path for other
24 * configurations is not supported.
25 */
26#define DEFAULT_RX_SPS 1
27
28/* Default configuration parameters */
29#define DEFAULT_TRX_PORT 5700
30#define DEFAULT_TRX_IP "127.0.0.1"
31#define DEFAULT_CHANS 1
32
33struct trx_ctx;
34
35struct trx_chan {
36 struct trx_ctx *trx; /* backpointer */
37 unsigned int idx; /* channel index */
38 char *rx_path;
39 char *tx_path;
40};
41
Pau Espin Pedrol5ea18172018-02-20 16:48:15 +010042struct trx_ctx {
43 struct {
44 char *bind_addr;
Pau Espin Pedrola3ab8c22018-02-21 15:41:03 +010045 char *remote_addr;
46 char *dev_args;
47 unsigned int base_port;
48 unsigned int tx_sps;
49 unsigned int rx_sps;
50 unsigned int rtsc;
51 bool rtsc_set;
52 unsigned int rach_delay;
53 bool rach_delay_set;
54 enum ReferenceType clock_ref;
55 enum FillerType filler;
56 bool multi_arfcn;
57 double offset;
58 double rssi_offset;
59 bool swap_channels;
Vadim Yanitskiya8b35652018-10-22 02:52:18 +020060 bool ext_rach;
Pau Espin Pedrola3ab8c22018-02-21 15:41:03 +010061 bool egprs;
62 unsigned int sched_rr;
63 unsigned int num_chans;
64 struct trx_chan chans[TRX_CHAN_MAX];
Pau Espin Pedrol5ea18172018-02-20 16:48:15 +010065 } cfg;
66};
67
68int trx_vty_init(struct trx_ctx* trx);
Pau Espin Pedrola3ab8c22018-02-21 15:41:03 +010069struct trx_ctx *vty_trx_ctx_alloc(void *talloc_ctx);