Bluetooth: hci: Add handling of allowed CTE types for per sync create

Add missing code responsible for handling of allowed CTE types
in HCI_LE_Periodic_Advertising_Create_Sync command.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
This commit is contained in:
Piotr Pryga 2021-09-03 11:32:11 +02:00 committed by Christopher Friedt
commit ff3045db61

View file

@ -3331,10 +3331,12 @@ static void le_per_adv_create_sync(struct net_buf *buf, struct net_buf **evt)
skip = sys_le16_to_cpu(cmd->skip);
sync_timeout = sys_le16_to_cpu(cmd->sync_timeout);
status = ll_sync_create(cmd->options, cmd->sid, cmd->addr.type,
cmd->addr.a.val, skip, sync_timeout,
cmd->cte_type);
if ((cmd->cte_type & BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_INVALID_VALUE) != 0) {
status = BT_HCI_ERR_CMD_DISALLOWED;
} else {
status = ll_sync_create(cmd->options, cmd->sid, cmd->addr.type, cmd->addr.a.val,
skip, sync_timeout, cmd->cte_type);
}
*evt = cmd_status(status);
}
@ -5623,7 +5625,7 @@ static void le_per_adv_sync_established(struct pdu_data *pdu_data,
sep->status = se->status;
sep->handle = sys_cpu_to_le16(node_rx->hdr.handle);
if (sep->status) {
if (sep->status != BT_HCI_ERR_SUCCESS && sep->status != BT_HCI_ERR_UNSUPP_REMOTE_FEATURE) {
return;
}