Bluetooth: Controller: Move Periodic Advertiser List option check
Move Periodic Advertiser List option check in LE Periodic
Advertising Create Sync command to HCI.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c
index 26c34fd..e9a4ea6 100644
--- a/subsys/bluetooth/controller/hci/hci.c
+++ b/subsys/bluetooth/controller/hci/hci.c
@@ -3353,6 +3353,11 @@
return;
}
+ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC_ADV_LIST) &&
+ (cmd->options & BT_HCI_LE_PER_ADV_CREATE_SYNC_FP_USE_LIST)) {
+ *evt = cmd_status(BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL);
+ return;
+ }
skip = sys_le16_to_cpu(cmd->skip);
sync_timeout = sys_le16_to_cpu(cmd->sync_timeout);
diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c
index b9a2754..e5e0f17 100644
--- a/subsys/bluetooth/controller/ll_sw/ull_sync.c
+++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c
@@ -106,11 +106,6 @@
/* FIXME: Check for already synchronized to same peer */
- if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC_ADV_LIST) &&
- (options & BT_HCI_LE_PER_ADV_CREATE_SYNC_FP_USE_LIST)) {
- return BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL;
- }
-
link_sync_estab = ll_rx_link_alloc();
if (!link_sync_estab) {
return BT_HCI_ERR_MEM_CAPACITY_EXCEEDED;