Bluetooth: controller: llcp: fix for failing LL qualification tests

Fixes issue re. sending packets after sending TERMINATE_IND.
Fixes issue re. erroneous error code on 'timed out' termination (ie
when peer does not ack terminate_ind)

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
This commit is contained in:
Erik Brockhoff 2022-05-25 09:17:59 +02:00 committed by Carles Cufí
commit 25e6279493
2 changed files with 4 additions and 1 deletions

View file

@ -1464,9 +1464,11 @@ void ull_conn_done(struct node_rx_event_done *done)
(((conn->llcp_terminate.req - (((conn->llcp_terminate.req -
conn->llcp_terminate.ack) & 0xFF) == conn->llcp_terminate.ack) & 0xFF) ==
TERM_ACKED) || TERM_ACKED) ||
#endif /* CONFIG_BT_LL_SW_LLCP_LEGACY */
conn->central.terminate_ack || conn->central.terminate_ack ||
(reason_final == BT_HCI_ERR_TERM_DUE_TO_MIC_FAIL) (reason_final == BT_HCI_ERR_TERM_DUE_TO_MIC_FAIL)
#else /* CONFIG_BT_LL_SW_LLCP_LEGACY */
1
#endif /* CONFIG_BT_LL_SW_LLCP_LEGACY */
#else /* CONFIG_BT_CENTRAL */ #else /* CONFIG_BT_CENTRAL */
1 1
#endif /* CONFIG_BT_CENTRAL */ #endif /* CONFIG_BT_CENTRAL */

View file

@ -514,6 +514,7 @@ static void lp_comm_send_req(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t
ctx->state = LP_COMMON_STATE_WAIT_TX; ctx->state = LP_COMMON_STATE_WAIT_TX;
} else { } else {
lp_comm_tx(conn, ctx); lp_comm_tx(conn, ctx);
ctx->data.term.error_code = BT_HCI_ERR_LOCALHOST_TERM_CONN;
ctx->state = LP_COMMON_STATE_WAIT_TX_ACK; ctx->state = LP_COMMON_STATE_WAIT_TX_ACK;
} }
break; break;