Skip to content

Commit b452321

Browse files
wopu-otnashif
authored andcommitted
Bluetooth: controller: Add init/reset stubs for CIS central/peripheral ULL
Add stub functions to initialize and reset CIS central and CIS peripheral roles in ULL. Signed-off-by: Wolfgang Puffitsch <[email protected]>
1 parent 4c9f893 commit b452321

File tree

8 files changed

+148
-2
lines changed

8 files changed

+148
-2
lines changed

subsys/bluetooth/controller/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ if(CONFIG_BT_LL_SW_SPLIT)
9090
)
9191
endif()
9292

93+
if(CONFIG_BT_CTLR_PERIPHERAL_ISO OR
94+
CONFIG_BT_CTLR_CENTRAL_ISO)
95+
zephyr_library_sources(
96+
ll_sw/ull_conn_iso.c
97+
)
98+
endif()
9399
if(CONFIG_BT_CTLR_ADV_ISO OR
94100
CONFIG_BT_CTLR_SYNC_ISO OR
95101
CONFIG_BT_CTLR_PERIPHERAL_ISO OR

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
#include "ull_sync_internal.h"
5353
#include "ull_sync_iso_internal.h"
5454
#include "ull_conn_internal.h"
55+
#include "ull_conn_iso_internal.h"
56+
#include "ull_central_iso_internal.h"
57+
#include "ull_peripheral_iso_internal.h"
5558
#include "ull_df.h"
5659

5760
#if defined(CONFIG_BT_CTLR_USER_EXT)
@@ -459,12 +462,34 @@ int ll_init(struct k_sem *sem_rx)
459462
* CONFIG_BT_CTLR_PERIPHERAL_ISO || CONFIG_BT_CTLR_CENTRAL_ISO
460463
*/
461464

465+
#if defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) || \
466+
defined(CONFIG_BT_CTLR_CENTRAL_ISO)
467+
err = ull_conn_iso_init();
468+
if (err) {
469+
return err;
470+
}
471+
#endif /* CONFIG_BT_CTLR_PERIPHERAL_ISO || CONFIG_BT_CTLR_CENTRAL_ISO */
472+
473+
#if defined(CONFIG_BT_CTLR_PERIPHERAL_ISO)
474+
err = ull_peripheral_iso_init();
475+
if (err) {
476+
return err;
477+
}
478+
#endif /* CONFIG_BT_CTLR_PERIPHERAL_ISO */
479+
480+
#if defined(CONFIG_BT_CTLR_CENTRAL_ISO)
481+
err = ull_central_iso_init();
482+
if (err) {
483+
return err;
484+
}
485+
#endif /* CONFIG_BT_CTLR_CENTRAL_ISO */
486+
462487
#if defined(CONFIG_BT_CTLR_ADV_ISO)
463488
err = ull_adv_iso_init();
464489
if (err) {
465490
return err;
466491
}
467-
#endif /* CONFIG_BT_CONN */
492+
#endif /* CONFIG_BT_CTLR_ADV_ISO */
468493

469494
#if IS_ENABLED(CONFIG_BT_CTLR_DF)
470495
err = lll_df_init();
@@ -535,11 +560,27 @@ void ll_reset(void)
535560
* CONFIG_BT_CTLR_PERIPHERAL_ISO || CONFIG_BT_CTLR_CENTRAL_ISO
536561
*/
537562

563+
#if defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) || \
564+
defined(CONFIG_BT_CTLR_CENTRAL_ISO)
565+
err = ull_conn_iso_reset();
566+
LL_ASSERT(!err);
567+
#endif /* CONFIG_BT_CTLR_PERIPHERAL_ISO || CONFIG_BT_CTLR_CENTRAL_ISO */
568+
569+
#if defined(CONFIG_BT_CTLR_PERIPHERAL_ISO)
570+
err = ull_peripheral_iso_reset();
571+
LL_ASSERT(!err);
572+
#endif /* CONFIG_BT_CTLR_PERIPHERAL_ISO */
573+
574+
#if defined(CONFIG_BT_CTLR_CENTRAL_ISO)
575+
err = ull_central_iso_reset();
576+
LL_ASSERT(!err);
577+
#endif /* CONFIG_BT_CTLR_CENTRAL_ISO */
578+
538579
#if defined(CONFIG_BT_CTLR_ADV_ISO)
539580
/* Reset periodic sync sets */
540581
err = ull_adv_iso_reset();
541582
LL_ASSERT(!err);
542-
#endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */
583+
#endif /* CONFIG_BT_CTLR_ADV_ISO */
543584

544585
#if IS_ENABLED(CONFIG_BT_CTLR_DF)
545586
err = ull_df_reset();

subsys/bluetooth/controller/ll_sw/ull_central_iso.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,13 @@ void ll_cis_create(uint16_t cis_handle, uint16_t acl_handle)
122122
ARG_UNUSED(cis_handle);
123123
ARG_UNUSED(acl_handle);
124124
}
125+
126+
int ull_central_iso_init(void)
127+
{
128+
return 0;
129+
}
130+
131+
int ull_central_iso_reset(void)
132+
{
133+
return 0;
134+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright (c) 2021 Demant
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* Helper functions to initialize and reset ull_central_iso module */
8+
int ull_central_iso_init(void);
9+
int ull_central_iso_reset(void);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright (c) 2021 Demant
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr.h>
8+
9+
#include "util/mem.h"
10+
#include "util/memq.h"
11+
12+
#include "lll.h"
13+
#include "lll_conn_iso.h"
14+
#include "ull_conn_iso_types.h"
15+
16+
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
17+
#define LOG_MODULE_NAME bt_ctlr_ull_conn_iso
18+
#include "common/log.h"
19+
#include "hal/debug.h"
20+
21+
static struct ll_conn_iso_stream cis_pool[CONFIG_BT_CTLR_CONN_ISO_STREAMS];
22+
static void *cis_free;
23+
24+
static struct ll_conn_iso_group cig_pool[CONFIG_BT_CTLR_CONN_ISO_GROUPS];
25+
static void *cig_free;
26+
27+
static int init_reset(void);
28+
29+
int ull_conn_iso_init(void)
30+
{
31+
return init_reset();
32+
}
33+
34+
int ull_conn_iso_reset(void)
35+
{
36+
return init_reset();
37+
}
38+
39+
static int init_reset(void)
40+
{
41+
/* Initialize CIS pool */
42+
mem_init(cis_pool, sizeof(struct ll_conn_iso_stream),
43+
sizeof(cis_pool) / sizeof(struct ll_conn_iso_stream),
44+
&cis_free);
45+
46+
/* Initialize CIG pool */
47+
mem_init(cig_pool, sizeof(struct ll_conn_iso_group),
48+
sizeof(cig_pool) / sizeof(struct ll_conn_iso_group),
49+
&cig_free);
50+
51+
return 0;
52+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright (c) 2021 Demant
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* Helper functions to initialize and reset ull_conn_iso module */
8+
int ull_conn_iso_init(void);
9+
int ull_conn_iso_reset(void);

subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,13 @@ uint8_t ll_cis_reject(uint16_t handle, uint8_t reason)
2525

2626
return BT_HCI_ERR_CMD_DISALLOWED;
2727
}
28+
29+
int ull_peripheral_iso_init(void)
30+
{
31+
return 0;
32+
}
33+
34+
int ull_peripheral_iso_reset(void)
35+
{
36+
return 0;
37+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright (c) 2021 Demant
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* Helper functions to initialize and reset ull_peripheral_iso module */
8+
int ull_peripheral_iso_init(void);
9+
int ull_peripheral_iso_reset(void);

0 commit comments

Comments
 (0)