Bluetooth: Controller: llcp: Make remote CTE REQ to compile with CTE RSP

Part of the CTE request procdure that is related with handling of
remote request should be compiled when CTE RSP is enabled.
Withouth it CTE response will not work. Local CTE request does not
need code reponsible for handling of remote reques.

The commit changes conditional compilation guards.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
This commit is contained in:
Piotr Pryga 2022-01-08 11:01:24 +01:00 committed by Christopher Friedt
commit 6587336a5b
5 changed files with 22 additions and 13 deletions

View file

@ -692,11 +692,11 @@ static void rp_comm_rx_decode(struct ll_conn *conn, struct proc_ctx *ctx, struct
llcp_tx_pause_data(conn);
break;
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RSP)
case PDU_DATA_LLCTRL_TYPE_CTE_REQ:
llcp_pdu_decode_cte_req(conn, pdu);
break;
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */
default:
/* Unknown opcode */
LL_ASSERT(0);
@ -737,13 +737,14 @@ static void rp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx)
ctx->rx_opcode = PDU_DATA_LLCTRL_TYPE_LENGTH_RSP;
break;
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RSP)
case PROC_CTE_REQ: {
uint8_t err_code = 0;
if (conn->llcp.cte_rsp.is_enabled == 0) {
err_code = BT_HCI_ERR_UNSUPP_LL_PARAM_VAL;
}
#if defined(CONFIG_BT_PHY_UPDATE)
/* If the PHY update is not possible, then PHY1M is used.
* CTE is supported for PHY1M.
@ -766,7 +767,7 @@ static void rp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx)
}
break;
}
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */
default:
/* Unknown procedure */
LL_ASSERT(0);
@ -920,7 +921,7 @@ static void rp_comm_send_rsp(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t
}
break;
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RSP)
case PROC_CTE_REQ:
if (ctx->pause || !llcp_tx_alloc_peek(conn, ctx)) {
ctx->state = RP_COMMON_STATE_WAIT_TX;
@ -930,7 +931,7 @@ static void rp_comm_send_rsp(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t
ctx->state = RP_COMMON_STATE_IDLE;
}
break;
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */
default:
/* Unknown procedure */
LL_ASSERT(0);