[layer1] Adding neighbour cell measurement code to layer1.
[osmocom-bb.git] / src / target / firmware / include / layer1 / mframe_sched.h
1 #ifndef _L1_MFRAME_SCHED_H
2 #define _L1_MFRAME_SCHED_H
3
4 #include <stdint.h>
5
6 enum mframe_task {
7         MF_TASK_BCCH_NORM,
8         MF_TASK_BCCH_EXT,
9         MF_TASK_CCCH,
10         MF_TASK_CCCH_COMB,
11
12         MF_TASK_SDCCH4_0,
13         MF_TASK_SDCCH4_1,
14         MF_TASK_SDCCH4_2,
15         MF_TASK_SDCCH4_3,
16
17         MF_TASK_SDCCH8_0,
18         MF_TASK_SDCCH8_1,
19         MF_TASK_SDCCH8_2,
20         MF_TASK_SDCCH8_3,
21         MF_TASK_SDCCH8_4,
22         MF_TASK_SDCCH8_5,
23         MF_TASK_SDCCH8_6,
24         MF_TASK_SDCCH8_7,
25
26         MF_TASK_TCH_F_EVEN,
27         MF_TASK_TCH_F_ODD,
28         MF_TASK_TCH_H_0,
29         MF_TASK_TCH_H_1,
30
31         MF_TASK_NEIGH_PM51,
32         MF_TASK_NEIGH_PM26E,
33         MF_TASK_NEIGH_PM26O,
34
35         /* Test task: send Normal Burst in all timeslots */
36         MF_TASK_UL_ALL_NB,
37 };
38
39 enum mf_sched_item_flag {
40         MF_F_SACCH      = (1 << 0),
41 };
42
43 /* The scheduler itself */
44 struct mframe_scheduler {
45         uint32_t tasks;
46         uint32_t tasks_tgt;
47         uint32_t safe_fn;
48 };
49
50 uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t ts);
51
52 /* Enable a specific task */
53 void mframe_enable(enum mframe_task task_id);
54
55 /* Disable a specific task */
56 void mframe_disable(enum mframe_task task_id);
57
58 /* Replace the current active set by the new one */
59 void mframe_set(uint32_t tasks);
60
61 /* Schedule mframe_sched_items according to current MF TASK list */
62 void mframe_schedule(void);
63
64 /* reset the scheduler, disabling all tasks */
65 void mframe_reset(void);
66
67 #endif /* _MFRAME_SCHED_H */