\doxysection{gsm\+\_\+44\+\_\+060.\+h}
\label{gsm__44__060_8h_source}\index{include/osmocom/gsm/protocol/gsm\_44\_060.h@{include/osmocom/gsm/protocol/gsm\_44\_060.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{7 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{8 }
\DoxyCodeLine{9 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{10 \textcolor{preprocessor}{\#include <osmocom/core/endian.h>}}
\DoxyCodeLine{11 }
\DoxyCodeLine{12 \textcolor{comment}{/* TS 44.060  10.3a.4.1.1 */}}
\DoxyCodeLine{13 \textcolor{keyword}{struct }gprs\_rlc\_ul\_header\_egprs\_1 \{}
\DoxyCodeLine{14 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{15         uint8\_t r:1,}
\DoxyCodeLine{16                  si:1,}
\DoxyCodeLine{17                  cv:4,}
\DoxyCodeLine{18                  tfi\_hi:2;}
\DoxyCodeLine{19         uint8\_t tfi\_lo:3,}
\DoxyCodeLine{20                  bsn1\_hi:5;}
\DoxyCodeLine{21         uint8\_t bsn1\_lo:6,}
\DoxyCodeLine{22                  bsn2\_hi:2;}
\DoxyCodeLine{23         uint8\_t bsn2\_lo:8;}
\DoxyCodeLine{24         uint8\_t cps:5,}
\DoxyCodeLine{25                  rsb:1,}
\DoxyCodeLine{26                  pi:1,}
\DoxyCodeLine{27                  spare\_hi:1;}
\DoxyCodeLine{28         uint8\_t spare\_lo:6,}
\DoxyCodeLine{29                  dummy:2;}
\DoxyCodeLine{30 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{31 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{32         uint8\_t tfi\_hi:2, cv:4, si:1, r:1;}
\DoxyCodeLine{33         uint8\_t bsn1\_hi:5, tfi\_lo:3;}
\DoxyCodeLine{34         uint8\_t bsn2\_hi:2, bsn1\_lo:6;}
\DoxyCodeLine{35         uint8\_t bsn2\_lo:8;}
\DoxyCodeLine{36         uint8\_t spare\_hi:1, pi:1, rsb:1, cps:5;}
\DoxyCodeLine{37         uint8\_t dummy:2, spare\_lo:6;}
\DoxyCodeLine{38 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{39 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{40 }
\DoxyCodeLine{41 \textcolor{comment}{/* TS 44.060  10.3a.4.2.1 */}}
\DoxyCodeLine{42 \textcolor{keyword}{struct }gprs\_rlc\_ul\_header\_egprs\_2 \{}
\DoxyCodeLine{43 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{44         uint8\_t r:1,}
\DoxyCodeLine{45                  si:1,}
\DoxyCodeLine{46                  cv:4,}
\DoxyCodeLine{47                  tfi\_hi:2;}
\DoxyCodeLine{48         uint8\_t tfi\_lo:3,}
\DoxyCodeLine{49                  bsn1\_hi:5;}
\DoxyCodeLine{50         uint8\_t bsn1\_lo:6,}
\DoxyCodeLine{51                  cps\_hi:2;}
\DoxyCodeLine{52         uint8\_t cps\_lo:1,}
\DoxyCodeLine{53                  rsb:1,}
\DoxyCodeLine{54                  pi:1,}
\DoxyCodeLine{55                  spare\_hi:5;}
\DoxyCodeLine{56         uint8\_t spare\_lo:5,}
\DoxyCodeLine{57                  dummy:3;}
\DoxyCodeLine{58 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{59 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{60         uint8\_t tfi\_hi:2, cv:4, si:1, r:1;}
\DoxyCodeLine{61         uint8\_t bsn1\_hi:5, tfi\_lo:3;}
\DoxyCodeLine{62         uint8\_t cps\_hi:2, bsn1\_lo:6;}
\DoxyCodeLine{63         uint8\_t spare\_hi:5, pi:1, rsb:1, cps\_lo:1;}
\DoxyCodeLine{64         uint8\_t dummy:3, spare\_lo:5;}
\DoxyCodeLine{65 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{66 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{67 }
\DoxyCodeLine{68 \textcolor{comment}{/* TS 44.060  10.3a.4.3.1 */}}
\DoxyCodeLine{69 \textcolor{keyword}{struct }gprs\_rlc\_ul\_header\_egprs\_3 \{}
\DoxyCodeLine{70 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{71         uint8\_t r:1,}
\DoxyCodeLine{72                  si:1,}
\DoxyCodeLine{73                  cv:4,}
\DoxyCodeLine{74                  tfi\_hi:2;}
\DoxyCodeLine{75         uint8\_t tfi\_lo:3,}
\DoxyCodeLine{76                  bsn1\_hi:5;}
\DoxyCodeLine{77         uint8\_t bsn1\_lo:6,}
\DoxyCodeLine{78                  cps\_hi:2;}
\DoxyCodeLine{79         uint8\_t cps\_lo:2,}
\DoxyCodeLine{80                  spb:2,}
\DoxyCodeLine{81                  rsb:1,}
\DoxyCodeLine{82                  pi:1,}
\DoxyCodeLine{83                  spare:1,}
\DoxyCodeLine{84                  dummy:1;}
\DoxyCodeLine{85 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{86 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{87         uint8\_t tfi\_hi:2, cv:4, si:1, r:1;}
\DoxyCodeLine{88         uint8\_t bsn1\_hi:5, tfi\_lo:3;}
\DoxyCodeLine{89         uint8\_t cps\_hi:2, bsn1\_lo:6;}
\DoxyCodeLine{90         uint8\_t dummy:1, spare:1, pi:1, rsb:1, spb:2, cps\_lo:2;}
\DoxyCodeLine{91 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{92 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{93 }
\DoxyCodeLine{94 \textcolor{keyword}{struct }gprs\_rlc\_dl\_header\_egprs\_1 \{}
\DoxyCodeLine{95 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{96         uint8\_t usf:3,}
\DoxyCodeLine{97                  es\_p:2,}
\DoxyCodeLine{98                  rrbp:2,}
\DoxyCodeLine{99                  tfi\_hi:1;}
\DoxyCodeLine{100         uint8\_t tfi\_lo:4,}
\DoxyCodeLine{101                  pr:2,}
\DoxyCodeLine{102                  bsn1\_hi:2;}
\DoxyCodeLine{103         uint8\_t bsn1\_mid:8;}
\DoxyCodeLine{104         uint8\_t bsn1\_lo:1,}
\DoxyCodeLine{105                  bsn2\_hi:7;}
\DoxyCodeLine{106         uint8\_t bsn2\_lo:3,}
\DoxyCodeLine{107                  cps:5;}
\DoxyCodeLine{108 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{109 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{110         uint8\_t tfi\_hi:1, rrbp:2, es\_p:2, usf:3;}
\DoxyCodeLine{111         uint8\_t bsn1\_hi:2, pr:2, tfi\_lo:4;}
\DoxyCodeLine{112         uint8\_t bsn1\_mid:8;}
\DoxyCodeLine{113         uint8\_t bsn2\_hi:7, bsn1\_lo:1;}
\DoxyCodeLine{114         uint8\_t cps:5, bsn2\_lo:3;}
\DoxyCodeLine{115 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{116 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{117 }
\DoxyCodeLine{118 \textcolor{keyword}{struct }gprs\_rlc\_dl\_header\_egprs\_2 \{}
\DoxyCodeLine{119 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{120         uint8\_t usf:3,}
\DoxyCodeLine{121                  es\_p:2,}
\DoxyCodeLine{122                  rrbp:2,}
\DoxyCodeLine{123                  tfi\_hi:1;}
\DoxyCodeLine{124         uint8\_t tfi\_lo:4,}
\DoxyCodeLine{125                  pr:2,}
\DoxyCodeLine{126                  bsn1\_hi:2;}
\DoxyCodeLine{127         uint8\_t bsn1\_mid:8;}
\DoxyCodeLine{128         uint8\_t bsn1\_lo:1,}
\DoxyCodeLine{129                  cps:3,}
\DoxyCodeLine{130                  dummy:4;}
\DoxyCodeLine{131 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{132 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{133         uint8\_t tfi\_hi:1, rrbp:2, es\_p:2, usf:3;}
\DoxyCodeLine{134         uint8\_t bsn1\_hi:2, pr:2, tfi\_lo:4;}
\DoxyCodeLine{135         uint8\_t bsn1\_mid:8;}
\DoxyCodeLine{136         uint8\_t dummy:4, cps:3, bsn1\_lo:1;}
\DoxyCodeLine{137 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{138 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{139 }
\DoxyCodeLine{140 \textcolor{keyword}{struct }gprs\_rlc\_dl\_header\_egprs\_3 \{}
\DoxyCodeLine{141 \textcolor{preprocessor}{\#if OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{142         uint8\_t usf:3,}
\DoxyCodeLine{143                  es\_p:2,}
\DoxyCodeLine{144                  rrbp:2,}
\DoxyCodeLine{145                  tfi\_hi:1;}
\DoxyCodeLine{146         uint8\_t tfi\_lo:4,}
\DoxyCodeLine{147                  pr:2,}
\DoxyCodeLine{148                  bsn1\_hi:2;}
\DoxyCodeLine{149         uint8\_t bsn1\_mid:8;}
\DoxyCodeLine{150         uint8\_t bsn1\_lo:1,}
\DoxyCodeLine{151                  cps:4,}
\DoxyCodeLine{152                  spb:2,}
\DoxyCodeLine{153                  dummy:1;}
\DoxyCodeLine{154 \textcolor{preprocessor}{\#elif OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{155 \textcolor{comment}{/* auto-\/generated from the little endian part above (libosmocore/contrib/struct\_endianness.py) */}}
\DoxyCodeLine{156         uint8\_t tfi\_hi:1, rrbp:2, es\_p:2, usf:3;}
\DoxyCodeLine{157         uint8\_t bsn1\_hi:2, pr:2, tfi\_lo:4;}
\DoxyCodeLine{158         uint8\_t bsn1\_mid:8;}
\DoxyCodeLine{159         uint8\_t dummy:1, spb:2, cps:4, bsn1\_lo:1;}
\DoxyCodeLine{160 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{161 \} \_\_attribute\_\_ ((packed));}
\DoxyCodeLine{162 }
\DoxyCodeLine{163 \textcolor{comment}{/* TS 44.060 Table 12.24.2}}
\DoxyCodeLine{164 \textcolor{comment}{* Meaning of values documented in TS 23.060 Chapter 6.3.3.1: Network Mode of Operation */}}
\DoxyCodeLine{165 \textcolor{keyword}{enum} osmo\_gprs\_nmo \{}
\DoxyCodeLine{166         GPRS\_NMO\_I    = 0,    \textcolor{comment}{/* CS pagin on GPRS paging or traffic channel */}}
\DoxyCodeLine{167         GPRS\_NMO\_II  = 1,    \textcolor{comment}{/* all paging on CCCH */}}
\DoxyCodeLine{168         GPRS\_NMO\_III        = 2,    \textcolor{comment}{/* no paging coordination */}}
\DoxyCodeLine{169 \};}
\DoxyCodeLine{170 }
\DoxyCodeLine{171 \textcolor{comment}{/* TS 44.060 12.24 */}}
\DoxyCodeLine{172 \textcolor{keyword}{struct }osmo\_gprs\_cell\_options \{}
\DoxyCodeLine{173         \textcolor{keyword}{enum} osmo\_gprs\_nmo nmo;}
\DoxyCodeLine{174         \textcolor{comment}{/* T3168: wait for packet uplink assignment message */}}
\DoxyCodeLine{175         uint32\_t t3168;    \textcolor{comment}{/* in milliseconds */}}
\DoxyCodeLine{176         \textcolor{comment}{/* T3192: wait for release of the TBF after reception of the final block */}}
\DoxyCodeLine{177         uint32\_t t3192;    \textcolor{comment}{/* in milliseconds */}}
\DoxyCodeLine{178         uint32\_t drx\_timer\_max;\textcolor{comment}{/* in seconds */}}
\DoxyCodeLine{179         uint32\_t bs\_cv\_max;}
\DoxyCodeLine{180         uint8\_t  supports\_egprs\_11bit\_rach;}
\DoxyCodeLine{181         \textcolor{keywordtype}{bool} ctrl\_ack\_type\_use\_block; \textcolor{comment}{/* use PACKET CONTROL ACKNOWLEDGMENT */}}
\DoxyCodeLine{182 }
\DoxyCodeLine{183         uint8\_t ext\_info\_present;}
\DoxyCodeLine{184         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{185                 uint8\_t egprs\_supported;}
\DoxyCodeLine{186                 uint8\_t use\_egprs\_p\_ch\_req;}
\DoxyCodeLine{187                 uint8\_t bep\_period;}
\DoxyCodeLine{188                 uint8\_t pfc\_supported;}
\DoxyCodeLine{189                 uint8\_t dtm\_supported;}
\DoxyCodeLine{190                 uint8\_t bss\_paging\_coordination;}
\DoxyCodeLine{191                 \textcolor{keywordtype}{bool} ccn\_active;}
\DoxyCodeLine{192         \} ext\_info;}
\DoxyCodeLine{193 \};}
\DoxyCodeLine{194 }
\DoxyCodeLine{195 \textcolor{comment}{/* TS 44.060 Table 12.9.2 */}}
\DoxyCodeLine{196 \textcolor{keyword}{struct }osmo\_gprs\_power\_ctrl\_pars \{}
\DoxyCodeLine{197         uint8\_t alpha;}
\DoxyCodeLine{198         uint8\_t t\_avg\_w;}
\DoxyCodeLine{199         uint8\_t t\_avg\_t;}
\DoxyCodeLine{200         uint8\_t pc\_meas\_chan;}
\DoxyCodeLine{201         uint8\_t n\_avg\_i;}
\DoxyCodeLine{202 \};}
\DoxyCodeLine{203 }
\DoxyCodeLine{204 }
\DoxyCodeLine{206 \textcolor{keyword}{struct }egprs\_cps \{}
\DoxyCodeLine{207         uint8\_t bits;}
\DoxyCodeLine{208         uint8\_t mcs;}
\DoxyCodeLine{209         uint8\_t p[2];}
\DoxyCodeLine{210 \};}
\DoxyCodeLine{211 }
\DoxyCodeLine{213 \textcolor{keyword}{enum} egprs\_cps\_punc \{}
\DoxyCodeLine{214         EGPRS\_CPS\_P1,}
\DoxyCodeLine{215         EGPRS\_CPS\_P2,}
\DoxyCodeLine{216         EGPRS\_CPS\_P3,}
\DoxyCodeLine{217         EGPRS\_CPS\_NONE = -\/1,}
\DoxyCodeLine{218 \};}
\DoxyCodeLine{219 }
\DoxyCodeLine{221 \textcolor{keyword}{enum} egprs\_hdr\_type \{}
\DoxyCodeLine{222         EGPRS\_HDR\_TYPE1,}
\DoxyCodeLine{223         EGPRS\_HDR\_TYPE2,}
\DoxyCodeLine{224         EGPRS\_HDR\_TYPE3,}
\DoxyCodeLine{225 \};}
\DoxyCodeLine{226 }
\DoxyCodeLine{227 \textcolor{keyword}{enum} osmo\_gprs\_cs \{}
\DoxyCodeLine{228         OSMO\_GPRS\_CS\_NONE,}
\DoxyCodeLine{229         OSMO\_GPRS\_CS1,}
\DoxyCodeLine{230         OSMO\_GPRS\_CS2,}
\DoxyCodeLine{231         OSMO\_GPRS\_CS3,}
\DoxyCodeLine{232         OSMO\_GPRS\_CS4,}
\DoxyCodeLine{233         OSMO\_GPRS\_MCS1,}
\DoxyCodeLine{234         OSMO\_GPRS\_MCS2,}
\DoxyCodeLine{235         OSMO\_GPRS\_MCS3,}
\DoxyCodeLine{236         OSMO\_GPRS\_MCS4,}
\DoxyCodeLine{237         OSMO\_GPRS\_MCS5,}
\DoxyCodeLine{238         OSMO\_GPRS\_MCS6,}
\DoxyCodeLine{239         OSMO\_GPRS\_MCS7,}
\DoxyCodeLine{240         OSMO\_GPRS\_MCS8,}
\DoxyCodeLine{241         OSMO\_GPRS\_MCS9,}
\DoxyCodeLine{242         \_NUM\_OSMO\_GPRS\_CS}
\DoxyCodeLine{243 \};}
\DoxyCodeLine{244 }
\DoxyCodeLine{245 \textcolor{keywordtype}{int} egprs\_get\_cps(\textcolor{keyword}{struct} egprs\_cps *cps, uint8\_t type, uint8\_t bits);}
\DoxyCodeLine{246 }
\DoxyCodeLine{247 \textcolor{keywordtype}{int} osmo\_gprs\_ul\_block\_size\_bits(\textcolor{keyword}{enum} osmo\_gprs\_cs cs);}
\DoxyCodeLine{248 \textcolor{keywordtype}{int} osmo\_gprs\_dl\_block\_size\_bits(\textcolor{keyword}{enum} osmo\_gprs\_cs cs);}
\DoxyCodeLine{249 \textcolor{keywordtype}{int} osmo\_gprs\_ul\_block\_size\_bytes(\textcolor{keyword}{enum} osmo\_gprs\_cs cs);}
\DoxyCodeLine{250 \textcolor{keywordtype}{int} osmo\_gprs\_dl\_block\_size\_bytes(\textcolor{keyword}{enum} osmo\_gprs\_cs cs);}
\DoxyCodeLine{251 \textcolor{keyword}{enum} osmo\_gprs\_cs osmo\_gprs\_ul\_cs\_by\_block\_bytes(uint8\_t block\_size);}
\DoxyCodeLine{252 \textcolor{keyword}{enum} osmo\_gprs\_cs osmo\_gprs\_dl\_cs\_by\_block\_bytes(uint8\_t block\_size);}

\end{DoxyCode}
