blob: eb28d66bce6ef3b6a843b321c6efbe43e68b2dfa [file] [log] [blame]
Philipp Maierb4999b62016-10-26 15:19:41 +02001#ifndef _PCUIF_PROTO_H
2#define _PCUIF_PROTO_H
3
Alexander Couzensf14cb352016-12-02 18:27:01 +01004#define PCU_IF_VERSION 0x08
Philipp Maierb4999b62016-10-26 15:19:41 +02005
6/* msg_type */
7#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */
8#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */
9#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */
Philipp Maierf8aeb2c2016-12-02 19:04:34 +010010#define PCU_IF_MSG_DATA_CNF_DT 0x11 /* confirm (with direct tlli) */
Philipp Maierb4999b62016-10-26 15:19:41 +020011#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */
12#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */
13#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */
14#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */
15#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */
16#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */
17
18/* sapi */
19#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */
20#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */
21#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */
22#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */
23#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */
24#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */
25#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */
Alexander Couzensf14cb352016-12-02 18:27:01 +010026#define PCU_IF_SAPI_AGCH_DT 0x08 /* assignment on AGCH but with additional TLLI */
Philipp Maierb4999b62016-10-26 15:19:41 +020027
28/* flags */
29#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */
30#define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */
31#define PCU_IF_FLAG_CS1 (1 << 16)
32#define PCU_IF_FLAG_CS2 (1 << 17)
33#define PCU_IF_FLAG_CS3 (1 << 18)
34#define PCU_IF_FLAG_CS4 (1 << 19)
35#define PCU_IF_FLAG_MCS1 (1 << 20)
36#define PCU_IF_FLAG_MCS2 (1 << 21)
37#define PCU_IF_FLAG_MCS3 (1 << 22)
38#define PCU_IF_FLAG_MCS4 (1 << 23)
39#define PCU_IF_FLAG_MCS5 (1 << 24)
40#define PCU_IF_FLAG_MCS6 (1 << 25)
41#define PCU_IF_FLAG_MCS7 (1 << 26)
42#define PCU_IF_FLAG_MCS8 (1 << 27)
43#define PCU_IF_FLAG_MCS9 (1 << 28)
44
45struct gsm_pcu_if_data {
46 uint8_t sapi;
47 uint8_t len;
48 uint8_t data[162];
49 uint32_t fn;
50 uint16_t arfcn;
51 uint8_t trx_nr;
52 uint8_t ts_nr;
53 uint8_t block_nr;
54 int8_t rssi;
55 uint16_t ber10k; /*!< \brief BER in units of 0.01% */
56 int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */
57 int16_t lqual_cb; /* !< \brief Link quality in centiBel */
58} __attribute__ ((packed));
59
Philipp Maierf8aeb2c2016-12-02 19:04:34 +010060/* data confirmation with direct tlli (instead of raw mac block with tlli) */
61struct gsm_pcu_if_data_cnf_dt {
62 uint8_t sapi;
63 uint32_t tlli;
64 uint32_t fn;
65 uint16_t arfcn;
66 uint8_t trx_nr;
67 uint8_t ts_nr;
68 uint8_t block_nr;
69 int8_t rssi;
70 uint16_t ber10k; /*!< \brief BER in units of 0.01% */
71 int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */
72 int16_t lqual_cb; /* !< \brief Link quality in centiBel */
73} __attribute__ ((packed));
74
Philipp Maierb4999b62016-10-26 15:19:41 +020075struct gsm_pcu_if_rts_req {
76 uint8_t sapi;
77 uint8_t spare[3];
78 uint32_t fn;
79 uint16_t arfcn;
80 uint8_t trx_nr;
81 uint8_t ts_nr;
82 uint8_t block_nr;
83} __attribute__ ((packed));
84
85struct gsm_pcu_if_rach_ind {
86 uint8_t sapi;
87 uint16_t ra;
88 int16_t qta;
89 uint32_t fn;
90 uint16_t arfcn;
91 uint8_t is_11bit;
92 uint8_t burst_type;
93} __attribute__ ((packed));
94
95struct gsm_pcu_if_info_trx {
96 uint16_t arfcn;
97 uint8_t pdch_mask; /* PDCH channels per TS */
98 uint8_t spare;
99 uint8_t tsc[8]; /* TSC per channel */
100 uint32_t hlayer1;
101} __attribute__ ((packed));
102
103struct gsm_pcu_if_info_ind {
104 uint32_t version;
105 uint32_t flags;
106 struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */
107 uint8_t bsic;
108 /* RAI */
109 uint16_t mcc, mnc, lac, rac;
110 /* NSE */
111 uint16_t nsei;
112 uint8_t nse_timer[7];
113 uint8_t cell_timer[11];
114 /* cell */
115 uint16_t cell_id;
116 uint16_t repeat_time;
117 uint8_t repeat_count;
118 uint16_t bvci;
119 uint8_t t3142;
120 uint8_t t3169;
121 uint8_t t3191;
122 uint8_t t3193_10ms;
123 uint8_t t3195;
124 uint8_t n3101;
125 uint8_t n3103;
126 uint8_t n3105;
127 uint8_t cv_countdown;
128 uint16_t dl_tbf_ext;
129 uint16_t ul_tbf_ext;
130 uint8_t initial_cs;
131 uint8_t initial_mcs;
132 /* NSVC */
133 uint16_t nsvci[2];
134 uint16_t local_port[2];
135 uint16_t remote_port[2];
136 uint32_t remote_ip[2];
137} __attribute__ ((packed));
138
139struct gsm_pcu_if_act_req {
140 uint8_t activate;
141 uint8_t trx_nr;
142 uint8_t ts_nr;
143 uint8_t spare;
144} __attribute__ ((packed));
145
146struct gsm_pcu_if_time_ind {
147 uint32_t fn;
148} __attribute__ ((packed));
149
150struct gsm_pcu_if_pag_req {
151 uint8_t sapi;
152 uint8_t chan_needed;
153 uint8_t identity_lv[9];
154} __attribute__ ((packed));
155
156struct gsm_pcu_if {
157 /* context based information */
158 uint8_t msg_type; /* message type */
159 uint8_t bts_nr; /* bts number */
160 uint8_t spare[2];
161
162 union {
163 struct gsm_pcu_if_data data_req;
164 struct gsm_pcu_if_data data_cnf;
Philipp Maierf8aeb2c2016-12-02 19:04:34 +0100165 struct gsm_pcu_if_data_cnf_dt data_cnf_dt;
Philipp Maierb4999b62016-10-26 15:19:41 +0200166 struct gsm_pcu_if_data data_ind;
167 struct gsm_pcu_if_rts_req rts_req;
168 struct gsm_pcu_if_rach_ind rach_ind;
169 struct gsm_pcu_if_info_ind info_ind;
170 struct gsm_pcu_if_act_req act_req;
171 struct gsm_pcu_if_time_ind time_ind;
172 struct gsm_pcu_if_pag_req pag_req;
173 } u;
174} __attribute__ ((packed));
175
176#endif /* _PCUIF_PROTO_H */