From c50b474e017befa1d295e2df3e1461cd72cd40bd Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Tue, 4 Jan 2022 09:01:17 +0100 Subject: [PATCH] BLuetooth: Controller: llcp: Fix wrong conditions in remote CTE req There were wrong conditions in rp_comm_tx function for CTE request that vefiry if: - PHY is allowed one, - CTE length is within allowed value. The commit fixes it. Signed-off-by: Piotr Pryga --- subsys/bluetooth/controller/ll_sw/ull_llcp_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c index 7b3b50eab2a..15e5b663e02 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c @@ -748,12 +748,12 @@ static void rp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) /* If the PHY update is not possible, then PHY1M is used. * CTE is supported for PHY1M. */ - if (conn->lll.phy_tx != PHY_CODED) { + if (conn->lll.phy_tx == PHY_CODED) { err_code = BT_HCI_ERR_INVALID_LL_PARAM; } #endif /* CONFIG_BT_PHY_UPDATE */ if (!(conn->llcp.cte_rsp.cte_types & BIT(conn->llcp.cte_req.cte_type)) && - conn->llcp.cte_rsp.max_cte_len >= conn->llcp.cte_req.min_cte_len) { + conn->llcp.cte_rsp.max_cte_len < conn->llcp.cte_req.min_cte_len) { err_code = BT_HCI_ERR_UNSUPP_LL_PARAM_VAL; }