fa944221f65e4f6b7f929b315bc8ff17b0875c2a
[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         /* Test task: send Normal Burst in all timeslots */
32         MF_TASK_UL_ALL_NB,
33 };
34
35 enum mf_sched_item_flag {
36         MF_F_SACCH      = (1 << 0),
37 };
38
39 /* The scheduler itself */
40 struct mframe_scheduler {
41         uint32_t tasks;
42         uint32_t tasks_tgt;
43         uint32_t safe_fn;
44 };
45
46 uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t ts);
47
48 /* Enable a specific task */
49 void mframe_enable(enum mframe_task task_id);
50
51 /* Disable a specific task */
52 void mframe_disable(enum mframe_task task_id);
53
54 /* Replace the current active set by the new one */
55 void mframe_set(uint32_t tasks);
56
57 /* Schedule mframe_sched_items according to current MF TASK list */
58 void mframe_schedule(void);
59
60 /* reset the scheduler, disabling all tasks */
61 void mframe_reset(void);
62
63 #endif /* _MFRAME_SCHED_H */