blob: 9d740ac17b8677a393249b5325457e626ff49845 [file] [log] [blame]
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +04001#ifndef _PCUIF_PROTO_H
2#define _PCUIF_PROTO_H
3
Andreas Eversberg570b44b2013-03-16 16:15:01 +01004#define PCU_IF_VERSION 0x05
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;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040053} __attribute__ ((packed));
54
55struct gsm_pcu_if_rts_req {
56 uint8_t sapi;
57 uint8_t spare[3];
58 uint32_t fn;
59 uint16_t arfcn;
60 uint8_t trx_nr;
61 uint8_t ts_nr;
62 uint8_t block_nr;
63} __attribute__ ((packed));
64
65struct gsm_pcu_if_rach_ind {
66 uint8_t sapi;
67 uint8_t ra;
68 int16_t qta;
69 uint32_t fn;
70 uint16_t arfcn;
71} __attribute__ ((packed));
72
73struct gsm_pcu_if_info_trx {
74 uint16_t arfcn;
75 uint8_t pdch_mask; /* PDCH channels per TS */
76 uint8_t spare;
77 uint8_t tsc[8]; /* TSC per channel */
Andreas Eversberg8389fd02012-07-18 10:06:48 +020078 uint32_t hlayer1;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040079} __attribute__ ((packed));
80
81struct gsm_pcu_if_info_ind {
Andreas Eversberg8389fd02012-07-18 10:06:48 +020082 uint32_t version;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040083 uint32_t flags;
84 struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */
Andreas Eversberg8389fd02012-07-18 10:06:48 +020085 uint8_t bsic;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040086 /* RAI */
87 uint16_t mcc, mnc, lac, rac;
88 /* NSE */
89 uint16_t nsei;
90 uint8_t nse_timer[7];
91 uint8_t cell_timer[11];
92 /* cell */
93 uint16_t cell_id;
94 uint16_t repeat_time;
95 uint8_t repeat_count;
96 uint16_t bvci;
97 uint8_t t3142;
98 uint8_t t3169;
99 uint8_t t3191;
100 uint8_t t3193_10ms;
101 uint8_t t3195;
102 uint8_t n3101;
103 uint8_t n3103;
104 uint8_t n3105;
105 uint8_t cv_countdown;
106 uint16_t dl_tbf_ext;
107 uint16_t ul_tbf_ext;
108 uint8_t initial_cs;
109 uint8_t initial_mcs;
110 /* NSVC */
111 uint16_t nsvci[2];
112 uint16_t local_port[2];
113 uint16_t remote_port[2];
114 uint32_t remote_ip[2];
115} __attribute__ ((packed));
116
117struct gsm_pcu_if_act_req {
118 uint8_t activate;
119 uint8_t trx_nr;
120 uint8_t ts_nr;
121 uint8_t spare;
122} __attribute__ ((packed));
123
124struct gsm_pcu_if_time_ind {
125 uint32_t fn;
126} __attribute__ ((packed));
127
Andreas Eversberg8389fd02012-07-18 10:06:48 +0200128struct gsm_pcu_if_pag_req {
129 uint8_t sapi;
130 uint8_t chan_needed;
131 uint8_t identity_lv[9];
132} __attribute__ ((packed));
133
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +0400134struct gsm_pcu_if {
135 /* context based information */
136 uint8_t msg_type; /* message type */
137 uint8_t bts_nr; /* bts number */
138 uint8_t spare[2];
139
140 union {
141 struct gsm_pcu_if_data data_req;
Andreas Eversberga9be1542012-09-27 09:23:24 +0200142 struct gsm_pcu_if_data data_cnf;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +0400143 struct gsm_pcu_if_data data_ind;
144 struct gsm_pcu_if_rts_req rts_req;
145 struct gsm_pcu_if_rach_ind rach_ind;
146 struct gsm_pcu_if_info_ind info_ind;
147 struct gsm_pcu_if_act_req act_req;
148 struct gsm_pcu_if_time_ind time_ind;
Andreas Eversberg8389fd02012-07-18 10:06:48 +0200149 struct gsm_pcu_if_pag_req pag_req;
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +0400150 } u;
151} __attribute__ ((packed));
152
153#endif /* _PCUIF_PROTO_H */