blob: 3609f79dda3495453dabd92a5a6f0d45cf00f0ec [file] [log] [blame]
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +04001#ifndef _PCUIF_PROTO_H
2#define _PCUIF_PROTO_H
3
4/* msg_type */
5#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */
6#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */
7#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send data to given chan. */
8#define PCU_IF_MSG_RACH_IND 0x22 /* receive rach */
9#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */
10#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */
11#define PCU_IF_MSG_TIME_IND 0x52 /* gsm time indication */
12
13/* sapi */
14#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */
15#define PCU_IF_SAPI_AGCH 0x02 /* assignment on CCCH */
16#define PCU_IF_SAPI_PCH 0x03 /* paging request on CCCH */
17#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */
18#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */
19#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */
20#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */
21
22/* flags */
23#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */
24#define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */
25#define PCU_IF_FLAG_CS1 (1 << 16)
26#define PCU_IF_FLAG_CS2 (1 << 17)
27#define PCU_IF_FLAG_CS3 (1 << 18)
28#define PCU_IF_FLAG_CS4 (1 << 19)
29#define PCU_IF_FLAG_MCS1 (1 << 20)
30#define PCU_IF_FLAG_MCS2 (1 << 21)
31#define PCU_IF_FLAG_MCS3 (1 << 22)
32#define PCU_IF_FLAG_MCS4 (1 << 23)
33#define PCU_IF_FLAG_MCS5 (1 << 24)
34#define PCU_IF_FLAG_MCS6 (1 << 25)
35#define PCU_IF_FLAG_MCS7 (1 << 26)
36#define PCU_IF_FLAG_MCS8 (1 << 27)
37#define PCU_IF_FLAG_MCS9 (1 << 28)
38
39struct gsm_pcu_if_data {
40 uint8_t sapi;
41 uint8_t len;
42 uint8_t data[162];
43 uint32_t fn;
44 uint16_t arfcn;
45 uint8_t trx_nr;
46 uint8_t ts_nr;
47 uint8_t block_nr;
48} __attribute__ ((packed));
49
50struct gsm_pcu_if_rts_req {
51 uint8_t sapi;
52 uint8_t spare[3];
53 uint32_t fn;
54 uint16_t arfcn;
55 uint8_t trx_nr;
56 uint8_t ts_nr;
57 uint8_t block_nr;
58} __attribute__ ((packed));
59
60struct gsm_pcu_if_rach_ind {
61 uint8_t sapi;
62 uint8_t ra;
63 int16_t qta;
64 uint32_t fn;
65 uint16_t arfcn;
66} __attribute__ ((packed));
67
68struct gsm_pcu_if_info_trx {
69 uint16_t arfcn;
70 uint8_t pdch_mask; /* PDCH channels per TS */
71 uint8_t spare;
72 uint8_t tsc[8]; /* TSC per channel */
73} __attribute__ ((packed));
74
75struct gsm_pcu_if_info_ind {
76 uint32_t flags;
77 struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */
78 /* RAI */
79 uint16_t mcc, mnc, lac, rac;
80 /* NSE */
81 uint16_t nsei;
82 uint8_t nse_timer[7];
83 uint8_t cell_timer[11];
84 /* cell */
85 uint16_t cell_id;
86 uint16_t repeat_time;
87 uint8_t repeat_count;
88 uint16_t bvci;
89 uint8_t t3142;
90 uint8_t t3169;
91 uint8_t t3191;
92 uint8_t t3193_10ms;
93 uint8_t t3195;
94 uint8_t n3101;
95 uint8_t n3103;
96 uint8_t n3105;
97 uint8_t cv_countdown;
98 uint16_t dl_tbf_ext;
99 uint16_t ul_tbf_ext;
100 uint8_t initial_cs;
101 uint8_t initial_mcs;
102 /* NSVC */
103 uint16_t nsvci[2];
104 uint16_t local_port[2];
105 uint16_t remote_port[2];
106 uint32_t remote_ip[2];
107} __attribute__ ((packed));
108
109struct gsm_pcu_if_act_req {
110 uint8_t activate;
111 uint8_t trx_nr;
112 uint8_t ts_nr;
113 uint8_t spare;
114} __attribute__ ((packed));
115
116struct gsm_pcu_if_time_ind {
117 uint32_t fn;
118} __attribute__ ((packed));
119
120struct gsm_pcu_if {
121 /* context based information */
122 uint8_t msg_type; /* message type */
123 uint8_t bts_nr; /* bts number */
124 uint8_t spare[2];
125
126 union {
127 struct gsm_pcu_if_data data_req;
128 struct gsm_pcu_if_data data_ind;
129 struct gsm_pcu_if_rts_req rts_req;
130 struct gsm_pcu_if_rach_ind rach_ind;
131 struct gsm_pcu_if_info_ind info_ind;
132 struct gsm_pcu_if_act_req act_req;
133 struct gsm_pcu_if_time_ind time_ind;
134 } u;
135} __attribute__ ((packed));
136
137#endif /* _PCUIF_PROTO_H */