Skip to content

Commit 26f6941

Browse files
erbr-otcarlescufi
authored andcommitted
Bluetooth: controller: using REJECT_IND when EXT_IND was not negotiated
Unless a feature exchange determines support for REJECT_EXT_IND use REJECT_IND for collision rejection Signed-off-by: Erik Brockhoff <[email protected]>
1 parent 0d94ad6 commit 26f6941

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "pdu.h"
2222
#include "ll.h"
2323
#include "ll_settings.h"
24+
#include "ll_feat.h"
2425

2526
#include "lll.h"
2627
#include "lll/lll_df_types.h"
@@ -31,6 +32,7 @@
3132
#include "ull_conn_types.h"
3233
#include "ull_conn_internal.h"
3334
#include "ull_llcp.h"
35+
#include "ull_llcp_features.h"
3436
#include "ull_llcp_internal.h"
3537

3638
#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)
371373
/* Encode LL Control PDU */
372374
switch (opcode) {
373375
case PDU_DATA_LLCTRL_TYPE_REJECT_IND:
374-
/* TODO(thoh): Select between LL_REJECT_IND and LL_REJECT_EXT_IND */
375-
llcp_pdu_encode_reject_ext_ind(pdu, conn->llcp.remote.reject_opcode,
376-
BT_HCI_ERR_LL_PROC_COLLISION);
376+
if (conn->llcp.fex.valid && feature_ext_rej_ind(conn)) {
377+
llcp_pdu_encode_reject_ext_ind(pdu, conn->llcp.remote.reject_opcode,
378+
BT_HCI_ERR_LL_PROC_COLLISION);
379+
} else {
380+
llcp_pdu_encode_reject_ind(pdu, BT_HCI_ERR_LL_PROC_COLLISION);
381+
}
377382
break;
378383
case PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP:
379384
llcp_pdu_encode_unknown_rsp(ctx, pdu);

tests/bluetooth/controller/ctrl_conn_update/src/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,9 @@ void test_conn_update_central_loc_collision(void)
918918
/* Role */
919919
test_set_role(&conn, BT_HCI_ROLE_CENTRAL);
920920

921+
/* Emulate valid feature exchange */
922+
conn.llcp.fex.valid = 1;
923+
921924
/* Connect */
922925
ull_cp_state_set(&conn, ULL_CP_CONNECTED);
923926

@@ -941,8 +944,6 @@ void test_conn_update_central_loc_collision(void)
941944
/* Release Tx */
942945
ull_cp_release_tx(&conn, tx);
943946

944-
/**/
945-
946947
/* Prepare */
947948
event_prepare(&conn);
948949

tests/bluetooth/controller/ctrl_phy_update/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,9 @@ void test_phy_update_central_loc_collision(void)
699699
/* Role */
700700
test_set_role(&conn, BT_HCI_ROLE_CENTRAL);
701701

702+
/* Emulate valid feature exchange */
703+
conn.llcp.fex.valid = 1;
704+
702705
/* Connect */
703706
ull_cp_state_set(&conn, ULL_CP_CONNECTED);
704707

tests/bluetooth/controller/mock_ctrl/include/kconfig.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
#define CONFIG_BT_CTLR_CONN_PARAM_REQ y
7676
#endif
7777

78+
#ifndef CONFIG_BT_CTLR_EXT_REJ_IND
79+
#define CONFIG_BT_CTLR_EXT_REJ_IND y
80+
#endif
81+
7882
#ifndef CONFIG_BT_CTLR_XTAL_ADVANCED
7983
#define CONFIG_BT_CTLR_XTAL_ADVANCED y
8084
#endif

0 commit comments

Comments
 (0)