Bluetooth: controller: Parameter check for ISO sync recv qualification

Add HCI input parameter validation according to spec for passing
qualification tests.

- Conditional compile of LE Set PA Receive Enable feature
- Store BIGinfo encryption state and number of streams
- Do not report BIGinfo if phy is invalid or unsupported
- Return disallowed ll_read_iso_tx_sync uses sync recever handle
- Validate BIS indices in ll_big_sync_create

Signed-off-by: Morten Priess <mtpr@oticon.com>
This commit is contained in:
Morten Priess 2024-03-11 15:19:18 +01:00 committed by David Leach
commit 6f374d850a
6 changed files with 62 additions and 7 deletions

View file

@ -887,8 +887,10 @@ static void read_supported_commands(struct net_buf *buf, struct net_buf **evt)
*/
rp->commands[38] |= BIT(3) | BIT(4) | BIT(5) | BIT(6);
#endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_ADV_LIST */
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
/* LE Set PA Receive Enable */
rp->commands[40] |= BIT(5);
#endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */
#if defined(CONFIG_BT_CTLR_SYNC_ISO)
/* LE BIG Create Sync, LE BIG Terminate Sync */
rp->commands[43] |= BIT(0) | BIT(1);
@ -7749,6 +7751,7 @@ no_ext_hdr:
struct bt_hci_evt_le_biginfo_adv_report *sep;
struct pdu_big_info *bi;
uint8_t bi_size;
uint8_t phy;
/* FIXME: Parse and find the BIGInfo */
if (acad[PDU_ADV_DATA_HEADER_TYPE_OFFSET] != BT_DATA_BIG_INFO) {
@ -7758,6 +7761,14 @@ no_ext_hdr:
bi_size = acad[PDU_ADV_DATA_HEADER_LEN_OFFSET];
bi = (void *)&acad[PDU_ADV_DATA_HEADER_DATA_OFFSET];
/* Do not report if phy is invalid or unsupported */
phy = (bi->chm_phy[4] >> 5);
if ((phy > EXT_ADV_AUX_PHY_LE_CODED) ||
(!IS_ENABLED(CONFIG_BT_CTLR_PHY_CODED) &&
(phy == EXT_ADV_AUX_PHY_LE_CODED))) {
return;
}
/* Allocate new event buffer if periodic advertising report was
* constructed with the caller supplied buffer.
*/