Merge commit '2a68c7c8cd2eca65c58c0898d0e1716e9d4c3ecd'
[osmocom-bb.git] / src / host / layer23 / include / osmocom / bb / mobile / settings.h
1 #ifndef _settings_h
2 #define _settings_h
3
4 /* type of test SIM key */
5 enum {
6         GSM_SIM_KEY_XOR = 0,
7         GSM_SIM_KEY_COMP128
8 };
9
10 struct gsm_settings {
11         char                    layer2_socket_path[128];
12         char                    sap_socket_path[128];
13
14         /* IMEI */
15         char                    imei[16];
16         char                    imeisv[17];
17         char                    imei_random;
18
19         /* network search */
20         int                     plmn_mode; /* PLMN_MODE_* */
21
22         /* SIM */
23         int                     sim_type; /* selects card on power on */
24         char                    emergency_imsi[20]; /* just in case... */
25
26         /* test card simulator settings */
27         char                    test_imsi[20]; /* just in case... */
28         uint32_t                test_tmsi;
29         uint8_t                 test_ki_type;
30         uint8_t                 test_ki[16]; /* 128 bit max */
31         uint8_t                 test_barr;
32         uint8_t                 test_rplmn_valid;
33         uint16_t                test_rplmn_mcc, test_rplmn_mnc;
34         uint16_t                test_lac;
35         uint8_t                 test_always; /* ...search hplmn... */
36
37         /* call related settings */
38         uint8_t                 cw; /* set if call-waiting is allowed */
39         uint8_t                 auto_answer;
40         uint8_t                 clip, clir;
41         uint8_t                 half, half_prefer;
42
43         /* changing default behavior */
44         uint8_t                 alter_tx_power;
45         uint8_t                 alter_tx_power_value;
46         int8_t                  alter_delay;
47         uint8_t                 stick;
48         uint16_t                stick_arfcn;
49         uint8_t                 no_lupd;
50
51         /* supported by configuration */
52         uint8_t                 cc_dtmf;
53         uint8_t                 sms_ptp;
54         uint8_t                 a5_1;
55         uint8_t                 a5_2;
56         uint8_t                 a5_3;
57         uint8_t                 a5_4;
58         uint8_t                 a5_5;
59         uint8_t                 a5_6;
60         uint8_t                 a5_7;
61         uint8_t                 p_gsm;
62         uint8_t                 e_gsm;
63         uint8_t                 r_gsm;
64         uint8_t                 dcs;
65         uint8_t                 gsm_850;
66         uint8_t                 pcs;
67         uint8_t                 gsm_480;
68         uint8_t                 gsm_450;
69         uint8_t                 class_900;
70         uint8_t                 class_dcs;
71         uint8_t                 class_850;
72         uint8_t                 class_pcs;
73         uint8_t                 class_400;
74         uint8_t                 freq_map[128+38];
75         uint8_t                 full_v1;
76         uint8_t                 full_v2;
77         uint8_t                 full_v3;
78         uint8_t                 half_v1;
79         uint8_t                 half_v3;
80         uint8_t                 ch_cap; /* channel capability */
81         int8_t                  min_rxlev_db; /* min DB to access */
82
83         /* radio */
84         uint16_t                dsc_max;
85
86         /* dialing */
87         struct llist_head       abbrev;
88
89         /* EDGE / UMTS / CDMA */
90         uint8_t                 edge_ms_sup;
91         uint8_t                 edge_psk_sup;
92         uint8_t                 edge_psk_uplink;
93         uint8_t                 class_900_edge;
94         uint8_t                 class_dcs_pcs_edge;
95         uint8_t                 umts_fdd;
96         uint8_t                 umts_tdd;
97         uint8_t                 cdma_2000;
98         uint8_t                 dtm;
99         uint8_t                 class_dtm;
100         uint8_t                 dtm_mac;
101         uint8_t                 dtm_egprs;
102 };
103
104 struct gsm_settings_abbrev {
105         struct llist_head       list;
106         char                    abbrev[4];
107         char                    number[32];
108         char                    name[32];
109 };
110
111 int gsm_settings_arfcn(struct osmocom_ms *ms);
112 int gsm_settings_init(struct osmocom_ms *ms);
113 int gsm_settings_exit(struct osmocom_ms *ms);
114 char *gsm_check_imei(const char *imei, const char *sv);
115 int gsm_random_imei(struct gsm_settings *set);
116
117 #endif /* _settings_h */
118