libosmogb  1.3.1
Osmocom Gb library
gsm_04_60.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <stdint.h>
10 #include <osmocom/core/endian.h>
11 
12 #if OSMO_IS_LITTLE_ENDIAN == 1
13 /* TS 04.60 10.3a.4.1.1 */
15 #if OSMO_IS_LITTLE_ENDIAN
16  uint8_t r:1,
17  si:1,
18  cv:4,
19  tfi_hi:2;
20  uint8_t tfi_lo:3,
21  bsn1_hi:5;
22  uint8_t bsn1_lo:6,
23  bsn2_hi:2;
24  uint8_t bsn2_lo:8;
25  uint8_t cps:5,
26  rsb:1,
27  pi:1,
28  spare_hi:1;
29  uint8_t spare_lo:6,
30  dummy:2;
31 #elif OSMO_IS_BIG_ENDIAN
32 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
33  uint8_t tfi_hi:2, cv:4, si:1, r:1;
34  uint8_t bsn1_hi:5, tfi_lo:3;
35  uint8_t bsn2_hi:2, bsn1_lo:6;
36  uint8_t bsn2_lo:8;
37  uint8_t spare_hi:1, pi:1, rsb:1, cps:5;
38  uint8_t dummy:2, spare_lo:6;
39 #endif
40 } __attribute__ ((packed));
41 
42 /* TS 04.60 10.3a.4.2.1 */
44 #if OSMO_IS_LITTLE_ENDIAN
45  uint8_t r:1,
46  si:1,
47  cv:4,
48  tfi_hi:2;
49  uint8_t tfi_lo:3,
50  bsn1_hi:5;
51  uint8_t bsn1_lo:6,
52  cps_hi:2;
53  uint8_t cps_lo:1,
54  rsb:1,
55  pi:1,
56  spare_hi:5;
57  uint8_t spare_lo:5,
58  dummy:3;
59 #elif OSMO_IS_BIG_ENDIAN
60 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
61  uint8_t tfi_hi:2, cv:4, si:1, r:1;
62  uint8_t bsn1_hi:5, tfi_lo:3;
63  uint8_t cps_hi:2, bsn1_lo:6;
64  uint8_t spare_hi:5, pi:1, rsb:1, cps_lo:1;
65  uint8_t dummy:3, spare_lo:5;
66 #endif
67 } __attribute__ ((packed));
68 
69 /* TS 04.60 10.3a.4.3.1 */
71 #if OSMO_IS_LITTLE_ENDIAN
72  uint8_t r:1,
73  si:1,
74  cv:4,
75  tfi_hi:2;
76  uint8_t tfi_lo:3,
77  bsn1_hi:5;
78  uint8_t bsn1_lo:6,
79  cps_hi:2;
80  uint8_t cps_lo:2,
81  spb:2,
82  rsb:1,
83  pi:1,
84  spare:1,
85  dummy:1;
86 #elif OSMO_IS_BIG_ENDIAN
87 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
88  uint8_t tfi_hi:2, cv:4, si:1, r:1;
89  uint8_t bsn1_hi:5, tfi_lo:3;
90  uint8_t cps_hi:2, bsn1_lo:6;
91  uint8_t dummy:1, spare:1, pi:1, rsb:1, spb:2, cps_lo:2;
92 #endif
93 } __attribute__ ((packed));
94 
96 #if OSMO_IS_LITTLE_ENDIAN
97  uint8_t usf:3,
98  es_p:2,
99  rrbp:2,
100  tfi_hi:1;
101  uint8_t tfi_lo:4,
102  pr:2,
103  bsn1_hi:2;
104  uint8_t bsn1_mid:8;
105  uint8_t bsn1_lo:1,
106  bsn2_hi:7;
107  uint8_t bsn2_lo:3,
108  cps:5;
109 #elif OSMO_IS_BIG_ENDIAN
110 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
111  uint8_t tfi_hi:1, rrbp:2, es_p:2, usf:3;
112  uint8_t bsn1_hi:2, pr:2, tfi_lo:4;
113  uint8_t bsn1_mid:8;
114  uint8_t bsn2_hi:7, bsn1_lo:1;
115  uint8_t cps:5, bsn2_lo:3;
116 #endif
117 } __attribute__ ((packed));
118 
120 #if OSMO_IS_LITTLE_ENDIAN
121  uint8_t usf:3,
122  es_p:2,
123  rrbp:2,
124  tfi_hi:1;
125  uint8_t tfi_lo:4,
126  pr:2,
127  bsn1_hi:2;
128  uint8_t bsn1_mid:8;
129  uint8_t bsn1_lo:1,
130  cps:3,
131  dummy:4;
132 #elif OSMO_IS_BIG_ENDIAN
133 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
134  uint8_t tfi_hi:1, rrbp:2, es_p:2, usf:3;
135  uint8_t bsn1_hi:2, pr:2, tfi_lo:4;
136  uint8_t bsn1_mid:8;
137  uint8_t dummy:4, cps:3, bsn1_lo:1;
138 #endif
139 } __attribute__ ((packed));
140 
142 #if OSMO_IS_LITTLE_ENDIAN
143  uint8_t usf:3,
144  es_p:2,
145  rrbp:2,
146  tfi_hi:1;
147  uint8_t tfi_lo:4,
148  pr:2,
149  bsn1_hi:2;
150  uint8_t bsn1_mid:8;
151  uint8_t bsn1_lo:1,
152  cps:4,
153  spb:2,
154  dummy:1;
155 #elif OSMO_IS_BIG_ENDIAN
156 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
157  uint8_t tfi_hi:1, rrbp:2, es_p:2, usf:3;
158  uint8_t bsn1_hi:2, pr:2, tfi_lo:4;
159  uint8_t bsn1_mid:8;
160  uint8_t dummy:1, spb:2, cps:4, bsn1_lo:1;
161 #endif
162 } __attribute__ ((packed));
163 #else
164 /* TS 04.60 10.3a.4.1.1 */
166 #if OSMO_IS_LITTLE_ENDIAN
167  uint8_t tfi_hi:2,
168  cv:4,
169  si:1,
170  r:1;
171  uint8_t bsn1_hi:5,
172  tfi_lo:3;
173  uint8_t bsn2_hi:2,
174  bsn1_lo:6;
175  uint8_t bsn2_lo:8;
176  uint8_t spare_hi:1,
177  pi:1,
178  rsb:1,
179  cps:5;
180  uint8_t dummy:2,
181  spare_lo:6;
182 #elif OSMO_IS_BIG_ENDIAN
183 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
184  uint8_t r:1, si:1, cv:4, tfi_hi:2;
185  uint8_t tfi_lo:3, bsn1_hi:5;
186  uint8_t bsn1_lo:6, bsn2_hi:2;
187  uint8_t bsn2_lo:8;
188  uint8_t cps:5, rsb:1, pi:1, spare_hi:1;
189  uint8_t spare_lo:6, dummy:2;
190 #endif
191 } __attribute__ ((packed));
192 
193 /* TS 04.60 10.3a.4.2.1 */
195 #if OSMO_IS_LITTLE_ENDIAN
196  uint8_t tfi_hi:2,
197  cv:4,
198  si:1,
199  r:1;
200  uint8_t bsn1_hi:5,
201  tfi_lo:3;
202  uint8_t cps_hi:2,
203  bsn1_lo:6;
204  uint8_t spare_hi:5,
205  pi:1,
206  rsb:1,
207  cps_lo:1;
208  uint8_t dummy:3,
209  spare_lo:5;
210 #elif OSMO_IS_BIG_ENDIAN
211 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
212  uint8_t r:1, si:1, cv:4, tfi_hi:2;
213  uint8_t tfi_lo:3, bsn1_hi:5;
214  uint8_t bsn1_lo:6, cps_hi:2;
215  uint8_t cps_lo:1, rsb:1, pi:1, spare_hi:5;
216  uint8_t spare_lo:5, dummy:3;
217 #endif
218 } __attribute__ ((packed));
219 
220 /* TS 04.60 10.3a.4.3.1 */
222 #if OSMO_IS_LITTLE_ENDIAN
223  uint8_t tfi_hi:2,
224  cv:4,
225  si:1,
226  r:1;
227  uint8_t bsn1_hi:5,
228  tfi_lo:3;
229  uint8_t cps_hi:2,
230  bsn1_lo:6;
231  uint8_t dummy:1,
232  spare:1,
233  pi:1,
234  rsb:1,
235  spb:2,
236  cps_lo:2;
237 #elif OSMO_IS_BIG_ENDIAN
238 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
239  uint8_t r:1, si:1, cv:4, tfi_hi:2;
240  uint8_t tfi_lo:3, bsn1_hi:5;
241  uint8_t bsn1_lo:6, cps_hi:2;
242  uint8_t cps_lo:2, spb:2, rsb:1, pi:1, spare:1, dummy:1;
243 #endif
244 } __attribute__ ((packed));
245 
247 #if OSMO_IS_LITTLE_ENDIAN
248  uint8_t tfi_hi:1,
249  rrbp:2,
250  es_p:2,
251  usf:3;
252  uint8_t bsn1_hi:2,
253  pr:2,
254  tfi_lo:4;
255  uint8_t bsn1_mid:8;
256  uint8_t bsn2_hi:7,
257  bsn1_lo:1;
258  uint8_t cps:5,
259  bsn2_lo:3;
260 #elif OSMO_IS_BIG_ENDIAN
261 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
262  uint8_t usf:3, es_p:2, rrbp:2, tfi_hi:1;
263  uint8_t tfi_lo:4, pr:2, bsn1_hi:2;
264  uint8_t bsn1_mid:8;
265  uint8_t bsn1_lo:1, bsn2_hi:7;
266  uint8_t bsn2_lo:3, cps:5;
267 #endif
268 } __attribute__ ((packed));
269 
271 #if OSMO_IS_LITTLE_ENDIAN
272  uint8_t tfi_hi:1,
273  rrbp:2,
274  es_p:2,
275  usf:3;
276  uint8_t bsn1_hi:2,
277  pr:2,
278  tfi_lo:4;
279  uint8_t bsn1_mid:8;
280  uint8_t dummy:4,
281  cps:3,
282  bsn1_lo:1;
283 #elif OSMO_IS_BIG_ENDIAN
284 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
285  uint8_t usf:3, es_p:2, rrbp:2, tfi_hi:1;
286  uint8_t tfi_lo:4, pr:2, bsn1_hi:2;
287  uint8_t bsn1_mid:8;
288  uint8_t bsn1_lo:1, cps:3, dummy:4;
289 #endif
290 } __attribute__ ((packed));
291 
293 #if OSMO_IS_LITTLE_ENDIAN
294  uint8_t tfi_hi:1,
295  rrbp:2,
296  es_p:2,
297  usf:3;
298  uint8_t bsn1_hi:2,
299  pr:2,
300  tfi_lo:4;
301  uint8_t bsn1_mid:8;
302  uint8_t dummy:1,
303  spb:2,
304  cps:4,
305  bsn1_lo:1;
306 #elif OSMO_IS_BIG_ENDIAN
307 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
308  uint8_t usf:3, es_p:2, rrbp:2, tfi_hi:1;
309  uint8_t tfi_lo:4, pr:2, bsn1_hi:2;
310  uint8_t bsn1_mid:8;
311  uint8_t bsn1_lo:1, cps:4, spb:2, dummy:1;
312 #endif
313 } __attribute__ ((packed));
314 #endif
315 
316 /* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */
318  GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */
319  GPRS_NMO_II = 1, /* all paging on CCCH */
320  GPRS_NMO_III = 2, /* no paging coordination */
321 };
322 
323 /* TS 04.60 12.24 */
325  enum osmo_gprs_nmo nmo;
326  /* T3168: wait for packet uplink assignment message */
327  uint32_t t3168; /* in milliseconds */
328  /* T3192: wait for release of the TBF after reception of the final block */
329  uint32_t t3192; /* in milliseconds */
330  uint32_t drx_timer_max;/* in seconds */
331  uint32_t bs_cv_max;
333  bool ctrl_ack_type_use_block; /* use PACKET CONTROL ACKNOWLEDGMENT */
334 
336  struct {
339  uint8_t bep_period;
340  uint8_t pfc_supported;
341  uint8_t dtm_supported;
343  } ext_info;
344 };
345 
346 /* TS 04.60 Table 12.9.2 */
348  uint8_t alpha;
349  uint8_t t_avg_w;
350  uint8_t t_avg_t;
351  uint8_t pc_meas_chan;
352  uint8_t n_avg_i;
353 };
Definition: gsm_04_60.h:221
Definition: gsm_04_60.h:324
uint8_t use_egprs_p_ch_req
Definition: gsm_04_60.h:338
uint8_t bep_period
Definition: gsm_04_60.h:339
enum osmo_gprs_nmo __attribute__
Definition: gsm_04_60.h:194
Definition: gsm_04_60.h:165
osmo_gprs_nmo
Definition: gsm_04_60.h:317
uint8_t ext_info_present
Definition: gsm_04_60.h:335
Definition: gsm_04_60.h:319
uint32_t t3168
Definition: gsm_04_60.h:327
uint8_t pc_meas_chan
Definition: gsm_04_60.h:351
uint8_t bss_paging_coordination
Definition: gsm_04_60.h:342
uint32_t bs_cv_max
Definition: gsm_04_60.h:331
Definition: gsm_04_60.h:246
Definition: gsm_04_60.h:292
uint8_t supports_egprs_11bit_rach
Definition: gsm_04_60.h:332
uint8_t n_avg_i
Definition: gsm_04_60.h:352
Definition: gsm_04_60.h:270
uint8_t dtm_supported
Definition: gsm_04_60.h:341
Definition: gsm_04_60.h:347
uint8_t egprs_supported
Definition: gsm_04_60.h:337
uint8_t pfc_supported
Definition: gsm_04_60.h:340
uint32_t t3192
Definition: gsm_04_60.h:329
uint32_t drx_timer_max
Definition: gsm_04_60.h:330
uint8_t alpha
Definition: gsm_04_60.h:348
uint8_t t_avg_w
Definition: gsm_04_60.h:349
bool ctrl_ack_type_use_block
Definition: gsm_04_60.h:333
uint8_t t_avg_t
Definition: gsm_04_60.h:350
Definition: gsm_04_60.h:318
Definition: gsm_04_60.h:320