[layer23] If the mobile sticks to a cell, RXLEV_MIN is ignored
[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         /* IMEI */
12         char                    imei[16];
13         char                    imeisv[17];
14         char                    imei_random;
15
16         /* network search */
17         int                     plmn_mode; /* PLMN_MODE_* */
18
19         /* SIM */
20         int                     sim_type; /* selects card on power on */
21         char                    emergency_imsi[20]; /* just in case... */
22
23         /* test card simulator settings */
24         char                    test_imsi[20]; /* just in case... */
25         uint8_t                 test_ki_type;
26         uint8_t                 test_ki[16]; /* 128 bit max */
27         uint8_t                 test_barr;
28         uint8_t                 test_rplmn_valid;
29         uint16_t                test_rplmn_mcc, test_rplmn_mnc;
30         uint8_t                 test_always; /* ...search hplmn... */
31
32         /* call related settings */
33         uint8_t                 cw; /* set if call-waiting is allowed */
34         uint8_t                 clip, clir;
35         uint8_t                 half, half_prefer;
36
37         /* changing default behavior */
38         uint8_t                 alter_tx_power;
39         uint8_t                 alter_tx_power_value;
40         int8_t                  alter_delay;
41         uint8_t                 stick;
42         uint16_t                stick_arfcn;
43         uint8_t                 no_lupd;
44
45         /* supported by configuration */
46         uint8_t                 sms_ptp;
47         uint8_t                 a5_1;
48         uint8_t                 a5_2;
49         uint8_t                 a5_3;
50         uint8_t                 a5_4;
51         uint8_t                 a5_5;
52         uint8_t                 a5_6;
53         uint8_t                 a5_7;
54         uint8_t                 p_gsm;
55         uint8_t                 e_gsm;
56         uint8_t                 r_gsm;
57         uint8_t                 dcs;
58         uint8_t                 class_900;
59         uint8_t                 class_dcs;
60         uint8_t                 full_v1;
61         uint8_t                 full_v2;
62         uint8_t                 full_v3;
63         uint8_t                 half_v1;
64         uint8_t                 half_v3;
65         uint8_t                 ch_cap; /* channel capability */
66         int8_t                  min_rxlev_db; /* min DB to access */
67
68         /* radio */
69         uint16_t                dsc_max;
70
71         /* dialing */
72         struct llist_head       abbrev;
73 };
74
75 struct gsm_settings_abbrev {
76         struct llist_head       list;
77         char                    abbrev[4];
78         char                    number[32];
79         char                    name[32];
80 };
81
82 int gsm_settings_init(struct osmocom_ms *ms);
83 int gsm_settings_exit(struct osmocom_ms *ms);
84 char *gsm_check_imei(const char *imei, const char *sv);
85 int gsm_random_imei(struct gsm_settings *set);
86
87 #endif /* _settings_h */
88