src: use new libosmogsm and include/osmocom/[gsm|core] path to headers
[osmocom-bb.git] / src / target / firmware / layer1 / sched_gsmtime.c
index b4e970e..01e22ca 100644 (file)
@@ -24,7 +24,7 @@
 #include <errno.h>
 
 #include <debug.h>
-#include <osmocore/linuxlist.h>
+#include <osmocom/core/linuxlist.h>
 
 #include <layer1/tdma_sched.h>
 #include <layer1/sched_gsmtime.h>
@@ -33,7 +33,7 @@ static struct sched_gsmtime_event sched_gsmtime_events[16];
 static LLIST_HEAD(active_evts);
 static LLIST_HEAD(inactive_evts);
 
-/* Scheduling of a tdma_sched_item list one-shot at a givnen GSM time */
+/* Scheduling of a tdma_sched_item list one-shot at a given GSM time */
 int sched_gsmtime(const struct tdma_sched_item *si, uint32_t fn, uint16_t p3)
 {
        struct llist_head *lh;
@@ -106,3 +106,14 @@ void sched_gsmtime_init(void)
        for (i = 0; i < ARRAY_SIZE(sched_gsmtime_events); i++)
                llist_add(&sched_gsmtime_events[i].list, &inactive_evts);
 }
+
+void sched_gsmtime_reset(void)
+{
+       struct sched_gsmtime_event *evt, *evt2;
+
+       llist_for_each_entry_safe(evt, evt2, &active_evts, list) {
+               llist_del(&evt->list);
+               /* put event back in list of inactive (free) events */
+               llist_add(&evt->list, &inactive_evts);
+       }
+}