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