aboutsummaryrefslogtreecommitdiffstats
path: root/src/ericsson-rbs/er_ccu_descr.h
blob: 9fe1aab8574f2e7feab15a5d32817b3da399e211 (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
#pragma once

#include <stdint.h>
#include <stdbool.h>
#include <osmocom/abis/e1_input.h>
#include <osmocom/trau/trau_pcu_ericsson.h>

struct er_ccu_descr;
struct e1_conn_pars;
typedef void (er_ccu_empty) (struct er_ccu_descr *ccu_descr);
typedef void (er_ccu_rx) (struct er_ccu_descr *ccu_descr, const ubit_t *bits, unsigned int num_bits);

struct er_ccu_descr {

	/* E1-line and timeslot (filled in by user) */
	struct e1_conn_pars *e1_conn_pars;

	/* Callback functions (provided by user) */
	er_ccu_empty *er_ccu_empty_cb;
	er_ccu_rx *er_ccu_rx_cb;

	/* I.460 Subslot */
	struct {
		struct osmo_i460_schan_desc scd;
		struct osmo_i460_subchan *schan;
		struct osmo_fsm_inst *trau_sync_fi;
		bool ccu_connected;
	} link;

	/* TRAU Sync state */
	struct {
		uint32_t pseq_ccu; /* CCU sequence counter (remote) */
		uint32_t pseq_pcu; /* PCU sequence counter (local) */
		uint32_t last_afn_ul; /* Adjusted frame number, uplink */
		uint32_t last_afn_dl; /* Adjusted frame number, downlink */
		enum time_adj_val tav; /* Last time adjustment value */
		bool ul_frame_err; /* True when last uplink TRAU frame was bad */
		bool ccu_synced; /* True when PCU is in sync with CCU */
	} sync;

	/* PCU related context */
	struct {
		uint8_t trx_no;
		uint8_t bts_nr;
		uint8_t ts;
	} pcu;


};

struct er_trx_descr {
       struct er_ccu_descr ts_ccu_descr[8];
};