[layer23] Added support for changing TCH mode via L1CTL messages
[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
38         /* cumulated values of current cell from SACCH dl */
39         uint32_t frames;
40         uint32_t snr;
41         uint32_t berr;
42         uint32_t rxlev;
43 };
44
45 /* One Mobilestation for osmocom */
46 struct osmocom_ms {
47         struct llist_head entity;
48         char name[32];
49         struct write_queue l2_wq, sap_wq;
50         uint16_t test_arfcn;
51
52         struct gsm_support support;
53         struct gsm_settings settings;
54         struct gsm_subscriber subscr;
55         struct gsm_sim sim;
56         struct osmol2_entity l2_entity;
57         struct osmosap_entity sap_entity;
58         struct rx_meas_stat meas;
59         struct gsm48_rrlayer rrlayer;
60         struct gsm322_plmn plmn;
61         struct gsm322_cellsel cellsel;
62         struct gsm48_mmlayer mmlayer;
63         struct gsm48_cclayer cclayer;
64         struct llist_head trans_list;
65 };
66
67 enum osmobb_sig_subsys {
68         SS_L1CTL,
69 };
70
71 enum osmobb_meas_sig {
72         S_L1CTL_FBSB_ERR,
73         S_L1CTL_FBSB_RESP,
74         S_L1CTL_RESET,
75         S_L1CTL_PM_RES,
76         S_L1CTL_PM_DONE,
77         S_L1CTL_CCCH_MODE_CONF,
78         S_L1CTL_TCH_MODE_CONF,
79 };
80
81 struct osmobb_fbsb_res {
82         struct osmocom_ms *ms;
83         int8_t snr;
84         uint8_t bsic;
85 };
86
87 struct osmobb_meas_res {
88         struct osmocom_ms *ms;
89         uint16_t band_arfcn;
90         uint8_t rx_lev;
91 };
92
93 struct osmobb_ccch_mode_conf {
94         struct osmocom_ms *ms;
95         uint8_t ccch_mode;
96 };
97
98 struct osmobb_tch_mode_conf {
99         struct osmocom_ms *ms;
100         uint8_t tch_mode;
101 };
102
103 #endif