[layer23] Adding SIM client
[osmocom-bb.git] / src / host / layer23 / include / osmocom / bb / common / osmocom_data.h
1 #ifndef osmocom_data_h
2 #define osmocom_data_h
3
4 #include <osmocore/select.h>
5 #include <osmocore/gsm_utils.h>
6 #include <osmocore/write_queue.h>
7
8 struct osmocom_ms;
9
10         /* FIXME no 'mobile' specific stuff should be here */
11 #include <osmocom/bb/mobile/support.h>
12 #include <osmocom/bb/mobile/settings.h>
13 #include <osmocom/bb/mobile/subscriber.h>
14 #include <osmocom/bb/common/lapdm.h>
15 #include <osmocom/bb/mobile/gsm48_rr.h>
16 #include <osmocom/bb/mobile/sysinfo.h>
17 #include <osmocom/bb/mobile/gsm322.h>
18 #include <osmocom/bb/mobile/gsm48_mm.h>
19 #include <osmocom/bb/mobile/gsm48_cc.h>
20 #include <osmocom/bb/mobile/sim.h>
21
22 /* A layer2 entity */
23 struct osmol2_entity {
24         struct lapdm_entity lapdm_dcch;
25         struct lapdm_entity lapdm_acch;
26         osmol2_cb_t msg_handler;
27 };
28
29 /* RX measurement statistics */
30 struct rx_meas_stat {
31         uint32_t last_fn;
32         uint32_t frames;
33         uint32_t snr;
34         uint32_t berr;
35         uint32_t rxlev;
36 };
37
38 /* One Mobilestation for osmocom */
39 struct osmocom_ms {
40         struct llist_head entity;
41         char name[32];
42         struct write_queue wq;
43         uint16_t test_arfcn;
44
45         struct gsm_support support;
46         struct gsm_settings settings;
47         struct gsm_subscriber subscr;
48         struct gsm_sim sim;
49         struct osmol2_entity l2_entity;
50         struct rx_meas_stat meas;
51         struct gsm48_rrlayer rrlayer;
52         struct gsm322_plmn plmn;
53         struct gsm322_cellsel cellsel;
54         struct gsm48_mmlayer mmlayer;
55         struct gsm48_cclayer cclayer;
56         struct llist_head trans_list;
57 };
58
59 enum osmobb_sig_subsys {
60         SS_L1CTL,
61 };
62
63 enum osmobb_meas_sig {
64         S_L1CTL_FBSB_ERR,
65         S_L1CTL_FBSB_RESP,
66         S_L1CTL_RESET,
67         S_L1CTL_PM_RES,
68         S_L1CTL_PM_DONE,
69         S_L1CTL_CCCH_MODE_CONF,
70 };
71
72 struct osmobb_meas_res {
73         struct osmocom_ms *ms;
74         uint16_t band_arfcn;
75         uint8_t rx_lev;
76 };
77
78 struct osmobb_ccch_mode_conf {
79         struct osmocom_ms *ms;
80         uint8_t ccch_mode;
81 };
82
83 #endif