libosmogsm 1.13.1.1-afb4 Osmocom GSM library

gsm_44_060.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/* TS 44.060 10.3a.4.1.1 */
13 struct gprs_rlc_ul_header_egprs_1 {
14#if OSMO_IS_LITTLE_ENDIAN
15 uint8_t r:1,
16 si:1,
17 cv:4,
18 tfi_hi:2;
19 uint8_t tfi_lo:3,
20 bsn1_hi:5;
21 uint8_t bsn1_lo:6,
22 bsn2_hi:2;
23 uint8_t bsn2_lo:8;
24 uint8_t cps:5,
25 rsb:1,
26 pi:1,
27 spare_hi:1;
28 uint8_t spare_lo:6,
29 dummy:2;
30#elif OSMO_IS_BIG_ENDIAN
31/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
32 uint8_t tfi_hi:2, cv:4, si:1, r:1;
33 uint8_t bsn1_hi:5, tfi_lo:3;
34 uint8_t bsn2_hi:2, bsn1_lo:6;
35 uint8_t bsn2_lo:8;
36 uint8_t spare_hi:1, pi:1, rsb:1, cps:5;
37 uint8_t dummy:2, spare_lo:6;
38#endif
39} __attribute__ ((packed));
40
41/* TS 44.060 10.3a.4.2.1 */
42 struct gprs_rlc_ul_header_egprs_2 {
43#if OSMO_IS_LITTLE_ENDIAN
44 uint8_t r:1,
45 si:1,
46 cv:4,
47 tfi_hi:2;
48 uint8_t tfi_lo:3,
49 bsn1_hi:5;
50 uint8_t bsn1_lo:6,
51 cps_hi:2;
52 uint8_t cps_lo:1,
53 rsb:1,
54 pi:1,
55 spare_hi:5;
56 uint8_t spare_lo:5,
57 dummy:3;
58#elif OSMO_IS_BIG_ENDIAN
59/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
60 uint8_t tfi_hi:2, cv:4, si:1, r:1;
61 uint8_t bsn1_hi:5, tfi_lo:3;
62 uint8_t cps_hi:2, bsn1_lo:6;
63 uint8_t spare_hi:5, pi:1, rsb:1, cps_lo:1;
64 uint8_t dummy:3, spare_lo:5;
65#endif
66} __attribute__ ((packed));
67
68/* TS 44.060 10.3a.4.3.1 */
69 struct gprs_rlc_ul_header_egprs_3 {
70#if OSMO_IS_LITTLE_ENDIAN
71 uint8_t r:1,
72 si:1,
73 cv:4,
74 tfi_hi:2;
75 uint8_t tfi_lo:3,
76 bsn1_hi:5;
77 uint8_t bsn1_lo:6,
78 cps_hi:2;
79 uint8_t cps_lo:2,
80 spb:2,
81 rsb:1,
82 pi:1,
83 spare:1,
84 dummy:1;
85#elif OSMO_IS_BIG_ENDIAN
86/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
87 uint8_t tfi_hi:2, cv:4, si:1, r:1;
88 uint8_t bsn1_hi:5, tfi_lo:3;
89 uint8_t cps_hi:2, bsn1_lo:6;
90 uint8_t dummy:1, spare:1, pi:1, rsb:1, spb:2, cps_lo:2;
91#endif
92} __attribute__ ((packed));
93
94 struct gprs_rlc_dl_header_egprs_1 {
95#if OSMO_IS_LITTLE_ENDIAN
96 uint8_t usf:3,
97 es_p:2,
98 rrbp:2,
99 tfi_hi:1;
100 uint8_t tfi_lo:4,
101 pr:2,
102 bsn1_hi:2;
103 uint8_t bsn1_mid:8;
104 uint8_t bsn1_lo:1,
105 bsn2_hi:7;
106 uint8_t bsn2_lo:3,
107 cps:5;
108#elif OSMO_IS_BIG_ENDIAN
109/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
110 uint8_t tfi_hi:1, rrbp:2, es_p:2, usf:3;
111 uint8_t bsn1_hi:2, pr:2, tfi_lo:4;
112 uint8_t bsn1_mid:8;
113 uint8_t bsn2_hi:7, bsn1_lo:1;
114 uint8_t cps:5, bsn2_lo:3;
115#endif
116} __attribute__ ((packed));
117
118 struct gprs_rlc_dl_header_egprs_2 {
119#if OSMO_IS_LITTLE_ENDIAN
120 uint8_t usf:3,
121 es_p:2,
122 rrbp:2,
123 tfi_hi:1;
124 uint8_t tfi_lo:4,
125 pr:2,
126 bsn1_hi:2;
127 uint8_t bsn1_mid:8;
128 uint8_t bsn1_lo:1,
129 cps:3,
130 dummy:4;
131#elif OSMO_IS_BIG_ENDIAN
132/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
133 uint8_t tfi_hi:1, rrbp:2, es_p:2, usf:3;
134 uint8_t bsn1_hi:2, pr:2, tfi_lo:4;
135 uint8_t bsn1_mid:8;
136 uint8_t dummy:4, cps:3, bsn1_lo:1;
137#endif
138} __attribute__ ((packed));
139
140 struct gprs_rlc_dl_header_egprs_3 {
141#if OSMO_IS_LITTLE_ENDIAN
142 uint8_t usf:3,
143 es_p:2,
144 rrbp:2,
145 tfi_hi:1;
146 uint8_t tfi_lo:4,
147 pr:2,
148 bsn1_hi:2;
149 uint8_t bsn1_mid:8;
150 uint8_t bsn1_lo:1,
151 cps:4,
152 spb:2,
153 dummy:1;
154#elif OSMO_IS_BIG_ENDIAN
155/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
156 uint8_t tfi_hi:1, rrbp:2, es_p:2, usf:3;
157 uint8_t bsn1_hi:2, pr:2, tfi_lo:4;
158 uint8_t bsn1_mid:8;
159 uint8_t dummy:1, spb:2, cps:4, bsn1_lo:1;
160#endif
161} __attribute__ ((packed));
162
163/* TS 44.060 Table 12.24.2
164* Meaning of values documented in TS 23.060 Chapter 6.3.3.1: Network Mode of Operation */
165 enum osmo_gprs_nmo {
166 GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */
167 GPRS_NMO_II = 1, /* all paging on CCCH */
168 GPRS_NMO_III = 2, /* no paging coordination */
169};
170
171/* TS 44.060 12.24 */
172 struct osmo_gprs_cell_options {
173 enum osmo_gprs_nmo nmo;
174 /* T3168: wait for packet uplink assignment message */
175 uint32_t t3168; /* in milliseconds */
176 /* T3192: wait for release of the TBF after reception of the final block */
177 uint32_t t3192; /* in milliseconds */
178 uint32_t drx_timer_max;/* in seconds */
179 uint32_t bs_cv_max;
180 uint8_t supports_egprs_11bit_rach;
181 bool ctrl_ack_type_use_block; /* use PACKET CONTROL ACKNOWLEDGMENT */
182
183 uint8_t ext_info_present;
184 struct {
185 uint8_t egprs_supported;
186 uint8_t use_egprs_p_ch_req;
187 uint8_t bep_period;
188 uint8_t pfc_supported;
189 uint8_t dtm_supported;
190 uint8_t bss_paging_coordination;
191 bool ccn_active;
192 } ext_info;
193};
194
195/* TS 44.060 Table 12.9.2 */
196 struct osmo_gprs_power_ctrl_pars {
197 uint8_t alpha;
198 uint8_t t_avg_w;
199 uint8_t t_avg_t;
200 uint8_t pc_meas_chan;
201 uint8_t n_avg_i;
202};
203
204
206 struct egprs_cps {
207 uint8_t bits;
208 uint8_t mcs;
209 uint8_t p[2];
210};
211
213 enum egprs_cps_punc {
214 EGPRS_CPS_P1,
215 EGPRS_CPS_P2,
216 EGPRS_CPS_P3,
217 EGPRS_CPS_NONE = -1,
218};
219
221 enum egprs_hdr_type {
222 EGPRS_HDR_TYPE1,
223 EGPRS_HDR_TYPE2,
224 EGPRS_HDR_TYPE3,
225};
226
227 enum osmo_gprs_cs {
228 OSMO_GPRS_CS_NONE,
229 OSMO_GPRS_CS1,
230 OSMO_GPRS_CS2,
231 OSMO_GPRS_CS3,
232 OSMO_GPRS_CS4,
233 OSMO_GPRS_MCS1,
234 OSMO_GPRS_MCS2,
235 OSMO_GPRS_MCS3,
236 OSMO_GPRS_MCS4,
237 OSMO_GPRS_MCS5,
238 OSMO_GPRS_MCS6,
239 OSMO_GPRS_MCS7,
240 OSMO_GPRS_MCS8,
241 OSMO_GPRS_MCS9,
242 _NUM_OSMO_GPRS_CS
243};
244
245 int egprs_get_cps(struct egprs_cps *cps, uint8_t type, uint8_t bits);
246
247 int osmo_gprs_ul_block_size_bits(enum osmo_gprs_cs cs);
248 int osmo_gprs_dl_block_size_bits(enum osmo_gprs_cs cs);
249 int osmo_gprs_ul_block_size_bytes(enum osmo_gprs_cs cs);
250 int osmo_gprs_dl_block_size_bytes(enum osmo_gprs_cs cs);
251 enum osmo_gprs_cs osmo_gprs_ul_cs_by_block_bytes(uint8_t block_size);
252 enum osmo_gprs_cs osmo_gprs_dl_cs_by_block_bytes(uint8_t block_size);
endian.h
type
uint8_t type
Definition: gsm_04_08_gprs.h:7
egprs_get_cps
int egprs_get_cps(struct egprs_cps *cps, uint8_t type, uint8_t bits)
Definition: gprs_rlc.c:91
osmo_gprs_ul_block_size_bits
int osmo_gprs_ul_block_size_bits(enum osmo_gprs_cs cs)
Return size of (E)GPRS uplink block for given coding scheme in bits.
Definition: gprs_rlc.c:146
osmo_gprs_nmo
osmo_gprs_nmo
Definition: gsm_44_060.h:165
GPRS_NMO_II
@ GPRS_NMO_II
Definition: gsm_44_060.h:167
GPRS_NMO_I
@ GPRS_NMO_I
Definition: gsm_44_060.h:166
GPRS_NMO_III
@ GPRS_NMO_III
Definition: gsm_44_060.h:168
egprs_hdr_type
egprs_hdr_type
EGPRS header types (TS 44.060 10.0a.2)
Definition: gsm_44_060.h:221
EGPRS_HDR_TYPE2
@ EGPRS_HDR_TYPE2
Definition: gsm_44_060.h:223
EGPRS_HDR_TYPE1
@ EGPRS_HDR_TYPE1
Definition: gsm_44_060.h:222
EGPRS_HDR_TYPE3
@ EGPRS_HDR_TYPE3
Definition: gsm_44_060.h:224
egprs_cps_punc
egprs_cps_punc
CPS puncturing table selection (TS 44.060 10.4.8a)
Definition: gsm_44_060.h:213
EGPRS_CPS_P3
@ EGPRS_CPS_P3
Definition: gsm_44_060.h:216
EGPRS_CPS_NONE
@ EGPRS_CPS_NONE
Definition: gsm_44_060.h:217
EGPRS_CPS_P2
@ EGPRS_CPS_P2
Definition: gsm_44_060.h:215
EGPRS_CPS_P1
@ EGPRS_CPS_P1
Definition: gsm_44_060.h:214
osmo_gprs_cs
osmo_gprs_cs
Definition: gsm_44_060.h:227
OSMO_GPRS_CS_NONE
@ OSMO_GPRS_CS_NONE
Definition: gsm_44_060.h:228
OSMO_GPRS_MCS3
@ OSMO_GPRS_MCS3
Definition: gsm_44_060.h:235
OSMO_GPRS_MCS4
@ OSMO_GPRS_MCS4
Definition: gsm_44_060.h:236
OSMO_GPRS_CS4
@ OSMO_GPRS_CS4
Definition: gsm_44_060.h:232
OSMO_GPRS_MCS6
@ OSMO_GPRS_MCS6
Definition: gsm_44_060.h:238
OSMO_GPRS_MCS9
@ OSMO_GPRS_MCS9
Definition: gsm_44_060.h:241
OSMO_GPRS_CS3
@ OSMO_GPRS_CS3
Definition: gsm_44_060.h:231
OSMO_GPRS_MCS2
@ OSMO_GPRS_MCS2
Definition: gsm_44_060.h:234
OSMO_GPRS_CS1
@ OSMO_GPRS_CS1
Definition: gsm_44_060.h:229
OSMO_GPRS_MCS5
@ OSMO_GPRS_MCS5
Definition: gsm_44_060.h:237
OSMO_GPRS_MCS7
@ OSMO_GPRS_MCS7
Definition: gsm_44_060.h:239
OSMO_GPRS_CS2
@ OSMO_GPRS_CS2
Definition: gsm_44_060.h:230
OSMO_GPRS_MCS8
@ OSMO_GPRS_MCS8
Definition: gsm_44_060.h:240
_NUM_OSMO_GPRS_CS
@ _NUM_OSMO_GPRS_CS
Definition: gsm_44_060.h:242
OSMO_GPRS_MCS1
@ OSMO_GPRS_MCS1
Definition: gsm_44_060.h:233
osmo_gprs_ul_block_size_bytes
int osmo_gprs_ul_block_size_bytes(enum osmo_gprs_cs cs)
Return size of (E)GPRS uplink block for given coding scheme in bytes.
Definition: gprs_rlc.c:162
osmo_gprs_dl_cs_by_block_bytes
enum osmo_gprs_cs osmo_gprs_dl_cs_by_block_bytes(uint8_t block_size)
Return coding scheme for given (E)GPRS downlink block size.
Definition: gprs_rlc.c:198
osmo_gprs_ul_cs_by_block_bytes
enum osmo_gprs_cs osmo_gprs_ul_cs_by_block_bytes(uint8_t block_size)
Return coding scheme for given (E)GPRS uplink block size.
Definition: gprs_rlc.c:186
osmo_gprs_dl_block_size_bits
int osmo_gprs_dl_block_size_bits(enum osmo_gprs_cs cs)
Return size of (E)GPRS downlink block for given coding scheme in bits.
Definition: gprs_rlc.c:154
__attribute__
enum osmo_gprs_nmo __attribute__
osmo_gprs_dl_block_size_bytes
int osmo_gprs_dl_block_size_bytes(enum osmo_gprs_cs cs)
Return size of (E)GPRS downlink block for given coding scheme in bytes.
Definition: gprs_rlc.c:174
egprs_cps
Structure for CPS coding and puncturing scheme (TS 44.060 10.4.8a)
Definition: gsm_44_060.h:206
egprs_cps::mcs
uint8_t mcs
Definition: gsm_44_060.h:208
egprs_cps::bits
uint8_t bits
Definition: gsm_44_060.h:207
egprs_cps::p
uint8_t p[2]
Definition: gsm_44_060.h:209
gprs_rlc_dl_header_egprs_1
Definition: gsm_44_060.h:94
gprs_rlc_dl_header_egprs_2
Definition: gsm_44_060.h:118
gprs_rlc_dl_header_egprs_3
Definition: gsm_44_060.h:140
gprs_rlc_ul_header_egprs_1
Definition: gsm_44_060.h:13
gprs_rlc_ul_header_egprs_2
Definition: gsm_44_060.h:42
gprs_rlc_ul_header_egprs_3
Definition: gsm_44_060.h:69
osmo_gprs_cell_options
Definition: gsm_44_060.h:172
osmo_gprs_cell_options::t3168
uint32_t t3168
Definition: gsm_44_060.h:175
osmo_gprs_cell_options::ext_info
struct osmo_gprs_cell_options::@118 ext_info
osmo_gprs_cell_options::t3192
uint32_t t3192
Definition: gsm_44_060.h:177
osmo_gprs_cell_options::dtm_supported
uint8_t dtm_supported
Definition: gsm_44_060.h:189
osmo_gprs_cell_options::bep_period
uint8_t bep_period
Definition: gsm_44_060.h:187
osmo_gprs_cell_options::supports_egprs_11bit_rach
uint8_t supports_egprs_11bit_rach
Definition: gsm_44_060.h:180
osmo_gprs_cell_options::ccn_active
bool ccn_active
Definition: gsm_44_060.h:191
osmo_gprs_cell_options::use_egprs_p_ch_req
uint8_t use_egprs_p_ch_req
Definition: gsm_44_060.h:186
osmo_gprs_cell_options::ext_info_present
uint8_t ext_info_present
Definition: gsm_44_060.h:183
osmo_gprs_cell_options::bs_cv_max
uint32_t bs_cv_max
Definition: gsm_44_060.h:179
osmo_gprs_cell_options::pfc_supported
uint8_t pfc_supported
Definition: gsm_44_060.h:188
osmo_gprs_cell_options::drx_timer_max
uint32_t drx_timer_max
Definition: gsm_44_060.h:178
osmo_gprs_cell_options::egprs_supported
uint8_t egprs_supported
Definition: gsm_44_060.h:185
osmo_gprs_cell_options::nmo
enum osmo_gprs_nmo nmo
Definition: gsm_44_060.h:173
osmo_gprs_cell_options::bss_paging_coordination
uint8_t bss_paging_coordination
Definition: gsm_44_060.h:190
osmo_gprs_cell_options::ctrl_ack_type_use_block
bool ctrl_ack_type_use_block
Definition: gsm_44_060.h:181
osmo_gprs_power_ctrl_pars
Definition: gsm_44_060.h:196
osmo_gprs_power_ctrl_pars::t_avg_w
uint8_t t_avg_w
Definition: gsm_44_060.h:198
osmo_gprs_power_ctrl_pars::t_avg_t
uint8_t t_avg_t
Definition: gsm_44_060.h:199
osmo_gprs_power_ctrl_pars::alpha
uint8_t alpha
Definition: gsm_44_060.h:197
osmo_gprs_power_ctrl_pars::pc_meas_chan
uint8_t pc_meas_chan
Definition: gsm_44_060.h:200
osmo_gprs_power_ctrl_pars::n_avg_i
uint8_t n_avg_i
Definition: gsm_44_060.h:201