The Wayback Machine - https://web.archive.org/web/20220529031058/https://github.com/zephyrproject-rtos/zephyr/pull/31009/files
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: controller: Initial Broadcast Isochronous Groups support #31009

Merged
merged 59 commits into from Nov 18, 2021
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
06d0d24
Bluetooth: controller: Rename ll_adv_iso and ll_sync_iso
cvinayak Jan 6, 2021
9c2b8eb
Bluetooth: controller: Add data members related to ISO sync loss
cvinayak Jan 7, 2021
254c0a8
Bluetooth: controller: Add Broadcast ISO Sync and Sync Lost release
cvinayak Jan 7, 2021
40a1715
tests: Bluetooth: bsim: Check ISO allocation release on terminate
cvinayak Jan 7, 2021
7c39bf2
Bluetooth: controller: Fix pdu_big_info structure
cvinayak Jan 15, 2021
75924c7
Bluetooth: controller: BIGInfo in ACAD with mandatory parameters
cvinayak Jan 15, 2021
e01d3aa
Bluetooth: controller: Refactoring of BIS data members
cvinayak Jan 18, 2021
46eee83
Bluetooth: controller: Fix ticker user id used to terminate BIG
cvinayak Mar 4, 2021
d17496a
Bluetooth: controller: Added BIS event with empty PDU
cvinayak Jan 18, 2021
0b1b758
Bluetooth: Controller: Fix missing traversal of CTEInfo to find BIGInfo
cvinayak Sep 3, 2021
8a043ae
Bluetooth: Controller: Fix missing traversal of ADI to find BIGInfo
cvinayak Sep 3, 2021
4089d6c
Bluetooth: controller: Fix populate offset in latest advertising PDU
cvinayak Jan 18, 2021
86e37fd
Bluetooth: controller: Add create BIG complete event
cvinayak Jan 19, 2021
a8506b2
Bluetooth: controller: Added BIGInfo Advertising Report generation
cvinayak Feb 4, 2021
5c36e74
tests: Bluetooth: bsim: Fix test_iso to sync periodic advertising
cvinayak Feb 4, 2021
ea42a80
tests: bluetooth: bsim: Receive the BIG Info callback
cvinayak Feb 18, 2021
ca5f94c
Bluetooth: controller: Initial BIG Create Sync implementation
cvinayak Feb 18, 2021
dd2a784
tests: Bluetooth: bsim: Updates related to BIG Create Sync
cvinayak Feb 18, 2021
cfbd82a
Bluetooth: controller: BIG Create Sync LLL implementation
cvinayak Feb 9, 2021
6c7a49c
Bluetooth: controller: Handle Sync ISO notifications
cvinayak Feb 17, 2021
481581b
Bluetooth: controller: Fix Adv ISO start ticker user context
cvinayak Feb 18, 2021
91971b6
Bluetooth: controller: Fill BIS Payload Count in BIGInfo struct
cvinayak Mar 7, 2021
90d00eb
Bluetooth: controller: Implement the BIG sync establish and lost
cvinayak Feb 26, 2021
0c6f4fd
Bluetooth: controller: Update BIG Terminate Sync implementation
cvinayak Feb 26, 2021
2bb48ff
Bluetooth: controller: Fix LE BIG Sync Terminate command response
cvinayak Mar 9, 2021
efc8ca7
Bluetooth: controller: Add missing BIG Sync Estab and Lost reason
cvinayak Feb 26, 2021
1e6f3f5
Bluetooth: controller: Fix BIG Sync Lost event generation
cvinayak Mar 10, 2021
50cf38b
Bluetooth: controller: Fix BIG complete event generation
cvinayak Mar 10, 2021
010d156
Bluetooth: controller: Add the BIG terminate event generation
cvinayak Mar 10, 2021
8003776
Bluetooth: controller: Add function to calculate BIS access address
cvinayak Mar 9, 2021
72e1752
Bluetooth: controller: Use the CSA#2 function for SubEvents
cvinayak Mar 9, 2021
f4cd8d5
Bluetooth: controller: Fix ISO to advertising context association order
cvinayak Mar 9, 2021
e540f57
Bluetooth: controller: Fix missing EVENT_TICKER_RES_MARGIN_US
cvinayak Mar 15, 2021
b448528
Bluetooth: controller: Fix BigInfo with correct payload count
cvinayak Mar 15, 2021
e59415f
Bluetooth: controller: Use LL_BIS_OCTETS_TX_MAX & LL_BIS_OCTETS_RX_MAX
cvinayak Mar 16, 2021
89d1689
Bluetooth: controller: BIG subevents and terminate procedure
cvinayak Mar 16, 2021
49166f3
tests: Bluetooth: bsim: Use host BIG Sync APIs
cvinayak Feb 26, 2021
57a3aa8
Bluetooth: controller: Handle duplicate BIG complete done events
cvinayak Apr 16, 2021
63141e1
Bluetooth: controller: Update ISO Broadcaster Terminate handling
cvinayak Apr 15, 2021
a6dde91
Bluetooth: controller: Update ISO Sync Terminate handling
cvinayak Apr 15, 2021
4eae5d5
Bluetooth: controller: Update ISO Broadcaster subevents
cvinayak Apr 16, 2021
481944f
Bluetooth: controller: BIG Sync subevents and terminate procedure
cvinayak Mar 16, 2021
5a1d020
Bluetooth: controller: BIG Sync to anchor sync on any subevent
cvinayak May 5, 2021
f30609e
Bluetooth: controller: BIG Sync terminate procedure
cvinayak May 5, 2021
e53a8dc
Bluetooth: controller: Fix side effect in assertion
cvinayak May 19, 2021
c31215b
Bluetooth: Controller: Consistent naming in BIS ticker op callbacks
cvinayak Aug 17, 2021
05e8d5d
Bluetooth: Controller: Fix BIS LLL events pending check from ULL Low
cvinayak Aug 16, 2021
a966395
Bluetooth: Controller: Use PDU_BIS_US and PDU_BIS_MAX_US correctly
cvinayak Aug 18, 2021
e367585
Bluetooth: Controller: Initial support for BIS on S2/S8 coding
cvinayak Aug 18, 2021
f521361
Bluetooth: controller: Initial integrate of ISOAL for Broadcast ISO
cvinayak May 7, 2021
2be540b
Bluetooth: Controller: Store ISO interval in ULL context
cvinayak Nov 16, 2021
ba3f621
Bluetooth: Controller: Use HCI_AUX_PHY_TO_HCI_PHY
cvinayak Nov 16, 2021
0ac8d20
Bluetooth: Controller: Use defines in AD Data format implementation
cvinayak Nov 16, 2021
cff7683
Bluetooth: Controller: Use define for invalid advertising handle
cvinayak Nov 16, 2021
b5e1fc3
Bluetooth: Controller: Use defines for channel map count and hop range
cvinayak Nov 16, 2021
7fa8259
Bluetooth: Controller: Fix endianness between CPU and PDU contents
cvinayak Nov 16, 2021
11b4ea1
Bluetooth: Controller: Fix PA and LNA conditional compilation
cvinayak Nov 16, 2021
ae23428
Bluetooth: Controller: Use ceiling_fraction function
cvinayak Nov 17, 2021
ab4828f
Bluetooth: Controller: BIS initial implementation review rework
cvinayak Nov 16, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

Large diffs are not rendered by default.

@@ -232,6 +232,7 @@ enum node_rx_type {
NODE_RX_TYPE_SYNC_LOST,
NODE_RX_TYPE_SYNC_CHM_COMPLETE,
NODE_RX_TYPE_SYNC_ISO,
NODE_RX_TYPE_SYNC_ISO_PDU,
NODE_RX_TYPE_SYNC_ISO_LOST,
NODE_RX_TYPE_EXT_ADV_TERMINATE,
NODE_RX_TYPE_BIG_COMPLETE,
@@ -328,6 +329,9 @@ struct node_rx_iso_meta {
/* Define invalid/unassigned Controller LLL context handle */
#define LLL_HANDLE_INVALID 0xFFFF

/* Define invalid/unassigned Controller Advertising LLL context handle */
#define LLL_ADV_HANDLE_INVALID 0xFF

/* Header of node_rx_pdu */
struct node_rx_hdr {
union {
@@ -374,6 +378,10 @@ enum {
#if defined(CONFIG_BT_BROADCASTER)
EVENT_DONE_EXTRA_TYPE_ADV,
EVENT_DONE_EXTRA_TYPE_ADV_AUX,
#if defined(CONFIG_BT_CTLR_ADV_ISO)
EVENT_DONE_EXTRA_TYPE_ADV_ISO_COMPLETE,
EVENT_DONE_EXTRA_TYPE_ADV_ISO_TERMINATE,
#endif /* CONFIG_BT_CTLR_ADV_ISO */
#endif /* CONFIG_BT_BROADCASTER */
#endif /* CONFIG_BT_CTLR_ADV_EXT || CONFIG_BT_CTLR_JIT_SCHEDULING */

@@ -383,6 +391,11 @@ enum {
EVENT_DONE_EXTRA_TYPE_SCAN_AUX,
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
EVENT_DONE_EXTRA_TYPE_SYNC,
#if defined(CONFIG_BT_CTLR_SYNC_ISO)
EVENT_DONE_EXTRA_TYPE_SYNC_ISO_ESTAB,
EVENT_DONE_EXTRA_TYPE_SYNC_ISO,
EVENT_DONE_EXTRA_TYPE_SYNC_ISO_TERMINATE,
#endif /* CONFIG_BT_CTLR_SYNC_ISO */
#endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */
#endif /* CONFIG_BT_CTLR_ADV_EXT */
#endif /* CONFIG_BT_OBSERVER */
@@ -7,6 +7,54 @@
struct lll_adv_iso {
struct lll_hdr hdr;
struct lll_adv *adv;

uint8_t seed_access_addr[4];
uint8_t base_crc_init[2];
uint16_t latency_prepare;
uint16_t latency_event;
uint16_t data_chan_prn_s;
uint16_t data_chan_remap_idx;

uint64_t payload_count:39;
uint64_t enc:1;
uint64_t framing:1;
uint64_t handle:8;
uint64_t cssn:3;

uint8_t data_chan_map[5];
uint8_t data_chan_count:6;
uint8_t num_bis:5;
uint8_t bn:3;
uint8_t nse:5;
uint8_t phy:3;

uint32_t sub_interval:20;
uint32_t max_pdu:8;
uint32_t pto:4;

uint32_t bis_spacing:20;
uint32_t max_sdu:8;
uint32_t irc:4;

uint32_t sdu_interval:20;
uint32_t irc_curr:4;
uint32_t ptc_curr:4;
uint32_t ptc:4;

uint8_t bn_curr:3;
uint8_t bis_curr:5;

uint8_t phy_flags:1;

uint8_t term_req:1;
uint8_t term_ack:1;
uint8_t term_reason;
uint8_t chm_req;
uint8_t chm_ack;

uint8_t ctrl_chan_use;
uint8_t ctrl_expire;
uint16_t ctrl_instant;
};

struct lll_adv_sync {
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

int lll_adv_iso_init(void);
int lll_adv_iso_reset(void);
void lll_adv_iso_create_prepare(void *param);
void lll_adv_iso_prepare(void *param);
@@ -27,6 +27,10 @@ struct lll_sync {
uint8_t filter_policy:1;
uint8_t is_aux_sched:1;

#if defined(CONFIG_BT_CTLR_SYNC_ISO)
uint8_t sca:3;
#endif /* CONFIG_BT_CTLR_SYNC_ISO */

uint16_t skip_prepare;
uint16_t skip_event;
uint16_t event_counter;
@@ -1,9 +1,69 @@
/*
* Copyright (c) 2020 Nordic Semiconductor ASA
* Copyright (c) 2020-2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

struct lll_sync_iso {
struct lll_hdr hdr;

uint8_t seed_access_addr[4];
uint8_t base_crc_init[2];

uint16_t latency_prepare;
uint16_t latency_event;
uint16_t data_chan_prn_s;
uint16_t data_chan_remap_idx;

uint64_t payload_count:39;
uint64_t enc:1;
uint64_t ctrl:1;
uint64_t cssn_curr:3;
uint64_t cssn_next:3;

uint8_t data_chan_map[5];
uint8_t data_chan_count:6;
uint8_t num_bis:5;
uint8_t bn:3;
uint8_t nse:5;
uint8_t phy:3;

uint32_t sub_interval:20;
uint32_t max_pdu:8;
uint32_t pto:4;

uint32_t bis_spacing:20;
uint32_t max_sdu:8;
uint32_t irc:4;

uint32_t sdu_interval:20;
uint32_t irc_curr:4;
uint32_t ptc_curr:4;
uint32_t ptc:4;

uint8_t bn_curr:3;
uint8_t bis_curr:5;

uint8_t term_reason;

uint8_t ctrl_chan_use;
uint16_t ctrl_instant;

struct node_rx_pdu *payload[PDU_BIG_PAYLOAD_COUNT_MAX];
uint8_t payload_count_max;
uint8_t payload_head;
uint8_t payload_tail;

uint32_t window_widening_periodic_us;
uint32_t window_widening_max_us;
uint32_t window_widening_prepare_us;
uint32_t window_widening_event_us;
uint32_t window_size_event_us;
};

int lll_sync_iso_init(void);
int lll_sync_iso_reset(void);
void lll_sync_iso_create_prepare(void *param);
void lll_sync_iso_prepare(void *param);

extern uint8_t ull_sync_iso_lll_handle_get(struct lll_sync_iso *lll);
@@ -83,9 +83,9 @@ static inline bool isr_rx_ci_adva_check(uint8_t tx_addr, uint8_t *addr,
struct pdu_adv *ci);

#if defined(CONFIG_BT_CTLR_ADV_EXT)
#define PAYLOAD_BASED_FRAG_COUNT ((CONFIG_BT_CTLR_ADV_DATA_LEN_MAX + \
PDU_AC_PAYLOAD_SIZE_MAX - 1) / \
PDU_AC_PAYLOAD_SIZE_MAX)
#define PAYLOAD_BASED_FRAG_COUNT \
ceiling_fraction(CONFIG_BT_CTLR_ADV_DATA_LEN_MAX, \
PDU_AC_PAYLOAD_SIZE_MAX)
#define PAYLOAD_FRAG_COUNT MAX(PAYLOAD_BASED_FRAG_COUNT, BT_CTLR_DF_PER_ADV_CTE_NUM_MAX)
#define BT_CTLR_ADV_AUX_SET CONFIG_BT_CTLR_ADV_AUX_SET
#if defined(CONFIG_BT_CTLR_ADV_PERIODIC)
@@ -50,18 +50,6 @@ lll_adv_sync_data_latest_get(struct lll_adv_sync *lll, void **extra_data,
return lll_adv_pdu_latest_get(&lll->data, is_modified);
#endif /* CONFIG_BT_CTLR_ADV_EXT_PDU_EXTRA_DATA_MEMORY */
}

static inline struct pdu_adv *
lll_adv_sync_data_curr_get(struct lll_adv_sync *lll, void **extra_data)
{
uint8_t first = lll->data.first;
#if defined(CONFIG_BT_CTLR_ADV_EXT_PDU_EXTRA_DATA_MEMORY)
if (extra_data) {
*extra_data = lll->data.extra_data[first];
}
#endif /* CONFIG_BT_CTLR_ADV_EXT_PDU_EXTRA_DATA_MEMORY */
return (void *)lll->data.pdu[first];
}
#endif /* CONFIG_BT_CTLR_ADV_PERIODIC */
#endif /* CONFIG_BT_CTLR_ADV_EXT */