Bluetooth: controller: split: Add ULL/LLL architecture assert checks
Add some missing fatal asserts that need to be caught to avoid unexpected failures in the implementation of the architecture. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
faa72b7015
commit
3cf304fd95
3 changed files with 21 additions and 3 deletions
|
@ -47,6 +47,7 @@ static int prepare(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb,
|
|||
static int resume_enqueue(lll_prepare_cb_t resume_cb, int resume_prio);
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_LOW_LAT)
|
||||
static void ticker_start_op_cb(u32_t status, void *param);
|
||||
static void preempt_ticker_cb(u32_t ticks_at_expire, u32_t remainder,
|
||||
u16_t lazy, void *param);
|
||||
static void preempt(void *param);
|
||||
|
@ -240,6 +241,7 @@ int lll_done(void *param)
|
|||
{
|
||||
struct lll_event *next = ull_prepare_dequeue_get();
|
||||
struct ull_hdr *ull = NULL;
|
||||
void *evdone;
|
||||
int ret = 0;
|
||||
|
||||
/* Assert if param supplied without a pending prepare to cancel. */
|
||||
|
@ -271,7 +273,8 @@ int lll_done(void *param)
|
|||
}
|
||||
|
||||
/* Let ULL know about LLL event done */
|
||||
ull_event_done(ull);
|
||||
evdone = ull_event_done(ull);
|
||||
LL_ASSERT(evdone);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -443,7 +446,7 @@ static int prepare(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb,
|
|||
TICKER_NULL_LAZY,
|
||||
TICKER_NULL_SLOT,
|
||||
preempt_ticker_cb, NULL,
|
||||
NULL, NULL);
|
||||
ticker_start_op_cb, NULL);
|
||||
LL_ASSERT((ret == TICKER_STATUS_SUCCESS) ||
|
||||
(ret == TICKER_STATUS_FAILURE) ||
|
||||
(ret == TICKER_STATUS_BUSY));
|
||||
|
@ -502,6 +505,17 @@ static int resume_enqueue(lll_prepare_cb_t resume_cb, int resume_prio)
|
|||
}
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_LOW_LAT)
|
||||
static void ticker_start_op_cb(u32_t status, void *param)
|
||||
{
|
||||
/* NOTE: this callback is present only for addition debug messages
|
||||
* when needed, else can be dispensed with.
|
||||
*/
|
||||
ARG_UNUSED(param);
|
||||
|
||||
LL_ASSERT((status == TICKER_STATUS_SUCCESS) ||
|
||||
(status == TICKER_STATUS_FAILURE));
|
||||
}
|
||||
|
||||
static void preempt_ticker_cb(u32_t ticks_at_expire, u32_t remainder,
|
||||
u16_t lazy, void *param)
|
||||
{
|
||||
|
|
|
@ -634,6 +634,8 @@ static void isr_done(void *param)
|
|||
/* TODO: MOVE ^^ */
|
||||
|
||||
e = ull_event_done_extra_get();
|
||||
LL_ASSERT(e);
|
||||
|
||||
e->type = EVENT_DONE_EXTRA_TYPE_CONN;
|
||||
e->trx_cnt = trx_cnt;
|
||||
e->crc_valid = crc_valid;
|
||||
|
|
|
@ -1572,6 +1572,7 @@ static inline void rx_demux_event_done(memq_link_t *link,
|
|||
struct node_rx_event_done *done = (void *)rx;
|
||||
struct ull_hdr *ull_hdr;
|
||||
struct lll_event *next;
|
||||
void *release;
|
||||
|
||||
/* Get the ull instance */
|
||||
ull_hdr = done->param;
|
||||
|
@ -1602,7 +1603,8 @@ static inline void rx_demux_event_done(memq_link_t *link,
|
|||
|
||||
/* release done */
|
||||
done->extra.type = 0U;
|
||||
done_release(link, done);
|
||||
release = done_release(link, done);
|
||||
LL_ASSERT(release == done);
|
||||
|
||||
/* dequeue prepare pipeline */
|
||||
next = ull_prepare_dequeue_get();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue