[layer23] SIM client completion
[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/common/sap_interface.h>
16 #include <osmocom/bb/mobile/gsm48_rr.h>
17 #include <osmocom/bb/mobile/sysinfo.h>
18 #include <osmocom/bb/mobile/gsm322.h>
19 #include <osmocom/bb/mobile/gsm48_mm.h>
20 #include <osmocom/bb/mobile/gsm48_cc.h>
21 #include <osmocom/bb/common/sim.h>
22
23 /* A layer2 entity */
24 struct osmol2_entity {
25         struct lapdm_entity lapdm_dcch;
26         struct lapdm_entity lapdm_acch;
27         osmol2_cb_t msg_handler;
28 };
29
30 struct osmosap_entity {
31         osmosap_cb_t msg_handler;
32 };
33
34 /* RX measurement statistics */
35 struct rx_meas_stat {
36         uint32_t last_fn;
37         uint32_t frames;
38         uint32_t snr;
39         uint32_t berr;
40         uint32_t rxlev;
41 };
42
43 /* One Mobilestation for osmocom */
44 struct osmocom_ms {
45         struct llist_head entity;
46         char name[32];
47         struct write_queue l2_wq, sap_wq;
48         uint16_t test_arfcn;
49
50         struct gsm_support support;
51         struct gsm_settings settings;
52         struct gsm_subscriber subscr;
53         struct gsm_sim sim;
54         struct osmol2_entity l2_entity;
55         struct osmosap_entity sap_entity;
56         struct rx_meas_stat meas;
57         struct gsm48_rrlayer rrlayer;
58         struct gsm322_plmn plmn;
59         struct gsm322_cellsel cellsel;
60         struct gsm48_mmlayer mmlayer;
61         struct gsm48_cclayer cclayer;
62         struct llist_head trans_list;
63 };
64
65 enum osmobb_sig_subsys {
66         SS_L1CTL,
67 };
68
69 enum osmobb_meas_sig {
70         S_L1CTL_FBSB_ERR,
71         S_L1CTL_FBSB_RESP,
72         S_L1CTL_RESET,
73         S_L1CTL_PM_RES,
74         S_L1CTL_PM_DONE,
75         S_L1CTL_CCCH_MODE_CONF,
76 };
77
78 struct osmobb_meas_res {
79         struct osmocom_ms *ms;
80         uint16_t band_arfcn;
81         uint8_t rx_lev;
82 };
83
84 struct osmobb_ccch_mode_conf {
85         struct osmocom_ms *ms;
86         uint8_t ccch_mode;
87 };
88
89 #endif