diff options
Diffstat (limited to 'src/host/virt_phy/src/virt_l1_sched_simple.c')
-rw-r--r-- | src/host/virt_phy/src/virt_l1_sched_simple.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index 4737135c..3cad2ce0 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -18,13 +18,15 @@ * */ -#include <virtphy/virt_l1_sched.h> -#include <osmocom/core/linuxlist.h> -#include <virtphy/virt_l1_model.h> -#include <virtphy/logging.h> #include <time.h> #include <talloc.h> +#include <osmocom/core/linuxlist.h> + +#include <osmocom/bb/virtphy/virt_l1_sched.h> +#include <osmocom/bb/virtphy/virt_l1_model.h> +#include <osmocom/bb/virtphy/logging.h> + /** * @brief Start scheduler thread based on current gsm time from model */ @@ -97,6 +99,7 @@ void virt_l1_sched_execute(struct l1_model_ms *ms, uint32_t fn) ti_next->handler_cb(ms, mi_next->fn, ti_next->ts, ti_next->msg); /* remove handled tdma sched item */ llist_del(&ti_next->tdma_item_entry); + talloc_free(ti_next); } /* remove handled mframe sched item */ llist_del(&mi_next->mframe_item_entry); @@ -129,12 +132,8 @@ void virt_l1_sched_schedule(struct l1_model_ms *ms, struct msgb *msg, uint32_t f /* list did not contain mframe item with needed fn */ mi_fn = talloc_zero(ms, struct virt_l1_sched_mframe_item); mi_fn->fn = fn; - /* need to manually init the struct content.... no so happy */ - mi_fn->tdma_item_list.prev = &mi_fn->tdma_item_list; - mi_fn->tdma_item_list.next = &mi_fn->tdma_item_list; - - /* TODO: check if we get an error if list is empty... */ - llist_add(&mi_fn->mframe_item_entry, mi_next->mframe_item_entry.prev); + INIT_LLIST_HEAD(&mi_fn->tdma_item_list); + llist_add_tail(&mi_fn->mframe_item_entry, &mi_next->mframe_item_entry); } ti_new = talloc_zero(mi_fn, struct virt_l1_sched_tdma_item); |