rf: JIT scheduler fixes and improvements

- Prevent double callback with ADV re-scheduling
  For configurations using CONFIG_BT_CTLR_JIT_SCHEDULING, when last
  ADV before initiating connection is re-scheduled with a small delay,
  the disabled_cb would be called a second time. This would unexpectedly
  invoke a second conn setup with illegal parameters.
  To avoid this JIT scheduler phenomenon, clear the ADV disabled_cb
  when invoked.
- Add priority to LLL header. This allows the conn priority to be
  associated with the object. Used in vendor LLL implementation.

Signed-off-by: Morten Priess <mtpr@oticon.com>
This commit is contained in:
Morten Priess 2022-01-19 09:24:38 +01:00 committed by Anas Nashif
commit 1417e8f8c7
3 changed files with 23 additions and 6 deletions

View file

@ -2244,6 +2244,15 @@ static void conn_setup_adv_scan_disabled_cb(void *param)
ftr = &(rx->rx_ftr);
lll = *((struct lll_conn **)((uint8_t *)ftr->param +
sizeof(struct lll_hdr)));
if (IS_ENABLED(CONFIG_BT_CTLR_JIT_SCHEDULING)) {
struct ull_hdr *hdr;
/* Prevent fast ADV re-scheduling from re-triggering */
hdr = HDR_LLL2ULL(ftr->param);
hdr->disabled_cb = NULL;
}
switch (lll->role) {
#if defined(CONFIG_BT_CENTRAL)
case 0: