diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c index 243087d0970..e6014fcd258 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c @@ -21,6 +21,7 @@ #include "pdu.h" #include "ll.h" #include "ll_settings.h" +#include "ll_feat.h" #include "lll.h" #include "lll/lll_df_types.h" @@ -31,6 +32,7 @@ #include "ull_conn_types.h" #include "ull_conn_internal.h" #include "ull_llcp.h" +#include "ull_llcp_features.h" #include "ull_llcp_internal.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) @@ -371,9 +373,12 @@ static void rr_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) /* Encode LL Control PDU */ switch (opcode) { case PDU_DATA_LLCTRL_TYPE_REJECT_IND: - /* TODO(thoh): Select between LL_REJECT_IND and LL_REJECT_EXT_IND */ - llcp_pdu_encode_reject_ext_ind(pdu, conn->llcp.remote.reject_opcode, - BT_HCI_ERR_LL_PROC_COLLISION); + if (conn->llcp.fex.valid && feature_ext_rej_ind(conn)) { + llcp_pdu_encode_reject_ext_ind(pdu, conn->llcp.remote.reject_opcode, + BT_HCI_ERR_LL_PROC_COLLISION); + } else { + llcp_pdu_encode_reject_ind(pdu, BT_HCI_ERR_LL_PROC_COLLISION); + } break; case PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP: llcp_pdu_encode_unknown_rsp(ctx, pdu); diff --git a/tests/bluetooth/controller/ctrl_conn_update/src/main.c b/tests/bluetooth/controller/ctrl_conn_update/src/main.c index 71ee12daa79..0aabd2e4287 100644 --- a/tests/bluetooth/controller/ctrl_conn_update/src/main.c +++ b/tests/bluetooth/controller/ctrl_conn_update/src/main.c @@ -918,6 +918,9 @@ void test_conn_update_central_loc_collision(void) /* Role */ test_set_role(&conn, BT_HCI_ROLE_CENTRAL); + /* Emulate valid feature exchange */ + conn.llcp.fex.valid = 1; + /* Connect */ ull_cp_state_set(&conn, ULL_CP_CONNECTED); @@ -941,8 +944,6 @@ void test_conn_update_central_loc_collision(void) /* Release Tx */ ull_cp_release_tx(&conn, tx); - /**/ - /* Prepare */ event_prepare(&conn); diff --git a/tests/bluetooth/controller/ctrl_phy_update/src/main.c b/tests/bluetooth/controller/ctrl_phy_update/src/main.c index 6594cdd6aa5..0bfe178093b 100644 --- a/tests/bluetooth/controller/ctrl_phy_update/src/main.c +++ b/tests/bluetooth/controller/ctrl_phy_update/src/main.c @@ -699,6 +699,9 @@ void test_phy_update_central_loc_collision(void) /* Role */ test_set_role(&conn, BT_HCI_ROLE_CENTRAL); + /* Emulate valid feature exchange */ + conn.llcp.fex.valid = 1; + /* Connect */ ull_cp_state_set(&conn, ULL_CP_CONNECTED); diff --git a/tests/bluetooth/controller/mock_ctrl/include/kconfig.h b/tests/bluetooth/controller/mock_ctrl/include/kconfig.h index d1c80e9126c..a5a097ea2b8 100644 --- a/tests/bluetooth/controller/mock_ctrl/include/kconfig.h +++ b/tests/bluetooth/controller/mock_ctrl/include/kconfig.h @@ -75,6 +75,10 @@ #define CONFIG_BT_CTLR_CONN_PARAM_REQ y #endif +#ifndef CONFIG_BT_CTLR_EXT_REJ_IND +#define CONFIG_BT_CTLR_EXT_REJ_IND y +#endif + #ifndef CONFIG_BT_CTLR_XTAL_ADVANCED #define CONFIG_BT_CTLR_XTAL_ADVANCED y #endif