Skip to content

Commit 6fe1299

Browse files
Andries Kruithofcarlescufi
authored andcommitted
Bluetooth: controller: llcp: fix CI tests for new LLCP
Setting the new LLCP as default exposed errors in CI tests, which are fixed here Note that advanced scheduling needs to be disabled. Work is in progress for implementing this for the new LLCP Signed-off-by: Andries Kruithof <[email protected]>
1 parent e1c2c36 commit 6fe1299

File tree

8 files changed

+22
-8
lines changed

8 files changed

+22
-8
lines changed

subsys/bluetooth/controller/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if(CONFIG_BT_LL_SW_SPLIT)
7171
if(CONFIG_BT_LL_SW_LLCP_LEGACY)
7272
else()
7373
zephyr_library_sources_ifdef(
74-
CONFIG_BT_PHY_UPDATE
74+
CONFIG_BT_CTLR_PHY
7575
ll_sw/ull_llcp_phy.c
7676
)
7777
zephyr_library_sources_ifdef(

subsys/bluetooth/controller/Kconfig.ll_sw_split

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ config BT_LL_SW_LLCP
9191
help
9292
Use the new Bluetooth Low Energy Software Link Layer Control Procedure implementation.
9393

94-
9594
endchoice
9695

9796

@@ -557,6 +556,7 @@ config BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM
557556

558557
config BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM
559558
int "Number of local control procedure contexts to be available across all connections"
559+
default 4 if (BT_AUTO_PHY_UPDATE=y || BT_AUTO_DATA_LEN_UPDATE=y) && BT_CTLR_LLCP_CONN < 4
560560
default 2 if BT_CTLR_LLCP_CONN = 1
561561
default BT_CTLR_LLCP_CONN if BT_CTLR_LLCP_CONN > 1
562562
range 2 255

subsys/bluetooth/controller/ll_sw/ull_adv_iso.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,14 @@ static uint32_t adv_iso_start(struct ll_adv_iso_set *adv_iso,
804804
}
805805
ticks_slot = adv_iso->ull.ticks_slot + ticks_slot_overhead;
806806

807+
#if defined(BT_CTLR_SCHED_ADVANCED)
807808
/* Find the slot after Periodic Advertisings events */
808809
err = ull_sched_adv_aux_sync_free_slot_get(TICKER_USER_ID_THREAD,
809810
ticks_slot, &ticks_anchor);
811+
#else
812+
/* advanced scheduling not enabled */
813+
err = -1;
814+
#endif
810815
if (err) {
811816
ticks_anchor = ticker_ticks_now_get();
812817
}

subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include <soc.h>
5252
#include "hal/debug.h"
5353

54+
#if defined(CONFIG_BT_PERIPHERAL)
5455
static uint16_t cc_event_counter(struct ll_conn *conn)
5556
{
5657
struct lll_conn *lll;
@@ -67,7 +68,6 @@ static uint16_t cc_event_counter(struct ll_conn *conn)
6768
return event_counter;
6869
}
6970

70-
#if defined(CONFIG_BT_PERIPHERAL)
7171
/* LLCP Remote Procedure FSM states */
7272
enum {
7373
/* Establish Procedure */
@@ -291,7 +291,7 @@ static uint8_t rp_cc_check_phy(struct ll_conn *conn, struct proc_ctx *ctx,
291291
/* Unsupported phy selected */
292292
return BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL;
293293
}
294-
#endif
294+
#endif /* CONFIG_BT_CTLR_PHY */
295295

296296
return BT_HCI_ERR_SUCCESS;
297297
}

subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838

3939
#include "ull_conn_internal.h"
4040
#include "ull_conn_types.h"
41+
42+
#if defined(CONFIG_BT_CTLR_USER_EXT)
43+
#include "ull_vendor.h"
44+
#endif /* CONFIG_BT_CTLR_USER_EXT */
45+
4146
#include "ull_internal.h"
4247
#include "ull_llcp.h"
4348
#include "ull_llcp_features.h"
@@ -203,6 +208,7 @@ static bool cu_should_notify_host(struct proc_ctx *ctx)
203208
(ctx->data.cu.params_changed != 0U));
204209
}
205210

211+
#if defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_CTLR_CONN_PARAM_REQ)
206212
static void lp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode)
207213
{
208214
struct node_tx *tx;
@@ -248,6 +254,7 @@ static void lp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode)
248254
}
249255
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
250256
}
257+
#endif /* CONFIG_BT_CENTRAL || CONFIG_BT_CTLR_CONN_PARAM_REQ */
251258

252259
static void lp_cu_ntf(struct ll_conn *conn, struct proc_ctx *ctx)
253260
{

subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ uint8_t ll_cis_reject(uint16_t handle, uint8_t reason)
113113
#if defined(CONFIG_BT_LL_SW_LLCP_LEGACY)
114114
status = BT_HCI_ERR_CMD_DISALLOWED;
115115
#else
116-
struct ll_conn *acl_conn = ll_cis_reply_ok(handle, &status);
116+
struct ll_conn *acl_conn = ll_cis_get_acl_awaiting_reply(handle, &status);
117117

118118
if (acl_conn) {
119119
/* Accept request */

subsys/bluetooth/controller/ll_sw/ull_sched.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
5858
#endif
5959
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
6060

61-
#if defined(CONFIG_BT_CONN)
61+
#if defined(CONFIG_BT_CONN) && (defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_LL_SW_LLCP_LEGACY))
6262
static void after_cen_offset_get(uint16_t conn_interval, uint32_t ticks_slot,
6363
uint32_t ticks_anchor,
6464
uint32_t *win_offset_us);
65-
#endif /* CONFIG_BT_CONN */
65+
#endif /* CONFIG_BT_CONN && (CONFIG_BT_CENTRAL || CONFIG_BT_LL_SW_LLCP_LEGACY) */
6666

6767
typedef struct ull_hdr *(*ull_hdr_get_func)(uint8_t ticker_id,
6868
uint32_t *ticks_slot);
@@ -595,6 +595,7 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
595595
#endif /* CONFIG_BT_LL_SW_LLCP_LEGACY */
596596
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
597597

598+
#if defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_LL_SW_LLCP_LEGACY)
598599
static void after_cen_offset_get(uint16_t conn_interval, uint32_t ticks_slot,
599600
uint32_t ticks_anchor,
600601
uint32_t *win_offset_us)
@@ -633,6 +634,7 @@ static void after_cen_offset_get(uint16_t conn_interval, uint32_t ticks_slot,
633634
}
634635
}
635636
}
637+
#endif /* CONFIG_BT_CENTRAL || CONFIG_BT_LL_SW_LLCP_LEGACY */
636638
#endif /* CONFIG_BT_CONN */
637639

638640
static uint8_t after_match_slot_get(uint8_t user_id, uint32_t ticks_slot_abs,

tests/bluetooth/bsim_bt/bsim_test_multiple/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CONFIG_BT_AUTO_PHY_UPDATE=y
1010
CONFIG_BT_USER_DATA_LEN_UPDATE=y
1111
CONFIG_BT_AUTO_DATA_LEN_UPDATE=y
1212

13-
CONFIG_BT_MAX_CONN=250
13+
CONFIG_BT_MAX_CONN=150
1414
CONFIG_BT_ID_MAX=250
1515

1616
# L2CAP, ATT and SMP usage cause data transmission deadlock due to shortage

0 commit comments

Comments
 (0)