Skip to content

Commit

Permalink
Bluetooth: controller: llcp: fix CI tests for new LLCP
Browse files Browse the repository at this point in the history
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 <andries.kruithof@nordicsemi.no>
  • Loading branch information
kruithofa authored and carlescufi committed Aug 14, 2022
1 parent e1c2c36 commit 6fe1299
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion subsys/bluetooth/controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if(CONFIG_BT_LL_SW_SPLIT)
if(CONFIG_BT_LL_SW_LLCP_LEGACY)
else()
zephyr_library_sources_ifdef(
CONFIG_BT_PHY_UPDATE
CONFIG_BT_CTLR_PHY
ll_sw/ull_llcp_phy.c
)
zephyr_library_sources_ifdef(
Expand Down
2 changes: 1 addition & 1 deletion subsys/bluetooth/controller/Kconfig.ll_sw_split
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ config BT_LL_SW_LLCP
help
Use the new Bluetooth Low Energy Software Link Layer Control Procedure implementation.


endchoice


Expand Down Expand Up @@ -557,6 +556,7 @@ config BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM

config BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM
int "Number of local control procedure contexts to be available across all connections"
default 4 if (BT_AUTO_PHY_UPDATE=y || BT_AUTO_DATA_LEN_UPDATE=y) && BT_CTLR_LLCP_CONN < 4
default 2 if BT_CTLR_LLCP_CONN = 1
default BT_CTLR_LLCP_CONN if BT_CTLR_LLCP_CONN > 1
range 2 255
Expand Down
5 changes: 5 additions & 0 deletions subsys/bluetooth/controller/ll_sw/ull_adv_iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,14 @@ static uint32_t adv_iso_start(struct ll_adv_iso_set *adv_iso,
}
ticks_slot = adv_iso->ull.ticks_slot + ticks_slot_overhead;

#if defined(BT_CTLR_SCHED_ADVANCED)
/* Find the slot after Periodic Advertisings events */
err = ull_sched_adv_aux_sync_free_slot_get(TICKER_USER_ID_THREAD,
ticks_slot, &ticks_anchor);
#else
/* advanced scheduling not enabled */
err = -1;
#endif
if (err) {
ticks_anchor = ticker_ticks_now_get();
}
Expand Down
4 changes: 2 additions & 2 deletions subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <soc.h>
#include "hal/debug.h"

#if defined(CONFIG_BT_PERIPHERAL)
static uint16_t cc_event_counter(struct ll_conn *conn)
{
struct lll_conn *lll;
Expand All @@ -67,7 +68,6 @@ static uint16_t cc_event_counter(struct ll_conn *conn)
return event_counter;
}

#if defined(CONFIG_BT_PERIPHERAL)
/* LLCP Remote Procedure FSM states */
enum {
/* Establish Procedure */
Expand Down Expand Up @@ -291,7 +291,7 @@ static uint8_t rp_cc_check_phy(struct ll_conn *conn, struct proc_ctx *ctx,
/* Unsupported phy selected */
return BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL;
}
#endif
#endif /* CONFIG_BT_CTLR_PHY */

return BT_HCI_ERR_SUCCESS;
}
Expand Down
7 changes: 7 additions & 0 deletions subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@

#include "ull_conn_internal.h"
#include "ull_conn_types.h"

#if defined(CONFIG_BT_CTLR_USER_EXT)
#include "ull_vendor.h"
#endif /* CONFIG_BT_CTLR_USER_EXT */

#include "ull_internal.h"
#include "ull_llcp.h"
#include "ull_llcp_features.h"
Expand Down Expand Up @@ -203,6 +208,7 @@ static bool cu_should_notify_host(struct proc_ctx *ctx)
(ctx->data.cu.params_changed != 0U));
}

#if defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_CTLR_CONN_PARAM_REQ)
static void lp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode)
{
struct node_tx *tx;
Expand Down Expand Up @@ -248,6 +254,7 @@ static void lp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode)
}
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
}
#endif /* CONFIG_BT_CENTRAL || CONFIG_BT_CTLR_CONN_PARAM_REQ */

static void lp_cu_ntf(struct ll_conn *conn, struct proc_ctx *ctx)
{
Expand Down
2 changes: 1 addition & 1 deletion subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ uint8_t ll_cis_reject(uint16_t handle, uint8_t reason)
#if defined(CONFIG_BT_LL_SW_LLCP_LEGACY)
status = BT_HCI_ERR_CMD_DISALLOWED;
#else
struct ll_conn *acl_conn = ll_cis_reply_ok(handle, &status);
struct ll_conn *acl_conn = ll_cis_get_acl_awaiting_reply(handle, &status);

if (acl_conn) {
/* Accept request */
Expand Down
6 changes: 4 additions & 2 deletions subsys/bluetooth/controller/ll_sw/ull_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
#endif
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */

#if defined(CONFIG_BT_CONN)
#if defined(CONFIG_BT_CONN) && (defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_LL_SW_LLCP_LEGACY))
static void after_cen_offset_get(uint16_t conn_interval, uint32_t ticks_slot,
uint32_t ticks_anchor,
uint32_t *win_offset_us);
#endif /* CONFIG_BT_CONN */
#endif /* CONFIG_BT_CONN && (CONFIG_BT_CENTRAL || CONFIG_BT_LL_SW_LLCP_LEGACY) */

typedef struct ull_hdr *(*ull_hdr_get_func)(uint8_t ticker_id,
uint32_t *ticks_slot);
Expand Down Expand Up @@ -595,6 +595,7 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
#endif /* CONFIG_BT_LL_SW_LLCP_LEGACY */
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */

#if defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_LL_SW_LLCP_LEGACY)
static void after_cen_offset_get(uint16_t conn_interval, uint32_t ticks_slot,
uint32_t ticks_anchor,
uint32_t *win_offset_us)
Expand Down Expand Up @@ -633,6 +634,7 @@ static void after_cen_offset_get(uint16_t conn_interval, uint32_t ticks_slot,
}
}
}
#endif /* CONFIG_BT_CENTRAL || CONFIG_BT_LL_SW_LLCP_LEGACY */
#endif /* CONFIG_BT_CONN */

static uint8_t after_match_slot_get(uint8_t user_id, uint32_t ticks_slot_abs,
Expand Down
2 changes: 1 addition & 1 deletion tests/bluetooth/bsim_bt/bsim_test_multiple/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CONFIG_BT_AUTO_PHY_UPDATE=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_AUTO_DATA_LEN_UPDATE=y

CONFIG_BT_MAX_CONN=250
CONFIG_BT_MAX_CONN=150
CONFIG_BT_ID_MAX=250

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

0 comments on commit 6fe1299

Please sign in to comment.