1 /* Asynchronous part of GSM Layer 1 */
3 /* (C) 2010 by Harald Welte <laforge@gnumonks.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <osmocore/msgb.h>
30 #include <layer1/sync.h>
31 #include <layer1/async.h>
32 #include <layer1/mframe_sched.h>
33 #include <layer1/sched_gsmtime.h>
34 #include <layer1/l23_api.h>
36 extern const struct tdma_sched_item rach_sched_set_ul[];
38 /* safely enable a message into the L1S TX queue */
39 void l1a_txq_msgb_enq(struct llist_head *queue, struct msgb *msg)
42 msgb_enqueue(queue, msg);
46 /* Enable a repeating multiframe task */
47 void l1a_mftask_enable(enum mframe_task task)
49 /* we don't need locking here as L1S only reads mframe.tasks */
53 /* Disable a repeating multiframe task */
54 void l1a_mftask_disable(enum mframe_task task)
56 /* we don't need locking here as L1S only reads mframe.tasks */
60 /* Set the mask for repeating multiframe tasks */
61 void l1a_mftask_set(uint32_t tasks)
63 /* we don't need locking here as L1S only reads mframe.tasks */
67 /* Initialize asynchronous part of Layer1 */
73 /* Execute pending L1A completions */
74 void l1a_compl_execute(void)
77 unsigned int scheduled;
80 /* get and reset the currently scheduled tasks */
81 local_irq_save(flags);
82 scheduled = l1s.scheduled_compl;
83 l1s.scheduled_compl = 0;
84 local_irq_restore(flags);
86 /* Iterate over list of scheduled completions, call their
87 * respective completion handler */
88 for (i = 0; i < 32; i++) {
89 if (!(scheduled & (1 << i)))
91 /* call completion function */