[layer1] Added frequency change control to layer 1 (L1CTL_FREQ_REQ)
[osmocom-bb.git] / src / target / firmware / include / layer1 / async.h
1 #ifndef _L1_ASYNC_H
2 #define _L1_ASYNC_H
3
4 #include <osmocore/msgb.h>
5
6 #include <layer1/mframe_sched.h>
7
8 /* When altering data structures used by L1 Sync part, we need to
9  * make sure to temporarily disable IRQ/FIQ to keep data consistent */
10 static inline void l1a_lock_sync(void)
11 {
12         arm_disable_interrupts();
13 }
14
15 static inline void l1a_unlock_sync(void)
16 {
17         arm_enable_interrupts();
18 }
19
20 /* safely enable a message into the L1S TX queue */
21 void l1a_txq_msgb_enq(struct llist_head *queue, struct msgb *msg);
22
23 /* request a RACH request at the next multiframe T3 = fn51 */
24 void l1a_rach_req(uint8_t fn51, uint8_t mf_off, uint8_t ra);
25
26 /* schedule frequency change */
27 void l1a_freq_req(uint32_t fn_sched);
28
29 /* Enable a repeating multiframe task */
30 void l1a_mftask_enable(enum mframe_task task);
31
32 /* Disable a repeating multiframe task */
33 void l1a_mftask_disable(enum mframe_task task);
34
35 /* Execute pending L1A completions */
36 void l1a_compl_execute(void);
37
38 /* Initialize asynchronous part of Layer1 */
39 void l1a_init(void);
40
41 #endif