Skip to content

Commit ad2b77e

Browse files
cvinayakcfriedt
authored andcommitted
Bluetooth: Controller: Allow resolving list update during passive scan
Allow resolving list update when passive scanning, otherwise deny if advertising, active scanning, initiating or periodic sync create is active. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent eb85f9a commit ad2b77e

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

subsys/bluetooth/controller/ll_sw/ull_filter.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,12 @@ static int rl_access_check(bool check_ar)
10141014
}
10151015
}
10161016

1017+
/* NOTE: Allowed when passive scanning, otherwise deny if advertising,
1018+
* active scanning, initiating or periodic sync create is active.
1019+
*/
10171020
return ((IS_ENABLED(CONFIG_BT_BROADCASTER) && ull_adv_is_enabled(0)) ||
1018-
(IS_ENABLED(CONFIG_BT_OBSERVER) && ull_scan_is_enabled(0)))
1021+
(IS_ENABLED(CONFIG_BT_OBSERVER) &&
1022+
(ull_scan_is_enabled(0) & ~BIT(0))))
10191023
? 0 : 1;
10201024
}
10211025

subsys/bluetooth/controller/ll_sw/ull_scan.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -618,18 +618,29 @@ uint32_t ull_scan_is_enabled(uint8_t handle)
618618
{
619619
struct ll_scan_set *scan;
620620

621+
/* NOTE: BIT(0) - passive scanning enabled
622+
* BIT(1) - active scanning enabled
623+
* BIT(2) - initiator enabled
624+
* BIT(3) - periodic sync create active
625+
*/
626+
621627
scan = ull_scan_is_enabled_get(handle);
622628
if (!scan) {
629+
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
630+
scan = ull_scan_set_get(handle);
631+
632+
return scan->per_scan.sync ? BIT(3) : 0;
633+
#else
623634
return 0;
635+
#endif
624636
}
625637

626-
/* NOTE: BIT(0) - passive scanning enabled
627-
* BIT(1) - active scanning enabled
628-
* BIT(2) - initiator enabled
629-
*/
630638
return (((uint32_t)scan->is_enabled << scan->lll.type) |
631639
#if defined(CONFIG_BT_CENTRAL)
632640
(scan->lll.conn ? BIT(2) : 0) |
641+
#endif
642+
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
643+
(scan->per_scan.sync ? BIT(3) : 0) |
633644
#endif
634645
0);
635646
}

0 commit comments

Comments
 (0)