blob: d3203802d6dee003cb7cc3d1b164e86510cd78eb [file] [log] [blame]
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +04001#ifndef _PCUIF_PROTO_H
2#define _PCUIF_PROTO_H
3
Maxcbf9a722016-07-28 14:54:13 +02004#define PCU_IF_VERSION 0x06
Andreas Eversberg8389fd02012-07-18 10:06:48 +02005
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +04006/* msg_type */
7#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */
Andreas Eversberga9be1542012-09-27 09:23:24 +02008#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +04009#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */
Andreas Eversberg8389fd02012-07-18 10:06:48 +020010#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */
11#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040012#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */
13#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */
Andreas Eversberg8389fd02012-07-18 10:06:48 +020014#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */
15#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040016
17/* sapi */
18#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */
Andreas Eversberg8389fd02012-07-18 10:06:48 +020019#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */
20#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040021#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;
Andreas Eversberg570b44b2013-03-16 16:15:01 +010052 int8_t rssi;
Maxcbf9a722016-07-28 14:54:13 +020053 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 */
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040056} __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 uint8_t ra;
71 int16_t qta;
72 uint32_t fn;
73 uint16_t arfcn;
74} __attribute__ ((packed));
75
76struct gsm_pcu_if_info_trx {
77 uint16_t arfcn;
78 uint8_t pdch_mask; /* PDCH channels per TS */
79 uint8_t spare;
80 uint8_t tsc[8]; /* TSC per channel */
Andreas Eversberg8389fd02012-07-18 10:06:48 +020081 uint32_t hlayer1;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040082} __attribute__ ((packed));
83
84struct gsm_pcu_if_info_ind {
Andreas Eversberg8389fd02012-07-18 10:06:48 +020085 uint32_t version;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040086 uint32_t flags;
87 struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */
Andreas Eversberg8389fd02012-07-18 10:06:48 +020088 uint8_t bsic;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040089 /* RAI */
90 uint16_t mcc, mnc, lac, rac;
91 /* NSE */
92 uint16_t nsei;
93 uint8_t nse_timer[7];
94 uint8_t cell_timer[11];
95 /* cell */
96 uint16_t cell_id;
97 uint16_t repeat_time;
98 uint8_t repeat_count;
99 uint16_t bvci;
100 uint8_t t3142;
101 uint8_t t3169;
102 uint8_t t3191;
103 uint8_t t3193_10ms;
104 uint8_t t3195;
105 uint8_t n3101;
106 uint8_t n3103;
107 uint8_t n3105;
108 uint8_t cv_countdown;
109 uint16_t dl_tbf_ext;
110 uint16_t ul_tbf_ext;
111 uint8_t initial_cs;
112 uint8_t initial_mcs;
113 /* NSVC */
114 uint16_t nsvci[2];
115 uint16_t local_port[2];
116 uint16_t remote_port[2];
117 uint32_t remote_ip[2];
118} __attribute__ ((packed));
119
120struct gsm_pcu_if_act_req {
121 uint8_t activate;
122 uint8_t trx_nr;
123 uint8_t ts_nr;
124 uint8_t spare;
125} __attribute__ ((packed));
126
127struct gsm_pcu_if_time_ind {
128 uint32_t fn;
129} __attribute__ ((packed));
130
Andreas Eversberg8389fd02012-07-18 10:06:48 +0200131struct gsm_pcu_if_pag_req {
132 uint8_t sapi;
133 uint8_t chan_needed;
134 uint8_t identity_lv[9];
135} __attribute__ ((packed));
136
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +0400137struct gsm_pcu_if {
138 /* context based information */
139 uint8_t msg_type; /* message type */
140 uint8_t bts_nr; /* bts number */
141 uint8_t spare[2];
142
143 union {
144 struct gsm_pcu_if_data data_req;
Andreas Eversberga9be1542012-09-27 09:23:24 +0200145 struct gsm_pcu_if_data data_cnf;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +0400146 struct gsm_pcu_if_data data_ind;
147 struct gsm_pcu_if_rts_req rts_req;
148 struct gsm_pcu_if_rach_ind rach_ind;
149 struct gsm_pcu_if_info_ind info_ind;
150 struct gsm_pcu_if_act_req act_req;
151 struct gsm_pcu_if_time_ind time_ind;
Andreas Eversberg8389fd02012-07-18 10:06:48 +0200152 struct gsm_pcu_if_pag_req pag_req;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +0400153 } u;
154} __attribute__ ((packed));
155
156#endif /* _PCUIF_PROTO_H */