blob: 1a479dbaf0baf0ca935c6479aef8b33a15a8a66f [file] [log] [blame]
Harald Welte13f52972010-02-20 18:56:00 +01001#ifndef PROTO_GSM_04_08_H
2#define PROTO_GSM_04_08_H
3
4/* GSM TS 04.08 definitions */
5struct gsm_lchan;
6
7struct gsm48_classmark1 {
8 u_int8_t spare:1,
9 rev_level:2,
10 es_ind:1,
11 a5_1:1,
12 pwr_lev:3;
13} __attribute__ ((packed));
14
15/* Chapter 10.5.2.5 */
16struct gsm48_chan_desc {
17 u_int8_t chan_nr;
18 union {
19 struct {
20 u_int8_t maio_high:4,
21 h:1,
22 tsc:3;
23 u_int8_t hsn:6,
24 maio_low:2;
25 } h1;
26 struct {
27 u_int8_t arfcn_high:2,
28 spare:2,
29 h:1,
30 tsc:3;
31 u_int8_t arfcn_low;
32 } h0;
33 };
34} __attribute__ ((packed));
35
36/* Chapter 10.5.2.21aa */
37struct gsm48_multi_rate_conf {
38 u_int8_t smod : 2,
39 spare: 1,
40 icmi : 1,
41 nscb : 1,
42 ver : 3;
43 u_int8_t m4_75 : 1,
44 m5_15 : 1,
45 m5_90 : 1,
46 m6_70 : 1,
47 m7_40 : 1,
48 m7_95 : 1,
49 m10_2 : 1,
50 m12_2 : 1;
51} __attribute__((packed));
52
53/* Chapter 10.5.2.30 */
54struct gsm48_req_ref {
55 u_int8_t ra;
56 u_int8_t t3_high:3,
57 t1_:5;
58 u_int8_t t2:5,
59 t3_low:3;
60} __attribute__ ((packed));
61
62/*
63 * Chapter 9.1.5/9.1.6
64 *
65 * For 9.1.6 the chan_desc has the meaning of 10.5.2.5a
66 */
67struct gsm48_chan_mode_modify {
68 struct gsm48_chan_desc chan_desc;
69 u_int8_t mode;
70} __attribute__ ((packed));
71
72enum gsm48_chan_mode {
73 GSM48_CMODE_SIGN = 0x00,
74 GSM48_CMODE_SPEECH_V1 = 0x01,
75 GSM48_CMODE_SPEECH_EFR = 0x21,
76 GSM48_CMODE_SPEECH_AMR = 0x41,
77 GSM48_CMODE_DATA_14k5 = 0x0f,
78 GSM48_CMODE_DATA_12k0 = 0x03,
79 GSM48_CMODE_DATA_6k0 = 0x0b,
80 GSM48_CMODE_DATA_3k6 = 0x23,
81};
82
83/* Chapter 9.1.2 */
84struct gsm48_ass_cmd {
85 /* Semantic is from 10.5.2.5a */
86 struct gsm48_chan_desc chan_desc;
87 u_int8_t power_command;
88 u_int8_t data[0];
89} __attribute__((packed));
90
91/* Chapter 10.5.2.2 */
92struct gsm48_cell_desc {
93 u_int8_t bcc:3,
94 ncc:3,
95 arfcn_hi:2;
96 u_int8_t arfcn_lo;
97} __attribute__((packed));
98
99/* Chapter 9.1.15 */
100struct gsm48_ho_cmd {
101 struct gsm48_cell_desc cell_desc;
102 struct gsm48_chan_desc chan_desc;
103 u_int8_t ho_ref;
104 u_int8_t power_command;
105 u_int8_t data[0];
106} __attribute__((packed));
107
108/* Chapter 9.1.18 */
109struct gsm48_imm_ass {
110 u_int8_t l2_plen;
111 u_int8_t proto_discr;
112 u_int8_t msg_type;
113 u_int8_t page_mode;
114 struct gsm48_chan_desc chan_desc;
115 struct gsm48_req_ref req_ref;
116 u_int8_t timing_advance;
117 u_int8_t mob_alloc_len;
118 u_int8_t mob_alloc[0];
119} __attribute__ ((packed));
120
121/* Chapter 10.5.1.3 */
122struct gsm48_loc_area_id {
123 u_int8_t digits[3]; /* BCD! */
124 u_int16_t lac;
125} __attribute__ ((packed));
126
127/* Section 9.2.2 */
128struct gsm48_auth_req {
129 u_int8_t key_seq:4,
130 spare:4;
131 u_int8_t rand[16];
132} __attribute__ ((packed));
133
134/* Section 9.2.15 */
135struct gsm48_loc_upd_req {
136 u_int8_t type:4,
137 key_seq:4;
138 struct gsm48_loc_area_id lai;
139 struct gsm48_classmark1 classmark1;
140 u_int8_t mi_len;
141 u_int8_t mi[0];
142} __attribute__ ((packed));
143
144/* Section 10.1 */
145struct gsm48_hdr {
146 u_int8_t proto_discr;
147 u_int8_t msg_type;
148 u_int8_t data[0];
149} __attribute__ ((packed));
150
151/* Section 9.1.3x System information Type header */
152struct gsm48_system_information_type_header {
153 u_int8_t l2_plen;
154 u_int8_t rr_protocol_discriminator :4,
155 skip_indicator:4;
156 u_int8_t system_information;
157} __attribute__ ((packed));
158
159struct gsm48_rach_control {
160 u_int8_t re :1,
161 cell_bar :1,
162 tx_integer :4,
163 max_trans :2;
164 u_int8_t t2;
165 u_int8_t t3;
166} __attribute__ ((packed));
167
168/* Section 10.5.2.4 Cell Selection Parameters */
169struct gsm48_cell_sel_par {
170 u_int8_t ms_txpwr_max_ccch:5, /* GSM 05.08 MS-TXPWR-MAX-CCCH */
171 cell_resel_hyst:3; /* GSM 05.08 CELL-RESELECT-HYSTERESIS */
172 u_int8_t rxlev_acc_min:6, /* GSM 05.08 RXLEV-ACCESS-MIN */
173 neci:1,
174 acs:1;
175} __attribute__ ((packed));
176
177/* Section 10.5.2.11 Control Channel Description , Figure 10.5.33 */
178struct gsm48_control_channel_descr {
179 u_int8_t ccch_conf :3,
180 bs_ag_blks_res :3,
181 att :1,
182 spare1 :1;
183 u_int8_t bs_pa_mfrms : 3,
184 spare2 :5;
185 u_int8_t t3212;
186} __attribute__ ((packed));
187
188struct gsm48_cell_options {
189 u_int8_t radio_link_timeout:4,
190 dtx:2,
191 pwrc:1,
192 spare:1;
193} __attribute__ ((packed));
194
195/* Section 9.2.9 CM service request */
196struct gsm48_service_request {
197 u_int8_t cm_service_type : 4,
198 cipher_key_seq : 4;
199 /* length + 3 bytes */
200 u_int32_t classmark;
201 u_int8_t mi_len;
202 u_int8_t mi[0];
203 /* optional priority level */
204} __attribute__ ((packed));
205
206/* Section 9.1.31 System information Type 1 */
207struct gsm48_system_information_type_1 {
208 struct gsm48_system_information_type_header header;
209 u_int8_t cell_channel_description[16];
210 struct gsm48_rach_control rach_control;
211 u_int8_t rest_octets[0]; /* NCH position on the CCCH */
212} __attribute__ ((packed));
213
214/* Section 9.1.32 System information Type 2 */
215struct gsm48_system_information_type_2 {
216 struct gsm48_system_information_type_header header;
217 u_int8_t bcch_frequency_list[16];
218 u_int8_t ncc_permitted;
219 struct gsm48_rach_control rach_control;
220} __attribute__ ((packed));
221
222/* Section 9.1.35 System information Type 3 */
223struct gsm48_system_information_type_3 {
224 struct gsm48_system_information_type_header header;
225 u_int16_t cell_identity;
226 struct gsm48_loc_area_id lai;
227 struct gsm48_control_channel_descr control_channel_desc;
228 struct gsm48_cell_options cell_options;
229 struct gsm48_cell_sel_par cell_sel_par;
230 struct gsm48_rach_control rach_control;
231 u_int8_t rest_octets[0];
232} __attribute__ ((packed));
233
234/* Section 9.1.36 System information Type 4 */
235struct gsm48_system_information_type_4 {
236 struct gsm48_system_information_type_header header;
237 struct gsm48_loc_area_id lai;
238 struct gsm48_cell_sel_par cell_sel_par;
239 struct gsm48_rach_control rach_control;
240 /* optional CBCH conditional CBCH... followed by
241 mandantory SI 4 Reset Octets
242 */
243 u_int8_t data[0];
244} __attribute__ ((packed));
245
246/* Section 9.1.37 System information Type 5 */
247struct gsm48_system_information_type_5 {
248 u_int8_t rr_protocol_discriminator :4,
249 skip_indicator:4;
250 u_int8_t system_information;
251 u_int8_t bcch_frequency_list[16];
252} __attribute__ ((packed));
253
254/* Section 9.1.40 System information Type 6 */
255struct gsm48_system_information_type_6 {
256 u_int8_t rr_protocol_discriminator :4,
257 skip_indicator:4;
258 u_int8_t system_information;
259 u_int16_t cell_identity;
260 struct gsm48_loc_area_id lai;
261 struct gsm48_cell_options cell_options;
262 u_int8_t ncc_permitted;
263 u_int8_t rest_octets[0];
264} __attribute__ ((packed));
265
266/* Section 9.1.43a System Information type 13 */
267struct gsm48_system_information_type_13 {
268 struct gsm48_system_information_type_header header;
269 u_int8_t rest_octets[0];
270} __attribute__ ((packed));
271
272/* Section 9.2.12 IMSI Detach Indication */
273struct gsm48_imsi_detach_ind {
274 struct gsm48_classmark1 classmark1;
275 u_int8_t mi_len;
276 u_int8_t mi[0];
277} __attribute__ ((packed));
278
279/* Section 10.2 + GSM 04.07 12.2.3.1.1 */
280#define GSM48_PDISC_GROUP_CC 0x00
281#define GSM48_PDISC_BCAST_CC 0x01
282#define GSM48_PDISC_PDSS1 0x02
283#define GSM48_PDISC_CC 0x03
284#define GSM48_PDISC_PDSS2 0x04
285#define GSM48_PDISC_MM 0x05
286#define GSM48_PDISC_RR 0x06
287#define GSM48_PDISC_MM_GPRS 0x08
288#define GSM48_PDISC_SMS 0x09
289#define GSM48_PDISC_SM_GPRS 0x0a
290#define GSM48_PDISC_NC_SS 0x0b
291#define GSM48_PDISC_LOC 0x0c
292#define GSM48_PDISC_MASK 0x0f
293#define GSM48_PDISC_USSD 0x11
294
295/* Section 10.4 */
296#define GSM48_MT_RR_INIT_REQ 0x3c
297#define GSM48_MT_RR_ADD_ASS 0x3b
298#define GSM48_MT_RR_IMM_ASS 0x3f
299#define GSM48_MT_RR_IMM_ASS_EXT 0x39
300#define GSM48_MT_RR_IMM_ASS_REJ 0x3a
301
302#define GSM48_MT_RR_CIPH_M_CMD 0x35
303#define GSM48_MT_RR_CIPH_M_COMPL 0x32
304
305#define GSM48_MT_RR_CFG_CHG_CMD 0x30
306#define GSM48_MT_RR_CFG_CHG_ACK 0x31
307#define GSM48_MT_RR_CFG_CHG_REJ 0x33
308
309#define GSM48_MT_RR_ASS_CMD 0x2e
310#define GSM48_MT_RR_ASS_COMPL 0x29
311#define GSM48_MT_RR_ASS_FAIL 0x2f
312#define GSM48_MT_RR_HANDO_CMD 0x2b
313#define GSM48_MT_RR_HANDO_COMPL 0x2c
314#define GSM48_MT_RR_HANDO_FAIL 0x28
315#define GSM48_MT_RR_HANDO_INFO 0x2d
316
317#define GSM48_MT_RR_CELL_CHG_ORDER 0x08
318#define GSM48_MT_RR_PDCH_ASS_CMD 0x23
319
320#define GSM48_MT_RR_CHAN_REL 0x0d
321#define GSM48_MT_RR_PART_REL 0x0a
322#define GSM48_MT_RR_PART_REL_COMP 0x0f
323
324#define GSM48_MT_RR_PAG_REQ_1 0x21
325#define GSM48_MT_RR_PAG_REQ_2 0x22
326#define GSM48_MT_RR_PAG_REQ_3 0x24
327#define GSM48_MT_RR_PAG_RESP 0x27
328#define GSM48_MT_RR_NOTIF_NCH 0x20
329#define GSM48_MT_RR_NOTIF_FACCH 0x25
330#define GSM48_MT_RR_NOTIF_RESP 0x26
331
332#define GSM48_MT_RR_SYSINFO_8 0x18
333#define GSM48_MT_RR_SYSINFO_1 0x19
334#define GSM48_MT_RR_SYSINFO_2 0x1a
335#define GSM48_MT_RR_SYSINFO_3 0x1b
336#define GSM48_MT_RR_SYSINFO_4 0x1c
337#define GSM48_MT_RR_SYSINFO_5 0x1d
338#define GSM48_MT_RR_SYSINFO_6 0x1e
339#define GSM48_MT_RR_SYSINFO_7 0x1f
340
341#define GSM48_MT_RR_SYSINFO_2bis 0x02
342#define GSM48_MT_RR_SYSINFO_2ter 0x03
343#define GSM48_MT_RR_SYSINFO_5bis 0x05
344#define GSM48_MT_RR_SYSINFO_5ter 0x06
345#define GSM48_MT_RR_SYSINFO_9 0x04
346#define GSM48_MT_RR_SYSINFO_13 0x00
347
348#define GSM48_MT_RR_SYSINFO_16 0x3d
349#define GSM48_MT_RR_SYSINFO_17 0x3e
350
351#define GSM48_MT_RR_CHAN_MODE_MODIF 0x10
352#define GSM48_MT_RR_STATUS 0x12
353#define GSM48_MT_RR_CHAN_MODE_MODIF_ACK 0x17
354#define GSM48_MT_RR_FREQ_REDEF 0x14
355#define GSM48_MT_RR_MEAS_REP 0x15
356#define GSM48_MT_RR_CLSM_CHG 0x16
357#define GSM48_MT_RR_CLSM_ENQ 0x13
358#define GSM48_MT_RR_EXT_MEAS_REP 0x36
359#define GSM48_MT_RR_EXT_MEAS_REP_ORD 0x37
360#define GSM48_MT_RR_GPRS_SUSP_REQ 0x34
361
362#define GSM48_MT_RR_VGCS_UPL_GRANT 0x08
363#define GSM48_MT_RR_UPLINK_RELEASE 0x0e
364#define GSM48_MT_RR_UPLINK_FREE 0x0c
365#define GSM48_MT_RR_UPLINK_BUSY 0x2a
366#define GSM48_MT_RR_TALKER_IND 0x11
367
368#define GSM48_MT_RR_APP_INFO 0x38
369
370/* Table 10.2/3GPP TS 04.08 */
371#define GSM48_MT_MM_IMSI_DETACH_IND 0x01
372#define GSM48_MT_MM_LOC_UPD_ACCEPT 0x02
373#define GSM48_MT_MM_LOC_UPD_REJECT 0x04
374#define GSM48_MT_MM_LOC_UPD_REQUEST 0x08
375
376#define GSM48_MT_MM_AUTH_REJ 0x11
377#define GSM48_MT_MM_AUTH_REQ 0x12
378#define GSM48_MT_MM_AUTH_RESP 0x14
379#define GSM48_MT_MM_ID_REQ 0x18
380#define GSM48_MT_MM_ID_RESP 0x19
381#define GSM48_MT_MM_TMSI_REALL_CMD 0x1a
382#define GSM48_MT_MM_TMSI_REALL_COMPL 0x1b
383
384#define GSM48_MT_MM_CM_SERV_ACC 0x21
385#define GSM48_MT_MM_CM_SERV_REJ 0x22
386#define GSM48_MT_MM_CM_SERV_ABORT 0x23
387#define GSM48_MT_MM_CM_SERV_REQ 0x24
388#define GSM48_MT_MM_CM_SERV_PROMPT 0x25
389#define GSM48_MT_MM_CM_REEST_REQ 0x28
390#define GSM48_MT_MM_ABORT 0x29
391
392#define GSM48_MT_MM_NULL 0x30
393#define GSM48_MT_MM_STATUS 0x31
394#define GSM48_MT_MM_INFO 0x32
395
396/* Table 10.3/3GPP TS 04.08 */
397#define GSM48_MT_CC_ALERTING 0x01
398#define GSM48_MT_CC_CALL_CONF 0x08
399#define GSM48_MT_CC_CALL_PROC 0x02
400#define GSM48_MT_CC_CONNECT 0x07
401#define GSM48_MT_CC_CONNECT_ACK 0x0f
402#define GSM48_MT_CC_EMERG_SETUP 0x0e
403#define GSM48_MT_CC_PROGRESS 0x03
404#define GSM48_MT_CC_ESTAB 0x04
405#define GSM48_MT_CC_ESTAB_CONF 0x06
406#define GSM48_MT_CC_RECALL 0x0b
407#define GSM48_MT_CC_START_CC 0x09
408#define GSM48_MT_CC_SETUP 0x05
409
410#define GSM48_MT_CC_MODIFY 0x17
411#define GSM48_MT_CC_MODIFY_COMPL 0x1f
412#define GSM48_MT_CC_MODIFY_REJECT 0x13
413#define GSM48_MT_CC_USER_INFO 0x10
414#define GSM48_MT_CC_HOLD 0x18
415#define GSM48_MT_CC_HOLD_ACK 0x19
416#define GSM48_MT_CC_HOLD_REJ 0x1a
417#define GSM48_MT_CC_RETR 0x1c
418#define GSM48_MT_CC_RETR_ACK 0x1d
419#define GSM48_MT_CC_RETR_REJ 0x1e
420
421#define GSM48_MT_CC_DISCONNECT 0x25
422#define GSM48_MT_CC_RELEASE 0x2d
423#define GSM48_MT_CC_RELEASE_COMPL 0x2a
424
425#define GSM48_MT_CC_CONG_CTRL 0x39
426#define GSM48_MT_CC_NOTIFY 0x3e
427#define GSM48_MT_CC_STATUS 0x3d
428#define GSM48_MT_CC_STATUS_ENQ 0x34
429#define GSM48_MT_CC_START_DTMF 0x35
430#define GSM48_MT_CC_STOP_DTMF 0x31
431#define GSM48_MT_CC_STOP_DTMF_ACK 0x32
432#define GSM48_MT_CC_START_DTMF_ACK 0x36
433#define GSM48_MT_CC_START_DTMF_REJ 0x37
434#define GSM48_MT_CC_FACILITY 0x3a
435
436/* FIXME: Table 10.4 / 10.4a (GPRS) */
437
438/* Section 10.5.2.26, Table 10.5.64 */
439#define GSM48_PM_MASK 0x03
440#define GSM48_PM_NORMAL 0x00
441#define GSM48_PM_EXTENDED 0x01
442#define GSM48_PM_REORG 0x02
443#define GSM48_PM_SAME 0x03
444
445/* Chapter 10.5.3.5 / Table 10.5.93 */
446#define GSM48_LUPD_NORMAL 0x0
447#define GSM48_LUPD_PERIODIC 0x1
448#define GSM48_LUPD_IMSI_ATT 0x2
449#define GSM48_LUPD_RESERVED 0x3
450
451/* Table 10.5.4 */
452#define GSM_MI_TYPE_MASK 0x07
453#define GSM_MI_TYPE_NONE 0x00
454#define GSM_MI_TYPE_IMSI 0x01
455#define GSM_MI_TYPE_IMEI 0x02
456#define GSM_MI_TYPE_IMEISV 0x03
457#define GSM_MI_TYPE_TMSI 0x04
458#define GSM_MI_ODD 0x08
459
460#define GSM48_IE_MUL_RATE_CFG 0x03 /* 10.5.2.21aa */
461#define GSM48_IE_MOBILE_ID 0x17
462#define GSM48_IE_NAME_LONG 0x43 /* 10.5.3.5a */
463#define GSM48_IE_NAME_SHORT 0x45 /* 10.5.3.5a */
464#define GSM48_IE_UTC 0x46 /* 10.5.3.8 */
465#define GSM48_IE_NET_TIME_TZ 0x47 /* 10.5.3.9 */
466#define GSM48_IE_LSA_IDENT 0x48 /* 10.5.3.11 */
467
468#define GSM48_IE_BEARER_CAP 0x04 /* 10.5.4.5 */
469#define GSM48_IE_CAUSE 0x08 /* 10.5.4.11 */
470#define GSM48_IE_CC_CAP 0x15 /* 10.5.4.5a */
471#define GSM48_IE_ALERT 0x19 /* 10.5.4.26 */
472#define GSM48_IE_FACILITY 0x1c /* 10.5.4.15 */
473#define GSM48_IE_PROGR_IND 0x1e /* 10.5.4.21 */
474#define GSM48_IE_AUX_STATUS 0x24 /* 10.5.4.4 */
475#define GSM48_IE_NOTIFY 0x27 /* 10.5.4.20 */
476#define GSM48_IE_KPD_FACILITY 0x2c /* 10.5.4.17 */
477#define GSM48_IE_SIGNAL 0x34 /* 10.5.4.23 */
478#define GSM48_IE_CONN_BCD 0x4c /* 10.5.4.13 */
479#define GSM48_IE_CONN_SUB 0x4d /* 10.5.4.14 */
480#define GSM48_IE_CALLING_BCD 0x5c /* 10.5.4.9 */
481#define GSM48_IE_CALLING_SUB 0x5d /* 10.5.4.10 */
482#define GSM48_IE_CALLED_BCD 0x5e /* 10.5.4.7 */
483#define GSM48_IE_CALLED_SUB 0x6d /* 10.5.4.8 */
484#define GSM48_IE_REDIR_BCD 0x74 /* 10.5.4.21a */
485#define GSM48_IE_REDIR_SUB 0x75 /* 10.5.4.21b */
486#define GSM48_IE_LOWL_COMPAT 0x7c /* 10.5.4.18 */
487#define GSM48_IE_HIGHL_COMPAT 0x7d /* 10.5.4.16 */
488#define GSM48_IE_USER_USER 0x7e /* 10.5.4.25 */
489#define GSM48_IE_SS_VERS 0x7f /* 10.5.4.24 */
490#define GSM48_IE_MORE_DATA 0xa0 /* 10.5.4.19 */
491#define GSM48_IE_CLIR_SUPP 0xa1 /* 10.5.4.11a */
492#define GSM48_IE_CLIR_INVOC 0xa2 /* 10.5.4.11b */
493#define GSM48_IE_REV_C_SETUP 0xa3 /* 10.5.4.22a */
494#define GSM48_IE_REPEAT_CIR 0xd1 /* 10.5.4.22 */
495#define GSM48_IE_REPEAT_SEQ 0xd3 /* 10.5.4.22 */
496
497/* Section 10.5.4.11 / Table 10.5.122 */
498#define GSM48_CAUSE_CS_GSM 0x60
499
500/* Section 9.1.2 / Table 9.3 */
501#define GSM48_IE_FRQLIST_AFTER 0x05
502#define GSM48_IE_CELL_CH_DESC 0x62
503#define GSM48_IE_MSLOT_DESC 0x10
504#define GSM48_IE_CHANMODE_1 0x63
505#define GSM48_IE_CHANMODE_2 0x11
506#define GSM48_IE_CHANMODE_3 0x13
507#define GSM48_IE_CHANMODE_4 0x14
508#define GSM48_IE_CHANMODE_5 0x15
509#define GSM48_IE_CHANMODE_6 0x16
510#define GSM48_IE_CHANMODE_7 0x17
511#define GSM48_IE_CHANMODE_8 0x18
512#define GSM48_IE_CHANDESC_2 0x64
513/* FIXME */
514
515/* Section 10.5.4.23 / Table 10.5.130 */
516enum gsm48_signal_val {
517 GSM48_SIGNAL_DIALTONE = 0x00,
518 GSM48_SIGNAL_RINGBACK = 0x01,
519 GSM48_SIGNAL_INTERCEPT = 0x02,
520 GSM48_SIGNAL_NET_CONG = 0x03,
521 GSM48_SIGNAL_BUSY = 0x04,
522 GSM48_SIGNAL_CONFIRM = 0x05,
523 GSM48_SIGNAL_ANSWER = 0x06,
524 GSM48_SIGNAL_CALL_WAIT = 0x07,
525 GSM48_SIGNAL_OFF_HOOK = 0x08,
526 GSM48_SIGNAL_OFF = 0x3f,
527 GSM48_SIGNAL_ALERT_OFF = 0x4f,
528};
529
530enum gsm48_cause_loc {
531 GSM48_CAUSE_LOC_USER = 0x00,
532 GSM48_CAUSE_LOC_PRN_S_LU = 0x01,
533 GSM48_CAUSE_LOC_PUN_S_LU = 0x02,
534 GSM48_CAUSE_LOC_TRANS_NET = 0x03,
535 GSM48_CAUSE_LOC_PUN_S_RU = 0x04,
536 GSM48_CAUSE_LOC_PRN_S_RU = 0x05,
537 /* not defined */
538 GSM48_CAUSE_LOC_INN_NET = 0x07,
539 GSM48_CAUSE_LOC_NET_BEYOND = 0x0a,
540};
541
542/* Section 10.5.2.31 RR Cause / Table 10.5.70 */
543enum gsm48_rr_cause {
544 GSM48_RR_CAUSE_NORMAL = 0x00,
545 GSM48_RR_CAUSE_ABNORMAL_UNSPEC = 0x01,
546 GSM48_RR_CAUSE_ABNORMAL_UNACCT = 0x02,
547 GSM48_RR_CAUSE_ABNORMAL_TIMER = 0x03,
548 GSM48_RR_CAUSE_ABNORMAL_NOACT = 0x04,
549 GSM48_RR_CAUSE_PREMPTIVE_REL = 0x05,
550 GSM48_RR_CAUSE_HNDOVER_IMP = 0x06,
551 GSM48_RR_CAUSE_CHAN_MODE_UNACCT = 0x07,
552 GSM48_RR_CAUSE_FREQ_NOT_IMPL = 0x08,
553 GSM48_RR_CAUSE_CALL_CLEARED = 0x41,
554 GSM48_RR_CAUSE_SEMANT_INCORR = 0x5f,
555 GSM48_RR_CAUSE_INVALID_MAND_INF = 0x60,
556 GSM48_RR_CAUSE_MSG_TYPE_N = 0x61,
557 GSM48_RR_CAUSE_MSG_TYPE_N_COMPAT= 0x62,
558 GSM48_RR_CAUSE_COND_IE_ERROR = 0x64,
559 GSM48_RR_CAUSE_NO_CELL_ALLOC_A = 0x65,
560 GSM48_RR_CAUSE_PROT_ERROR_UNSPC = 0x6f,
561};
562
563/* Section 10.5.4.11 CC Cause / Table 10.5.123 */
564enum gsm48_cc_cause {
565 GSM48_CC_CAUSE_UNASSIGNED_NR = 1,
566 GSM48_CC_CAUSE_NO_ROUTE = 3,
567 GSM48_CC_CAUSE_CHAN_UNACCEPT = 6,
568 GSM48_CC_CAUSE_OP_DET_BARRING = 8,
569 GSM48_CC_CAUSE_NORM_CALL_CLEAR = 16,
570 GSM48_CC_CAUSE_USER_BUSY = 17,
571 GSM48_CC_CAUSE_USER_NOTRESPOND = 18,
572 GSM48_CC_CAUSE_USER_ALERTING_NA = 19,
573 GSM48_CC_CAUSE_CALL_REJECTED = 21,
574 GSM48_CC_CAUSE_NUMBER_CHANGED = 22,
575 GSM48_CC_CAUSE_PRE_EMPTION = 25,
576 GSM48_CC_CAUSE_NONSE_USER_CLR = 26,
577 GSM48_CC_CAUSE_DEST_OOO = 27,
578 GSM48_CC_CAUSE_INV_NR_FORMAT = 28,
579 GSM48_CC_CAUSE_FACILITY_REJ = 29,
580 GSM48_CC_CAUSE_RESP_STATUS_INQ = 30,
581 GSM48_CC_CAUSE_NORMAL_UNSPEC = 31,
582 GSM48_CC_CAUSE_NO_CIRCUIT_CHAN = 34,
583 GSM48_CC_CAUSE_NETWORK_OOO = 38,
584 GSM48_CC_CAUSE_TEMP_FAILURE = 41,
585 GSM48_CC_CAUSE_SWITCH_CONG = 42,
586 GSM48_CC_CAUSE_ACC_INF_DISCARD = 43,
587 GSM48_CC_CAUSE_REQ_CHAN_UNAVAIL = 44,
588 GSM48_CC_CAUSE_RESOURCE_UNAVAIL = 47,
589 GSM48_CC_CAUSE_QOS_UNAVAIL = 49,
590 GSM48_CC_CAUSE_REQ_FAC_NOT_SUBSC= 50,
591 GSM48_CC_CAUSE_INC_BARRED_CUG = 55,
592 GSM48_CC_CAUSE_BEARER_CAP_UNAUTH= 57,
593 GSM48_CC_CAUSE_BEARER_CA_UNAVAIL= 58,
594 GSM48_CC_CAUSE_SERV_OPT_UNAVAIL = 63,
595 GSM48_CC_CAUSE_BEARERSERV_UNIMPL= 65,
596 GSM48_CC_CAUSE_ACM_GE_ACM_MAX = 68,
597 GSM48_CC_CAUSE_REQ_FAC_NOTIMPL = 69,
598 GSM48_CC_CAUSE_RESTR_BCAP_AVAIL = 70,
599 GSM48_CC_CAUSE_SERV_OPT_UNIMPL = 79,
600 GSM48_CC_CAUSE_INVAL_TRANS_ID = 81,
601 GSM48_CC_CAUSE_USER_NOT_IN_CUG = 87,
602 GSM48_CC_CAUSE_INCOMPAT_DEST = 88,
603 GSM48_CC_CAUSE_INVAL_TRANS_NET = 91,
604 GSM48_CC_CAUSE_SEMANTIC_INCORR = 95,
605 GSM48_CC_CAUSE_INVAL_MAND_INF = 96,
606 GSM48_CC_CAUSE_MSGTYPE_NOTEXIST = 97,
607 GSM48_CC_CAUSE_MSGTYPE_INCOMPAT = 98,
608 GSM48_CC_CAUSE_IE_NOTEXIST = 99,
609 GSM48_CC_CAUSE_COND_IE_ERR = 100,
610 GSM48_CC_CAUSE_MSG_INCOMP_STATE = 101,
611 GSM48_CC_CAUSE_RECOVERY_TIMER = 102,
612 GSM48_CC_CAUSE_PROTO_ERR = 111,
613 GSM48_CC_CAUSE_INTERWORKING = 127,
614};
615
616/* Annex G, GSM specific cause values for mobility management */
617enum gsm48_reject_value {
618 GSM48_REJECT_IMSI_UNKNOWN_IN_HLR = 2,
619 GSM48_REJECT_ILLEGAL_MS = 3,
620 GSM48_REJECT_IMSI_UNKNOWN_IN_VLR = 4,
621 GSM48_REJECT_IMEI_NOT_ACCEPTED = 5,
622 GSM48_REJECT_ILLEGAL_ME = 6,
623 GSM48_REJECT_PLMN_NOT_ALLOWED = 11,
624 GSM48_REJECT_LOC_NOT_ALLOWED = 12,
625 GSM48_REJECT_ROAMING_NOT_ALLOWED = 13,
626 GSM48_REJECT_NETWORK_FAILURE = 17,
627 GSM48_REJECT_CONGESTION = 22,
628 GSM48_REJECT_SRV_OPT_NOT_SUPPORTED = 32,
629 GSM48_REJECT_RQD_SRV_OPT_NOT_SUPPORTED = 33,
630 GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER = 34,
631 GSM48_REJECT_CALL_CAN_NOT_BE_IDENTIFIED = 38,
632 GSM48_REJECT_INCORRECT_MESSAGE = 95,
633 GSM48_REJECT_INVALID_MANDANTORY_INF = 96,
634 GSM48_REJECT_MSG_TYPE_NOT_IMPLEMENTED = 97,
635 GSM48_REJECT_MSG_TYPE_NOT_COMPATIBLE = 98,
636 GSM48_REJECT_INF_ELEME_NOT_IMPLEMENTED = 99,
637 GSM48_REJECT_CONDTIONAL_IE_ERROR = 100,
638 GSM48_REJECT_MSG_NOT_COMPATIBLE = 101,
639 GSM48_REJECT_PROTOCOL_ERROR = 111,
640
641 /* according to G.6 Additional cause codes for GMM */
642 GSM48_REJECT_GPRS_NOT_ALLOWED = 7,
643 GSM48_REJECT_SERVICES_NOT_ALLOWED = 8,
644 GSM48_REJECT_MS_IDENTITY_NOT_DERVIVABLE = 9,
645 GSM48_REJECT_IMPLICITLY_DETACHED = 10,
646 GSM48_REJECT_GPRS_NOT_ALLOWED_IN_PLMN = 14,
647 GSM48_REJECT_MSC_TMP_NOT_REACHABLE = 16,
648};
649
650enum chreq_type {
651 CHREQ_T_EMERG_CALL,
652 CHREQ_T_CALL_REEST_TCH_F,
653 CHREQ_T_CALL_REEST_TCH_H,
654 CHREQ_T_CALL_REEST_TCH_H_DBL,
655 CHREQ_T_SDCCH,
656 CHREQ_T_TCH_F,
657 CHREQ_T_VOICE_CALL_TCH_H,
658 CHREQ_T_DATA_CALL_TCH_H,
659 CHREQ_T_LOCATION_UPD,
660 CHREQ_T_PAG_R_ANY_NECI0,
661 CHREQ_T_PAG_R_ANY_NECI1,
662 CHREQ_T_PAG_R_TCH_F,
663 CHREQ_T_PAG_R_TCH_FH,
664 CHREQ_T_LMU,
665 CHREQ_T_RESERVED_SDCCH,
666 CHREQ_T_RESERVED_IGNORE,
667};
668
669/* Chapter 11.3 */
670#define GSM48_T301 180, 0
671#define GSM48_T303 30, 0
672#define GSM48_T305 30, 0
673#define GSM48_T306 30, 0
674#define GSM48_T308 10, 0
675#define GSM48_T310 180, 0
676#define GSM48_T313 30, 0
677#define GSM48_T323 30, 0
678#define GSM48_T331 30, 0
679#define GSM48_T333 30, 0
680#define GSM48_T334 25, 0 /* min 15 */
681#define GSM48_T338 30, 0
682
683/* Chapter 5.1.2.2 */
684#define GSM_CSTATE_NULL 0
685#define GSM_CSTATE_INITIATED 1
686#define GSM_CSTATE_MO_CALL_PROC 3
687#define GSM_CSTATE_CALL_DELIVERED 4
688#define GSM_CSTATE_CALL_PRESENT 6
689#define GSM_CSTATE_CALL_RECEIVED 7
690#define GSM_CSTATE_CONNECT_REQUEST 8
691#define GSM_CSTATE_MO_TERM_CALL_CONF 9
692#define GSM_CSTATE_ACTIVE 10
693#define GSM_CSTATE_DISCONNECT_REQ 12
694#define GSM_CSTATE_DISCONNECT_IND 12
695#define GSM_CSTATE_RELEASE_REQ 19
696#define GSM_CSTATE_MO_ORIG_MODIFY 26
697#define GSM_CSTATE_MO_TERM_MODIFY 27
698#define GSM_CSTATE_CONNECT_IND 28
699
700#define SBIT(a) (1 << a)
701#define ALL_STATES 0xffffffff
702
703/* Table 10.5.3/3GPP TS 04.08: Location Area Identification information element */
704#define GSM_LAC_RESERVED_DETACHED 0x0
705#define GSM_LAC_RESERVED_ALL_BTS 0xfffe
706
707/* GSM 04.08 Bearer Capability: Information Transfer Capability */
708enum gsm48_bcap_itcap {
709 GSM48_BCAP_ITCAP_SPEECH = 0,
710 GSM48_BCAP_ITCAP_UNR_DIG_INF = 1,
711 GSM48_BCAP_ITCAP_3k1_AUDIO = 2,
712 GSM48_BCAP_ITCAP_FAX_G3 = 3,
713 GSM48_BCAP_ITCAP_OTHER = 5,
714 GSM48_BCAP_ITCAP_RESERVED = 7,
715};
716
717/* GSM 04.08 Bearer Capability: Transfer Mode */
718enum gsm48_bcap_tmod {
719 GSM48_BCAP_TMOD_CIRCUIT = 0,
720 GSM48_BCAP_TMOD_PACKET = 1,
721};
722
723/* GSM 04.08 Bearer Capability: Coding Standard */
724enum gsm48_bcap_coding {
725 GSM48_BCAP_CODING_GSM_STD = 0,
726};
727
728/* GSM 04.08 Bearer Capability: Radio Channel Requirements */
729enum gsm48_bcap_rrq {
730 GSM48_BCAP_RRQ_FR_ONLY = 1,
731 GSM48_BCAP_RRQ_DUAL_HR = 2,
732 GSM48_BCAP_RRQ_DUAL_FR = 3,
733};
734
735
736#define GSM48_TMSI_LEN 5
737#define GSM48_MID_TMSI_LEN (GSM48_TMSI_LEN + 2)
738#define GSM48_MI_SIZE 32
739
740
741#endif /* PROTO_GSM_04_08_H */