4 #include <osmocore/linuxlist.h>
5 #include <osmocore/gsm_utils.h>
6 #include <layer1/tdma_sched.h>
7 #include <l1a_l23_interface.h>
9 /* structure representing L1 sync information about a cell */
11 /* on which ARFCN (+band) is the cell? */
13 /* what's the BSIC of the cell (from SCH burst decoding) */
15 /* whats the delta of the cells current GSM frame number
16 * compared to our current local frame number */
18 /* how much does the TPU need adjustment (delta) to synchronize
19 * with the cells burst */
20 uint32_t time_alignment;
21 /* FIXME: should we also store the AFC value? */
32 struct gsm_time current_time; /* current GSM time */
33 struct gsm_time next_time; /* GSM time at next TMDMA irq */
35 /* the cell on which we are camping right now */
36 struct l1_cell_info serving_cell;
39 struct tdma_scheduler tdma_sched;
41 /* The current TPU offset register */
44 /* Transmit queues of pending packets for main DCCH and ACCH */
45 struct llist_head tx_queue[_NUM_L1S_CHAN];
47 /* bit-mask of multi-frame tasks that are currently active */
50 /* Structures below are for L1-task specific parameters, used
51 * to communicate between l1-sync and l1-async (l23_api) */
53 /* power measurement l1 task */
70 extern struct l1s_state l1s;
73 L1_SIG_PM, /* Power Measurement */
74 L1_SIG_NB, /* Normal Burst */
78 uint16_t snr; /* signal/noise ratio */
79 int16_t toa_qbit; /* time of arrival (qbits) */
80 int16_t pm_dbm8; /* power level in dbm/8 */
81 int16_t freq_err; /* Frequency error in Hz */
92 struct l1s_meas_hdr meas[4];
101 typedef void (*l1s_cb_t)(struct l1_signal *sig);
103 void l1s_set_handler(l1s_cb_t handler);
105 int16_t l1s_snr_int(uint16_t snr);
106 uint16_t l1s_snr_fract(uint16_t snr);
108 void l1s_dsp_abort(void);
110 void l1s_fb_test(uint8_t base_fn, uint8_t fb_mode);
111 void l1s_sb_test(uint8_t base_fn);
112 void l1s_pm_test(uint8_t base_fn, uint16_t arfcn);
113 void l1s_nb_test(uint8_t base_fn);
117 /* reset the layer1 as part of synchronizing to a new cell */
118 void l1s_reset(void);
121 void layer1_init(void);
123 #endif /* _L1_SYNC_H */