1 #ifndef PROTO_GSM_04_08_H
2 #define PROTO_GSM_04_08_H
6 /* GSM TS 04.08 definitions */
10 struct gsm48_classmark1 {
16 } __attribute__ ((packed));
18 /* Chapter 10.5.1.6 */
19 struct gsm48_classmark2 {
40 } __attribute__ ((packed));
42 /* Chapter 10.5.2.1b.3 */
43 struct gsm48_range_1024 {
75 } __attribute__ ((packed));
77 /* Chapter 10.5.2.1b.4 */
78 struct gsm48_range_512 {
79 uint8_t orig_arfcn_hi:1,
81 uint8_t orig_arfcn_mid;
110 } __attribute__ ((packed));
112 /* Chapter 10.5.2.1b.5 */
113 struct gsm48_range_256 {
114 uint8_t orig_arfcn_hi:1,
116 uint8_t orig_arfcn_mid;
151 } __attribute__ ((packed));
153 /* Chapter 10.5.2.1b.6 */
154 struct gsm48_range_128 {
155 uint8_t orig_arfcn_hi:1,
157 uint8_t orig_arfcn_mid;
194 } __attribute__ ((packed));
196 /* Chapter 10.5.2.1b.7 */
197 struct gsm48_var_bit {
198 uint8_t orig_arfcn_hi:1,
200 uint8_t orig_arfcn_mid;
203 uint8_t rrfcn8_111[13];
204 } __attribute__ ((packed));
206 /* Chapter 10.5.2.5 */
207 struct gsm48_chan_desc {
218 uint8_t arfcn_high:2,
225 } __attribute__ ((packed));
227 /* Chapter 10.5.2.20 */
228 struct gsm48_meas_res {
229 uint8_t rxlev_full:6,
235 uint8_t no_nc_n_hi:1,
241 uint8_t bsic_nc1_hi:3,
243 uint8_t rxlev_nc2_hi:5,
245 uint8_t bsic_nc2_hi:2,
248 uint8_t rxlev_nc3_hi:4,
250 uint8_t bsic_nc3_hi:1,
253 uint8_t rxlev_nc4_hi:3,
255 uint8_t bcch_f_nc4:5,
257 uint8_t rxlev_nc5_hi:2,
259 uint8_t bcch_f_nc5_hi:4,
261 uint8_t rxlev_nc6_hi:1,
264 uint8_t bcch_f_nc6_hi:3,
268 } __attribute__ ((packed));
270 /* Chapter 10.5.2.21aa */
271 struct gsm48_multi_rate_conf {
285 } __attribute__((packed));
287 /* Chapter 10.5.2.28(a) */
288 struct gsm48_power_cmd {
289 uint8_t power_level:5,
292 } __attribute__((packed));
294 /* Chapter 10.5.2.29 */
295 struct gsm48_rach_control {
302 } __attribute__ ((packed));
305 /* Chapter 10.5.2.30 */
306 struct gsm48_req_ref {
312 } __attribute__ ((packed));
314 /* Chapter 10.5.2.38 */
315 struct gsm48_start_time {
320 } __attribute__ ((packed));
322 /* Chapter 10.5.2.39 */
323 struct gsm48_sync_ind {
328 } __attribute__((packed));
331 * Chapter 9.1.5/9.1.6
333 * For 9.1.6 the chan_desc has the meaning of 10.5.2.5a
335 struct gsm48_chan_mode_modify {
336 struct gsm48_chan_desc chan_desc;
338 } __attribute__ ((packed));
340 enum gsm48_chan_mode {
341 GSM48_CMODE_SIGN = 0x00,
342 GSM48_CMODE_SPEECH_V1 = 0x01,
343 GSM48_CMODE_SPEECH_EFR = 0x21,
344 GSM48_CMODE_SPEECH_AMR = 0x41,
345 GSM48_CMODE_DATA_14k5 = 0x0f,
346 GSM48_CMODE_DATA_12k0 = 0x03,
347 GSM48_CMODE_DATA_6k0 = 0x0b,
348 GSM48_CMODE_DATA_3k6 = 0x23,
352 struct gsm48_ass_cmd {
353 /* Semantic is from 10.5.2.5a */
354 struct gsm48_chan_desc chan_desc;
355 uint8_t power_command;
357 } __attribute__((packed));
359 /* Chapter 10.5.2.2 */
360 struct gsm48_cell_desc {
365 } __attribute__((packed));
368 struct gsm48_ho_cmd {
369 struct gsm48_cell_desc cell_desc;
370 struct gsm48_chan_desc chan_desc;
372 uint8_t power_command;
374 } __attribute__((packed));
377 struct gsm48_imm_ass {
382 struct gsm48_chan_desc chan_desc;
383 struct gsm48_req_ref req_ref;
384 uint8_t timing_advance;
385 uint8_t mob_alloc_len;
386 uint8_t mob_alloc[0];
387 } __attribute__ ((packed));
389 /* Chapter 10.5.1.3 */
390 struct gsm48_loc_area_id {
391 uint8_t digits[3]; /* BCD! */
393 } __attribute__ ((packed));
396 struct gsm48_auth_req {
400 } __attribute__ ((packed));
403 struct gsm48_loc_upd_req {
406 struct gsm48_loc_area_id lai;
407 struct gsm48_classmark1 classmark1;
410 } __attribute__ ((packed));
417 } __attribute__ ((packed));
419 /* Section 9.1.3x System information Type header */
420 struct gsm48_system_information_type_header {
422 uint8_t rr_protocol_discriminator :4,
424 uint8_t system_information;
425 } __attribute__ ((packed));
427 /* Section 10.5.2.4 Cell Selection Parameters */
428 struct gsm48_cell_sel_par {
429 uint8_t ms_txpwr_max_ccch:5, /* GSM 05.08 MS-TXPWR-MAX-CCCH */
430 cell_resel_hyst:3; /* GSM 05.08 CELL-RESELECT-HYSTERESIS */
431 uint8_t rxlev_acc_min:6, /* GSM 05.08 RXLEV-ACCESS-MIN */
434 } __attribute__ ((packed));
436 /* Section 10.5.2.11 Control Channel Description , Figure 10.5.33 */
437 struct gsm48_control_channel_descr {
438 uint8_t ccch_conf :3,
442 uint8_t bs_pa_mfrms : 3,
445 } __attribute__ ((packed));
447 struct gsm48_cell_options {
448 uint8_t radio_link_timeout:4,
452 } __attribute__ ((packed));
454 /* Section 9.2.9 CM service request */
455 struct gsm48_service_request {
456 uint8_t cm_service_type : 4,
458 /* length + 3 bytes */
462 /* optional priority level */
463 } __attribute__ ((packed));
465 /* Section 9.1.31 System information Type 1 */
466 struct gsm48_system_information_type_1 {
467 struct gsm48_system_information_type_header header;
468 uint8_t cell_channel_description[16];
469 struct gsm48_rach_control rach_control;
470 uint8_t rest_octets[0]; /* NCH position on the CCCH */
471 } __attribute__ ((packed));
473 /* Section 9.1.32 System information Type 2 */
474 struct gsm48_system_information_type_2 {
475 struct gsm48_system_information_type_header header;
476 uint8_t bcch_frequency_list[16];
477 uint8_t ncc_permitted;
478 struct gsm48_rach_control rach_control;
479 } __attribute__ ((packed));
481 /* Section 9.1.33 System information Type 2bis */
482 struct gsm48_system_information_type_2bis {
483 struct gsm48_system_information_type_header header;
484 uint8_t bcch_frequency_list[16];
485 struct gsm48_rach_control rach_control;
486 uint8_t rest_octets[0];
487 } __attribute__ ((packed));
489 /* Section 9.1.34 System information Type 2ter */
490 struct gsm48_system_information_type_2ter {
491 struct gsm48_system_information_type_header header;
492 uint8_t ext_bcch_frequency_list[16];
493 uint8_t rest_octets[0];
494 } __attribute__ ((packed));
496 /* Section 9.1.35 System information Type 3 */
497 struct gsm48_system_information_type_3 {
498 struct gsm48_system_information_type_header header;
499 uint16_t cell_identity;
500 struct gsm48_loc_area_id lai;
501 struct gsm48_control_channel_descr control_channel_desc;
502 struct gsm48_cell_options cell_options;
503 struct gsm48_cell_sel_par cell_sel_par;
504 struct gsm48_rach_control rach_control;
505 uint8_t rest_octets[0];
506 } __attribute__ ((packed));
508 /* Section 9.1.36 System information Type 4 */
509 struct gsm48_system_information_type_4 {
510 struct gsm48_system_information_type_header header;
511 struct gsm48_loc_area_id lai;
512 struct gsm48_cell_sel_par cell_sel_par;
513 struct gsm48_rach_control rach_control;
514 /* optional CBCH conditional CBCH... followed by
515 mandantory SI 4 Reset Octets
518 } __attribute__ ((packed));
520 /* Section 9.1.37 System information Type 5 */
521 struct gsm48_system_information_type_5 {
522 uint8_t rr_protocol_discriminator :4,
524 uint8_t system_information;
525 uint8_t bcch_frequency_list[16];
526 } __attribute__ ((packed));
528 /* Section 9.1.38 System information Type 5bis */
529 struct gsm48_system_information_type_5bis {
530 uint8_t rr_protocol_discriminator :4,
532 uint8_t system_information;
533 uint8_t bcch_frequency_list[16];
534 } __attribute__ ((packed));
536 /* Section 9.1.39 System information Type 5ter */
537 struct gsm48_system_information_type_5ter {
538 uint8_t rr_protocol_discriminator :4,
540 uint8_t system_information;
541 uint8_t bcch_frequency_list[16];
542 } __attribute__ ((packed));
544 /* Section 9.1.40 System information Type 6 */
545 struct gsm48_system_information_type_6 {
546 uint8_t rr_protocol_discriminator :4,
548 uint8_t system_information;
549 uint16_t cell_identity;
550 struct gsm48_loc_area_id lai;
551 struct gsm48_cell_options cell_options;
552 uint8_t ncc_permitted;
553 uint8_t rest_octets[0];
554 } __attribute__ ((packed));
556 /* Section 9.1.43a System Information type 13 */
557 struct gsm48_system_information_type_13 {
558 struct gsm48_system_information_type_header header;
559 uint8_t rest_octets[0];
560 } __attribute__ ((packed));
562 /* Section 9.2.12 IMSI Detach Indication */
563 struct gsm48_imsi_detach_ind {
564 struct gsm48_classmark1 classmark1;
567 } __attribute__ ((packed));
570 struct gsm48_add_ass {
571 /* Semantic is from 10.5.2.5 */
572 struct gsm48_chan_desc chan_desc;
574 } __attribute__((packed));
577 struct gsm48_ass_cpl {
579 } __attribute__((packed));
582 struct gsm48_ass_fail {
584 } __attribute__((packed));
587 struct gsm48_chan_rel {
590 } __attribute__((packed));
593 struct gsm48_cip_mode_cmd {
598 } __attribute__((packed));
601 struct gsm48_cm_change {
603 struct gsm48_classmark2 cm2;
605 } __attribute__((packed));
608 struct gsm48_imm_ass_ext {
613 struct gsm48_chan_desc chan_desc1;
614 struct gsm48_req_ref req_ref1;
615 uint8_t timing_advance1;
616 struct gsm48_chan_desc chan_desc2;
617 struct gsm48_req_ref req_ref2;
618 uint8_t timing_advance2;
619 uint8_t mob_alloc_len;
620 uint8_t mob_alloc[0];
621 } __attribute__ ((packed));
624 struct gsm48_imm_ass_rej {
629 struct gsm48_req_ref req_ref1;
631 struct gsm48_req_ref req_ref2;
633 struct gsm48_req_ref req_ref3;
635 struct gsm48_req_ref req_ref4;
638 } __attribute__ ((packed));
641 struct gsm48_paging1 {
650 } __attribute__((packed));
653 struct gsm48_paging2 {
664 } __attribute__((packed));
667 struct gsm48_paging3 {
683 } __attribute__((packed));
686 struct gsm48_pag_rsp {
690 struct gsm48_classmark2 cm2;
692 } __attribute__((packed));
695 struct gsm48_rr_status {
697 } __attribute__((packed));
699 /* Section 10.2 + GSM 04.07 12.2.3.1.1 */
700 #define GSM48_PDISC_GROUP_CC 0x00
701 #define GSM48_PDISC_BCAST_CC 0x01
702 #define GSM48_PDISC_PDSS1 0x02
703 #define GSM48_PDISC_CC 0x03
704 #define GSM48_PDISC_PDSS2 0x04
705 #define GSM48_PDISC_MM 0x05
706 #define GSM48_PDISC_RR 0x06
707 #define GSM48_PDISC_MM_GPRS 0x08
708 #define GSM48_PDISC_SMS 0x09
709 #define GSM48_PDISC_SM_GPRS 0x0a
710 #define GSM48_PDISC_NC_SS 0x0b
711 #define GSM48_PDISC_LOC 0x0c
712 #define GSM48_PDISC_MASK 0x0f
713 #define GSM48_PDISC_USSD 0x11
716 #define GSM48_MT_RR_INIT_REQ 0x3c
717 #define GSM48_MT_RR_ADD_ASS 0x3b
718 #define GSM48_MT_RR_IMM_ASS 0x3f
719 #define GSM48_MT_RR_IMM_ASS_EXT 0x39
720 #define GSM48_MT_RR_IMM_ASS_REJ 0x3a
722 #define GSM48_MT_RR_CIPH_M_CMD 0x35
723 #define GSM48_MT_RR_CIPH_M_COMPL 0x32
725 #define GSM48_MT_RR_CFG_CHG_CMD 0x30
726 #define GSM48_MT_RR_CFG_CHG_ACK 0x31
727 #define GSM48_MT_RR_CFG_CHG_REJ 0x33
729 #define GSM48_MT_RR_ASS_CMD 0x2e
730 #define GSM48_MT_RR_ASS_COMPL 0x29
731 #define GSM48_MT_RR_ASS_FAIL 0x2f
732 #define GSM48_MT_RR_HANDO_CMD 0x2b
733 #define GSM48_MT_RR_HANDO_COMPL 0x2c
734 #define GSM48_MT_RR_HANDO_FAIL 0x28
735 #define GSM48_MT_RR_HANDO_INFO 0x2d
737 #define GSM48_MT_RR_CELL_CHG_ORDER 0x08
738 #define GSM48_MT_RR_PDCH_ASS_CMD 0x23
740 #define GSM48_MT_RR_CHAN_REL 0x0d
741 #define GSM48_MT_RR_PART_REL 0x0a
742 #define GSM48_MT_RR_PART_REL_COMP 0x0f
744 #define GSM48_MT_RR_PAG_REQ_1 0x21
745 #define GSM48_MT_RR_PAG_REQ_2 0x22
746 #define GSM48_MT_RR_PAG_REQ_3 0x24
747 #define GSM48_MT_RR_PAG_RESP 0x27
748 #define GSM48_MT_RR_NOTIF_NCH 0x20
749 #define GSM48_MT_RR_NOTIF_FACCH 0x25
750 #define GSM48_MT_RR_NOTIF_RESP 0x26
752 #define GSM48_MT_RR_SYSINFO_8 0x18
753 #define GSM48_MT_RR_SYSINFO_1 0x19
754 #define GSM48_MT_RR_SYSINFO_2 0x1a
755 #define GSM48_MT_RR_SYSINFO_3 0x1b
756 #define GSM48_MT_RR_SYSINFO_4 0x1c
757 #define GSM48_MT_RR_SYSINFO_5 0x1d
758 #define GSM48_MT_RR_SYSINFO_6 0x1e
759 #define GSM48_MT_RR_SYSINFO_7 0x1f
761 #define GSM48_MT_RR_SYSINFO_2bis 0x02
762 #define GSM48_MT_RR_SYSINFO_2ter 0x03
763 #define GSM48_MT_RR_SYSINFO_5bis 0x05
764 #define GSM48_MT_RR_SYSINFO_5ter 0x06
765 #define GSM48_MT_RR_SYSINFO_9 0x04
766 #define GSM48_MT_RR_SYSINFO_13 0x00
768 #define GSM48_MT_RR_SYSINFO_16 0x3d
769 #define GSM48_MT_RR_SYSINFO_17 0x3e
771 #define GSM48_MT_RR_CHAN_MODE_MODIF 0x10
772 #define GSM48_MT_RR_STATUS 0x12
773 #define GSM48_MT_RR_CHAN_MODE_MODIF_ACK 0x17
774 #define GSM48_MT_RR_FREQ_REDEF 0x14
775 #define GSM48_MT_RR_MEAS_REP 0x15
776 #define GSM48_MT_RR_CLSM_CHG 0x16
777 #define GSM48_MT_RR_CLSM_ENQ 0x13
778 #define GSM48_MT_RR_EXT_MEAS_REP 0x36
779 #define GSM48_MT_RR_EXT_MEAS_REP_ORD 0x37
780 #define GSM48_MT_RR_GPRS_SUSP_REQ 0x34
782 #define GSM48_MT_RR_VGCS_UPL_GRANT 0x08
783 #define GSM48_MT_RR_UPLINK_RELEASE 0x0e
784 #define GSM48_MT_RR_UPLINK_FREE 0x0c
785 #define GSM48_MT_RR_UPLINK_BUSY 0x2a
786 #define GSM48_MT_RR_TALKER_IND 0x11
788 #define GSM48_MT_RR_APP_INFO 0x38
790 /* Table 10.2/3GPP TS 04.08 */
791 #define GSM48_MT_MM_IMSI_DETACH_IND 0x01
792 #define GSM48_MT_MM_LOC_UPD_ACCEPT 0x02
793 #define GSM48_MT_MM_LOC_UPD_REJECT 0x04
794 #define GSM48_MT_MM_LOC_UPD_REQUEST 0x08
796 #define GSM48_MT_MM_AUTH_REJ 0x11
797 #define GSM48_MT_MM_AUTH_REQ 0x12
798 #define GSM48_MT_MM_AUTH_RESP 0x14
799 #define GSM48_MT_MM_ID_REQ 0x18
800 #define GSM48_MT_MM_ID_RESP 0x19
801 #define GSM48_MT_MM_TMSI_REALL_CMD 0x1a
802 #define GSM48_MT_MM_TMSI_REALL_COMPL 0x1b
804 #define GSM48_MT_MM_CM_SERV_ACC 0x21
805 #define GSM48_MT_MM_CM_SERV_REJ 0x22
806 #define GSM48_MT_MM_CM_SERV_ABORT 0x23
807 #define GSM48_MT_MM_CM_SERV_REQ 0x24
808 #define GSM48_MT_MM_CM_SERV_PROMPT 0x25
809 #define GSM48_MT_MM_CM_REEST_REQ 0x28
810 #define GSM48_MT_MM_ABORT 0x29
812 #define GSM48_MT_MM_NULL 0x30
813 #define GSM48_MT_MM_STATUS 0x31
814 #define GSM48_MT_MM_INFO 0x32
816 /* Table 10.3/3GPP TS 04.08 */
817 #define GSM48_MT_CC_ALERTING 0x01
818 #define GSM48_MT_CC_CALL_CONF 0x08
819 #define GSM48_MT_CC_CALL_PROC 0x02
820 #define GSM48_MT_CC_CONNECT 0x07
821 #define GSM48_MT_CC_CONNECT_ACK 0x0f
822 #define GSM48_MT_CC_EMERG_SETUP 0x0e
823 #define GSM48_MT_CC_PROGRESS 0x03
824 #define GSM48_MT_CC_ESTAB 0x04
825 #define GSM48_MT_CC_ESTAB_CONF 0x06
826 #define GSM48_MT_CC_RECALL 0x0b
827 #define GSM48_MT_CC_START_CC 0x09
828 #define GSM48_MT_CC_SETUP 0x05
830 #define GSM48_MT_CC_MODIFY 0x17
831 #define GSM48_MT_CC_MODIFY_COMPL 0x1f
832 #define GSM48_MT_CC_MODIFY_REJECT 0x13
833 #define GSM48_MT_CC_USER_INFO 0x10
834 #define GSM48_MT_CC_HOLD 0x18
835 #define GSM48_MT_CC_HOLD_ACK 0x19
836 #define GSM48_MT_CC_HOLD_REJ 0x1a
837 #define GSM48_MT_CC_RETR 0x1c
838 #define GSM48_MT_CC_RETR_ACK 0x1d
839 #define GSM48_MT_CC_RETR_REJ 0x1e
841 #define GSM48_MT_CC_DISCONNECT 0x25
842 #define GSM48_MT_CC_RELEASE 0x2d
843 #define GSM48_MT_CC_RELEASE_COMPL 0x2a
845 #define GSM48_MT_CC_CONG_CTRL 0x39
846 #define GSM48_MT_CC_NOTIFY 0x3e
847 #define GSM48_MT_CC_STATUS 0x3d
848 #define GSM48_MT_CC_STATUS_ENQ 0x34
849 #define GSM48_MT_CC_START_DTMF 0x35
850 #define GSM48_MT_CC_STOP_DTMF 0x31
851 #define GSM48_MT_CC_STOP_DTMF_ACK 0x32
852 #define GSM48_MT_CC_START_DTMF_ACK 0x36
853 #define GSM48_MT_CC_START_DTMF_REJ 0x37
854 #define GSM48_MT_CC_FACILITY 0x3a
856 /* FIXME: Table 10.4 / 10.4a (GPRS) */
858 /* Section 10.5.3.3 CM service type */
859 #define GSM48_CMSERV_MO_CALL_PACKET 1
860 #define GSM48_CMSERV_EMERGENCY 2
861 #define GSM48_CMSERV_SMS 4
862 #define GSM48_CMSERV_SUP_SERV 8
863 #define GSM48_CMSERV_VGCS 9
864 #define GSM48_CMSERV_VBS 10
865 #define GSM48_CMSERV_LOC_SERV 11
867 /* Section 10.5.2.26, Table 10.5.64 */
868 #define GSM48_PM_MASK 0x03
869 #define GSM48_PM_NORMAL 0x00
870 #define GSM48_PM_EXTENDED 0x01
871 #define GSM48_PM_REORG 0x02
872 #define GSM48_PM_SAME 0x03
874 /* Chapter 10.5.3.5 / Table 10.5.93 */
875 #define GSM48_LUPD_NORMAL 0x0
876 #define GSM48_LUPD_PERIODIC 0x1
877 #define GSM48_LUPD_IMSI_ATT 0x2
878 #define GSM48_LUPD_RESERVED 0x3
881 #define GSM_MI_TYPE_MASK 0x07
882 #define GSM_MI_TYPE_NONE 0x00
883 #define GSM_MI_TYPE_IMSI 0x01
884 #define GSM_MI_TYPE_IMEI 0x02
885 #define GSM_MI_TYPE_IMEISV 0x03
886 #define GSM_MI_TYPE_TMSI 0x04
887 #define GSM_MI_ODD 0x08
889 #define GSM48_IE_MOBILE_ID 0x17 /* 10.5.1.4 */
890 #define GSM48_IE_NAME_LONG 0x43 /* 10.5.3.5a */
891 #define GSM48_IE_NAME_SHORT 0x45 /* 10.5.3.5a */
892 #define GSM48_IE_UTC 0x46 /* 10.5.3.8 */
893 #define GSM48_IE_NET_TIME_TZ 0x47 /* 10.5.3.9 */
894 #define GSM48_IE_LSA_IDENT 0x48 /* 10.5.3.11 */
896 #define GSM48_IE_BEARER_CAP 0x04 /* 10.5.4.5 */
897 #define GSM48_IE_CAUSE 0x08 /* 10.5.4.11 */
898 #define GSM48_IE_CC_CAP 0x15 /* 10.5.4.5a */
899 #define GSM48_IE_ALERT 0x19 /* 10.5.4.26 */
900 #define GSM48_IE_FACILITY 0x1c /* 10.5.4.15 */
901 #define GSM48_IE_PROGR_IND 0x1e /* 10.5.4.21 */
902 #define GSM48_IE_AUX_STATUS 0x24 /* 10.5.4.4 */
903 #define GSM48_IE_NOTIFY 0x27 /* 10.5.4.20 */
904 #define GSM48_IE_KPD_FACILITY 0x2c /* 10.5.4.17 */
905 #define GSM48_IE_SIGNAL 0x34 /* 10.5.4.23 */
906 #define GSM48_IE_CONN_BCD 0x4c /* 10.5.4.13 */
907 #define GSM48_IE_CONN_SUB 0x4d /* 10.5.4.14 */
908 #define GSM48_IE_CALLING_BCD 0x5c /* 10.5.4.9 */
909 #define GSM48_IE_CALLING_SUB 0x5d /* 10.5.4.10 */
910 #define GSM48_IE_CALLED_BCD 0x5e /* 10.5.4.7 */
911 #define GSM48_IE_CALLED_SUB 0x6d /* 10.5.4.8 */
912 #define GSM48_IE_REDIR_BCD 0x74 /* 10.5.4.21a */
913 #define GSM48_IE_REDIR_SUB 0x75 /* 10.5.4.21b */
914 #define GSM48_IE_LOWL_COMPAT 0x7c /* 10.5.4.18 */
915 #define GSM48_IE_HIGHL_COMPAT 0x7d /* 10.5.4.16 */
916 #define GSM48_IE_USER_USER 0x7e /* 10.5.4.25 */
917 #define GSM48_IE_SS_VERS 0x7f /* 10.5.4.24 */
918 #define GSM48_IE_MORE_DATA 0xa0 /* 10.5.4.19 */
919 #define GSM48_IE_CLIR_SUPP 0xa1 /* 10.5.4.11a */
920 #define GSM48_IE_CLIR_INVOC 0xa2 /* 10.5.4.11b */
921 #define GSM48_IE_REV_C_SETUP 0xa3 /* 10.5.4.22a */
922 #define GSM48_IE_REPEAT_CIR 0xd1 /* 10.5.4.22 */
923 #define GSM48_IE_REPEAT_SEQ 0xd3 /* 10.5.4.22 */
925 /* Section 10.5.4.11 / Table 10.5.122 */
926 #define GSM48_CAUSE_CS_GSM 0x60
929 #define GSM48_IE_VGCS_TARGET 0x01
930 #define GSM48_IE_FRQSHORT_AFTER 0x02
931 #define GSM48_IE_MUL_RATE_CFG 0x03 /* 10.5.2.21aa */
932 #define GSM48_IE_FRQLIST_AFTER 0x05
933 #define GSM48_IE_MSLOT_DESC 0x10
934 #define GSM48_IE_CHANMODE_2 0x11
935 #define GSM48_IE_FRQSHORT_BEFOR 0x12
936 #define GSM48_IE_CHANMODE_3 0x13
937 #define GSM48_IE_CHANMODE_4 0x14
938 #define GSM48_IE_CHANMODE_5 0x15
939 #define GSM48_IE_CHANMODE_6 0x16
940 #define GSM48_IE_CHANMODE_7 0x17
941 #define GSM48_IE_CHANMODE_8 0x18
942 #define GSM48_IE_FRQLIST_BEFORE 0x19
943 #define GSM48_IE_CHDES_1_BEFORE 0x1c
944 #define GSM48_IE_CHDES_2_BEFORE 0x1d
945 #define GSM48_IE_FRQSEQ_BEFORE 0x1e
946 #define GSM48_IE_CLASSMARK3 0x20
947 #define GSM48_IE_MOB_AL_BEFORE 0x21
948 #define GSM48_IE_RR_PACKET_UL 0x22
949 #define GSM48_IE_RR_PACKET_DL 0x23
950 #define GSM48_IE_CELL_CH_DESC 0x62
951 #define GSM48_IE_CHANMODE_1 0x63
952 #define GSM48_IE_CHDES_2_AFTER 0x64
953 #define GSM48_IE_MODE_SEC_CH 0x66
954 #define GSM48_IE_FRQSEQ_AFTER 0x69
955 #define GSM48_IE_MOB_AL_AFTER 0x72
956 #define GSM48_IE_BA_RANGE 0x73
957 #define GSM48_IE_GROUP_CHDES 0x74
958 #define GSM48_IE_BA_LIST_PREF 0x75
959 #define GSM48_IE_MOB_OVSERV_DIF 0x77
960 #define GSM48_IE_REALTIME_DIFF 0x7b
961 #define GSM48_IE_START_TIME 0x7c
962 #define GSM48_IE_TIMING_ADVANCE 0x7d
963 #define GSM48_IE_GROUP_CIP_SEQ 0x80
964 #define GSM48_IE_CIP_MODE_SET 0x90
965 #define GSM48_IE_GPRS_RESUMPT 0xc0
966 #define GSM48_IE_SYNC_IND 0xd0
967 /* System Information 4 (types are equal IEs above) */
968 #define GSM48_IE_CBCH_CHAN_DESC 0x64
969 #define GSM48_IE_CBCH_MOB_AL 0x72
971 /* Additional MM elements */
972 #define GSM48_IE_LOCATION_AREA 0x13
973 #define GSM48_IE_PRIORITY_LEV 0x80
974 #define GSM48_IE_FOLLOW_ON_PROC 0xa1
975 #define GSM48_IE_CTS_PERMISSION 0xa2
979 /* Section 10.5.4.23 / Table 10.5.130 */
980 enum gsm48_signal_val {
981 GSM48_SIGNAL_DIALTONE = 0x00,
982 GSM48_SIGNAL_RINGBACK = 0x01,
983 GSM48_SIGNAL_INTERCEPT = 0x02,
984 GSM48_SIGNAL_NET_CONG = 0x03,
985 GSM48_SIGNAL_BUSY = 0x04,
986 GSM48_SIGNAL_CONFIRM = 0x05,
987 GSM48_SIGNAL_ANSWER = 0x06,
988 GSM48_SIGNAL_CALL_WAIT = 0x07,
989 GSM48_SIGNAL_OFF_HOOK = 0x08,
990 GSM48_SIGNAL_OFF = 0x3f,
991 GSM48_SIGNAL_ALERT_OFF = 0x4f,
994 enum gsm48_cause_loc {
995 GSM48_CAUSE_LOC_USER = 0x00,
996 GSM48_CAUSE_LOC_PRN_S_LU = 0x01,
997 GSM48_CAUSE_LOC_PUN_S_LU = 0x02,
998 GSM48_CAUSE_LOC_TRANS_NET = 0x03,
999 GSM48_CAUSE_LOC_PUN_S_RU = 0x04,
1000 GSM48_CAUSE_LOC_PRN_S_RU = 0x05,
1002 GSM48_CAUSE_LOC_INN_NET = 0x07,
1003 GSM48_CAUSE_LOC_NET_BEYOND = 0x0a,
1006 /* Section 10.5.2.31 RR Cause / Table 10.5.70 */
1007 enum gsm48_rr_cause {
1008 GSM48_RR_CAUSE_NORMAL = 0x00,
1009 GSM48_RR_CAUSE_ABNORMAL_UNSPEC = 0x01,
1010 GSM48_RR_CAUSE_ABNORMAL_UNACCT = 0x02,
1011 GSM48_RR_CAUSE_ABNORMAL_TIMER = 0x03,
1012 GSM48_RR_CAUSE_ABNORMAL_NOACT = 0x04,
1013 GSM48_RR_CAUSE_PREMPTIVE_REL = 0x05,
1014 GSM48_RR_CAUSE_HNDOVER_IMP = 0x06,
1015 GSM48_RR_CAUSE_CHAN_MODE_UNACCT = 0x07,
1016 GSM48_RR_CAUSE_FREQ_NOT_IMPL = 0x08,
1017 GSM48_RR_CAUSE_CALL_CLEARED = 0x41,
1018 GSM48_RR_CAUSE_SEMANT_INCORR = 0x5f,
1019 GSM48_RR_CAUSE_INVALID_MAND_INF = 0x60,
1020 GSM48_RR_CAUSE_MSG_TYPE_N = 0x61,
1021 GSM48_RR_CAUSE_MSG_TYPE_N_COMPAT= 0x62,
1022 GSM48_RR_CAUSE_COND_IE_ERROR = 0x64,
1023 GSM48_RR_CAUSE_NO_CELL_ALLOC_A = 0x65,
1024 GSM48_RR_CAUSE_PROT_ERROR_UNSPC = 0x6f,
1027 /* Section 10.5.4.11 CC Cause / Table 10.5.123 */
1028 enum gsm48_cc_cause {
1029 GSM48_CC_CAUSE_UNASSIGNED_NR = 1,
1030 GSM48_CC_CAUSE_NO_ROUTE = 3,
1031 GSM48_CC_CAUSE_CHAN_UNACCEPT = 6,
1032 GSM48_CC_CAUSE_OP_DET_BARRING = 8,
1033 GSM48_CC_CAUSE_NORM_CALL_CLEAR = 16,
1034 GSM48_CC_CAUSE_USER_BUSY = 17,
1035 GSM48_CC_CAUSE_USER_NOTRESPOND = 18,
1036 GSM48_CC_CAUSE_USER_ALERTING_NA = 19,
1037 GSM48_CC_CAUSE_CALL_REJECTED = 21,
1038 GSM48_CC_CAUSE_NUMBER_CHANGED = 22,
1039 GSM48_CC_CAUSE_PRE_EMPTION = 25,
1040 GSM48_CC_CAUSE_NONSE_USER_CLR = 26,
1041 GSM48_CC_CAUSE_DEST_OOO = 27,
1042 GSM48_CC_CAUSE_INV_NR_FORMAT = 28,
1043 GSM48_CC_CAUSE_FACILITY_REJ = 29,
1044 GSM48_CC_CAUSE_RESP_STATUS_INQ = 30,
1045 GSM48_CC_CAUSE_NORMAL_UNSPEC = 31,
1046 GSM48_CC_CAUSE_NO_CIRCUIT_CHAN = 34,
1047 GSM48_CC_CAUSE_NETWORK_OOO = 38,
1048 GSM48_CC_CAUSE_TEMP_FAILURE = 41,
1049 GSM48_CC_CAUSE_SWITCH_CONG = 42,
1050 GSM48_CC_CAUSE_ACC_INF_DISCARD = 43,
1051 GSM48_CC_CAUSE_REQ_CHAN_UNAVAIL = 44,
1052 GSM48_CC_CAUSE_RESOURCE_UNAVAIL = 47,
1053 GSM48_CC_CAUSE_QOS_UNAVAIL = 49,
1054 GSM48_CC_CAUSE_REQ_FAC_NOT_SUBSC= 50,
1055 GSM48_CC_CAUSE_INC_BARRED_CUG = 55,
1056 GSM48_CC_CAUSE_BEARER_CAP_UNAUTH= 57,
1057 GSM48_CC_CAUSE_BEARER_CA_UNAVAIL= 58,
1058 GSM48_CC_CAUSE_SERV_OPT_UNAVAIL = 63,
1059 GSM48_CC_CAUSE_BEARERSERV_UNIMPL= 65,
1060 GSM48_CC_CAUSE_ACM_GE_ACM_MAX = 68,
1061 GSM48_CC_CAUSE_REQ_FAC_NOTIMPL = 69,
1062 GSM48_CC_CAUSE_RESTR_BCAP_AVAIL = 70,
1063 GSM48_CC_CAUSE_SERV_OPT_UNIMPL = 79,
1064 GSM48_CC_CAUSE_INVAL_TRANS_ID = 81,
1065 GSM48_CC_CAUSE_USER_NOT_IN_CUG = 87,
1066 GSM48_CC_CAUSE_INCOMPAT_DEST = 88,
1067 GSM48_CC_CAUSE_INVAL_TRANS_NET = 91,
1068 GSM48_CC_CAUSE_SEMANTIC_INCORR = 95,
1069 GSM48_CC_CAUSE_INVAL_MAND_INF = 96,
1070 GSM48_CC_CAUSE_MSGTYPE_NOTEXIST = 97,
1071 GSM48_CC_CAUSE_MSGTYPE_INCOMPAT = 98,
1072 GSM48_CC_CAUSE_IE_NOTEXIST = 99,
1073 GSM48_CC_CAUSE_COND_IE_ERR = 100,
1074 GSM48_CC_CAUSE_MSG_INCOMP_STATE = 101,
1075 GSM48_CC_CAUSE_RECOVERY_TIMER = 102,
1076 GSM48_CC_CAUSE_PROTO_ERR = 111,
1077 GSM48_CC_CAUSE_INTERWORKING = 127,
1080 /* Annex G, GSM specific cause values for mobility management */
1081 enum gsm48_reject_value {
1082 GSM48_REJECT_IMSI_UNKNOWN_IN_HLR = 2,
1083 GSM48_REJECT_ILLEGAL_MS = 3,
1084 GSM48_REJECT_IMSI_UNKNOWN_IN_VLR = 4,
1085 GSM48_REJECT_IMEI_NOT_ACCEPTED = 5,
1086 GSM48_REJECT_ILLEGAL_ME = 6,
1087 GSM48_REJECT_PLMN_NOT_ALLOWED = 11,
1088 GSM48_REJECT_LOC_NOT_ALLOWED = 12,
1089 GSM48_REJECT_ROAMING_NOT_ALLOWED = 13,
1090 GSM48_REJECT_NETWORK_FAILURE = 17,
1091 GSM48_REJECT_CONGESTION = 22,
1092 GSM48_REJECT_SRV_OPT_NOT_SUPPORTED = 32,
1093 GSM48_REJECT_RQD_SRV_OPT_NOT_SUPPORTED = 33,
1094 GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER = 34,
1095 GSM48_REJECT_CALL_CAN_NOT_BE_IDENTIFIED = 38,
1096 GSM48_REJECT_INCORRECT_MESSAGE = 95,
1097 GSM48_REJECT_INVALID_MANDANTORY_INF = 96,
1098 GSM48_REJECT_MSG_TYPE_NOT_IMPLEMENTED = 97,
1099 GSM48_REJECT_MSG_TYPE_NOT_COMPATIBLE = 98,
1100 GSM48_REJECT_INF_ELEME_NOT_IMPLEMENTED = 99,
1101 GSM48_REJECT_CONDTIONAL_IE_ERROR = 100,
1102 GSM48_REJECT_MSG_NOT_COMPATIBLE = 101,
1103 GSM48_REJECT_PROTOCOL_ERROR = 111,
1105 /* according to G.6 Additional cause codes for GMM */
1106 GSM48_REJECT_GPRS_NOT_ALLOWED = 7,
1107 GSM48_REJECT_SERVICES_NOT_ALLOWED = 8,
1108 GSM48_REJECT_MS_IDENTITY_NOT_DERVIVABLE = 9,
1109 GSM48_REJECT_IMPLICITLY_DETACHED = 10,
1110 GSM48_REJECT_GPRS_NOT_ALLOWED_IN_PLMN = 14,
1111 GSM48_REJECT_MSC_TMP_NOT_REACHABLE = 16,
1116 CHREQ_T_CALL_REEST_TCH_F,
1117 CHREQ_T_CALL_REEST_TCH_H,
1118 CHREQ_T_CALL_REEST_TCH_H_DBL,
1121 CHREQ_T_VOICE_CALL_TCH_H,
1122 CHREQ_T_DATA_CALL_TCH_H,
1123 CHREQ_T_LOCATION_UPD,
1124 CHREQ_T_PAG_R_ANY_NECI0,
1125 CHREQ_T_PAG_R_ANY_NECI1,
1126 CHREQ_T_PAG_R_TCH_F,
1127 CHREQ_T_PAG_R_TCH_FH,
1129 CHREQ_T_RESERVED_SDCCH,
1130 CHREQ_T_RESERVED_IGNORE,
1134 #define GSM48_T301 180, 0
1135 #define GSM48_T303 30, 0
1136 #define GSM48_T305 30, 0
1137 #define GSM48_T306 30, 0
1138 #define GSM48_T308 10, 0
1139 #define GSM48_T310 180, 0
1140 #define GSM48_T313 30, 0
1141 #define GSM48_T323 30, 0
1142 #define GSM48_T331 30, 0
1143 #define GSM48_T333 30, 0
1144 #define GSM48_T334 25, 0 /* min 15 */
1145 #define GSM48_T338 30, 0
1146 #define GSM48_T303_MS 30, 0
1147 #define GSM48_T305_MS 30, 0
1148 #define GSM48_T308_MS 30, 0
1149 #define GSM48_T310_MS 30, 0
1150 #define GSM48_T313_MS 30, 0
1151 #define GSM48_T323_MS 30, 0
1152 #define GSM48_T332_MS 30, 0
1153 #define GSM48_T335_MS 30, 0
1155 /* Chapter 5.1.2.2 */
1156 #define GSM_CSTATE_NULL 0
1157 #define GSM_CSTATE_INITIATED 1
1158 #define GSM_CSTATE_MM_CONNECTION_PEND 2 /* see 10.5.4.6 */
1159 #define GSM_CSTATE_MO_CALL_PROC 3
1160 #define GSM_CSTATE_CALL_DELIVERED 4
1161 #define GSM_CSTATE_CALL_PRESENT 6
1162 #define GSM_CSTATE_CALL_RECEIVED 7
1163 #define GSM_CSTATE_CONNECT_REQUEST 8
1164 #define GSM_CSTATE_MO_TERM_CALL_CONF 9
1165 #define GSM_CSTATE_ACTIVE 10
1166 #define GSM_CSTATE_DISCONNECT_REQ 12
1167 #define GSM_CSTATE_DISCONNECT_IND 12
1168 #define GSM_CSTATE_RELEASE_REQ 19
1169 #define GSM_CSTATE_MO_ORIG_MODIFY 26
1170 #define GSM_CSTATE_MO_TERM_MODIFY 27
1171 #define GSM_CSTATE_CONNECT_IND 28
1173 #define SBIT(a) (1 << a)
1174 #define ALL_STATES 0xffffffff
1176 /* Table 10.5.3/3GPP TS 04.08: Location Area Identification information element */
1177 #define GSM_LAC_RESERVED_DETACHED 0x0
1178 #define GSM_LAC_RESERVED_ALL_BTS 0xfffe
1180 /* GSM 04.08 Bearer Capability: Information Transfer Capability */
1181 enum gsm48_bcap_itcap {
1182 GSM48_BCAP_ITCAP_SPEECH = 0,
1183 GSM48_BCAP_ITCAP_UNR_DIG_INF = 1,
1184 GSM48_BCAP_ITCAP_3k1_AUDIO = 2,
1185 GSM48_BCAP_ITCAP_FAX_G3 = 3,
1186 GSM48_BCAP_ITCAP_OTHER = 5,
1187 GSM48_BCAP_ITCAP_RESERVED = 7,
1190 /* GSM 04.08 Bearer Capability: Transfer Mode */
1191 enum gsm48_bcap_tmod {
1192 GSM48_BCAP_TMOD_CIRCUIT = 0,
1193 GSM48_BCAP_TMOD_PACKET = 1,
1196 /* GSM 04.08 Bearer Capability: Coding Standard */
1197 enum gsm48_bcap_coding {
1198 GSM48_BCAP_CODING_GSM_STD = 0,
1201 /* GSM 04.08 Bearer Capability: Radio Channel Requirements */
1202 enum gsm48_bcap_rrq {
1203 GSM48_BCAP_RRQ_FR_ONLY = 1,
1204 GSM48_BCAP_RRQ_DUAL_HR = 2,
1205 GSM48_BCAP_RRQ_DUAL_FR = 3,
1209 #define GSM48_TMSI_LEN 5
1210 #define GSM48_MID_TMSI_LEN (GSM48_TMSI_LEN + 2)
1211 #define GSM48_MI_SIZE 32
1214 #endif /* PROTO_GSM_04_08_H */