[layer23/mobile] Improvement and fixes of idle mode process
[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 <osmocom/core/select.h>
5 #include <osmocom/gsm/gsm_utils.h>
6 #include <osmocom/core/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/common/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 struct osmosap_entity {
24         osmosap_cb_t msg_handler;
25 };
26
27 /* RX measurement statistics */
28 struct rx_meas_stat {
29         uint32_t last_fn;
30
31         /* cumulated values of current cell from SACCH dl */
32         uint32_t frames;
33         uint32_t snr;
34         uint32_t berr;
35         uint32_t rxlev;
36
37         /* counters loss criterion */
38         int16_t dsc, ds_fail;
39         int16_t s, rl_fail;
40 };
41
42 /* One Mobilestation for osmocom */
43 struct osmocom_ms {
44         struct llist_head entity;
45         char name[32];
46         struct osmo_wqueue l2_wq, sap_wq;
47         uint16_t test_arfcn;
48
49         uint8_t deleting, shutdown, started;
50         struct gsm_support support;
51         struct gsm_settings settings;
52         struct gsm_subscriber subscr;
53         struct gsm_sim sim;
54         struct lapdm_channel lapdm_channel;
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         SS_GLOBAL,
68 };
69
70 enum osmobb_l1ctl_sig {
71         S_L1CTL_FBSB_ERR,
72         S_L1CTL_FBSB_RESP,
73         S_L1CTL_RESET,
74         S_L1CTL_PM_RES,
75         S_L1CTL_PM_DONE,
76         S_L1CTL_CCCH_MODE_CONF,
77         S_L1CTL_TCH_MODE_CONF,
78         S_L1CTL_LOSS_IND,
79         S_L1CTL_NEIGH_PM_IND,
80 };
81
82 enum osmobb_global_sig {
83         S_GLOBAL_SHUTDOWN,
84 };
85
86 struct osmobb_fbsb_res {
87         struct osmocom_ms *ms;
88         int8_t snr;
89         uint8_t bsic;
90         uint16_t band_arfcn;
91 };
92
93 struct osmobb_meas_res {
94         struct osmocom_ms *ms;
95         uint16_t band_arfcn;
96         uint8_t rx_lev;
97 };
98
99 struct osmobb_ccch_mode_conf {
100         struct osmocom_ms *ms;
101         uint8_t ccch_mode;
102 };
103
104 struct osmobb_tch_mode_conf {
105         struct osmocom_ms *ms;
106         uint8_t tch_mode;
107 };
108
109 struct osmobb_neigh_pm_ind {
110         struct osmocom_ms *ms;
111         uint16_t band_arfcn;
112         uint8_t rx_lev;
113 };
114
115 #endif