bluetooth: controller: removing 'empty' TODO's from refactored LLCP

Cleanup, removing TODOs that should just be removed

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
This commit is contained in:
Erik Brockhoff 2022-03-07 13:55:11 +01:00 committed by Carles Cufí
commit 628d3224f9
9 changed files with 8 additions and 53 deletions

View file

@ -54,16 +54,13 @@ sys_slist_t tx_buffer_wait_list;
static uint8_t common_tx_buffer_alloc;
#endif /* LLCP_TX_CTRL_BUF_QUEUE_ENABLE */
/* TODO: Determine 'correct' number of tx nodes */
static uint8_t buffer_mem_tx[TX_CTRL_BUF_SIZE * LLCP_TX_CTRL_BUF_COUNT];
static struct llcp_mem_pool mem_tx = { .pool = buffer_mem_tx };
/* TODO: Determine 'correct' number of ctx */
static uint8_t buffer_mem_local_ctx[PROC_CTX_BUF_SIZE *
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM];
static struct llcp_mem_pool mem_local_ctx = { .pool = buffer_mem_local_ctx };
/* TODO(thoh-ot): Determine 'correct' number of ctx */
static uint8_t buffer_mem_remote_ctx[PROC_CTX_BUF_SIZE *
CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM];
static struct llcp_mem_pool mem_remote_ctx = { .pool = buffer_mem_remote_ctx };
@ -693,8 +690,6 @@ uint8_t ull_cp_phy_update(struct ll_conn *conn, uint8_t tx, uint8_t flags, uint8
{
struct proc_ctx *ctx;
/* TODO(thoh): Proper checks for role, parameters etc. */
ctx = llcp_create_local_procedure(PROC_PHY_UPDATE);
if (!ctx) {
return BT_HCI_ERR_CMD_DISALLOWED;
@ -724,10 +719,6 @@ uint8_t ull_cp_terminate(struct ll_conn *conn, uint8_t error_code)
ctx->data.term.error_code = error_code;
/* TODO
* Termination procedure may be initiated at any time, even if other
* LLCP is active.
*/
llcp_lr_enqueue(conn, ctx);
return BT_HCI_ERR_SUCCESS;
@ -865,9 +856,6 @@ uint8_t ull_cp_conn_update(struct ll_conn *conn, uint16_t interval_min, uint16_t
LL_ASSERT(0); /* Unknown procedure */
}
/* TODO(tosk): Check what to handle (ADV_SCHED) from this legacy fct. */
/* event_conn_upd_prep() (event_conn_upd_init()) */
llcp_lr_enqueue(conn, ctx);
return BT_HCI_ERR_SUCCESS;
@ -971,7 +959,9 @@ static bool pdu_is_unknown(struct pdu_data *pdu, struct proc_ctx *ctx)
static bool pdu_is_reject(struct pdu_data *pdu, struct proc_ctx *ctx)
{
/* TODO(thoh): For LL_REJECT_IND check if the active procedure is supporting the PDU */
/* For LL_REJECT_IND there is no simple way of confirming protocol validity of the PDU
* for the given procedure, so simply pass it on and let procedure engine deal with it
*/
return (((pdu->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_REJECT_EXT_IND) &&
(ctx->tx_opcode == pdu->llctrl.reject_ext_ind.reject_opcode)) ||
(pdu->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_REJECT_IND));

View file

@ -119,7 +119,6 @@ static void lp_chmu_send_channel_map_update_ind(struct ll_conn *conn, struct pro
} else {
llcp_rr_set_incompat(conn, INCOMPAT_RESOLVABLE);
/* TODO Hardcoded instant delta */
ctx->data.chmu.instant = lp_event_counter(conn) + CHMU_INSTANT_DELTA;
lp_chmu_tx(conn, ctx);
@ -230,7 +229,6 @@ static void rp_chmu_complete(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t
static void rp_chmu_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case RP_CHMU_EVT_RUN:
ctx->state = RP_CHMU_STATE_WAIT_RX_CHAN_MAP_IND;

View file

@ -578,7 +578,6 @@ static void lp_comm_st_wait_tx_ack(struct ll_conn *conn, struct proc_ctx *ctx, u
/* Ignore other evts */
break;
}
/* TODO */
}
static void lp_comm_rx_decode(struct ll_conn *conn, struct proc_ctx *ctx, struct pdu_data *pdu)
@ -644,7 +643,6 @@ static void lp_comm_st_wait_rx(struct ll_conn *conn, struct proc_ctx *ctx, uint8
static void lp_comm_st_wait_ntf(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case LP_COMMON_EVT_RUN:
switch (ctx->proc) {

View file

@ -45,7 +45,7 @@
#define CONN_UPDATE_INSTANT_DELTA 6U
/* TODO: Known, missing items (missing implementation):
* LL/CON/MAS/BV-34-C [Accepting Connection Parameter Request event masked]
* LL/CON/MAS/BV-34-C [Accepting Connection Parameter Request ? event masked]
*/
/* LLCP Local Procedure Connection Update FSM states */
@ -423,7 +423,6 @@ static void lp_cu_check_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint
static void lp_cu_st_wait_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case LP_CU_EVT_RUN:
lp_cu_check_instant(conn, ctx, evt, param);

View file

@ -339,7 +339,6 @@ static void lp_enc_send_start_enc_rsp(struct ll_conn *conn, struct proc_ctx *ctx
static void lp_enc_st_unencrypted(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case LP_ENC_EVT_RUN:
/* Pause Tx data */
@ -462,7 +461,6 @@ static void lp_enc_st_wait_rx_start_enc_rsp(struct ll_conn *conn, struct proc_ct
static void lp_enc_st_wait_ntf(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case LP_ENC_EVT_RUN:
lp_enc_complete(conn, ctx, evt, param);
@ -476,7 +474,6 @@ static void lp_enc_st_wait_ntf(struct ll_conn *conn, struct proc_ctx *ctx, uint8
static void lp_enc_state_encrypted(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case LP_ENC_EVT_RUN:
/* Pause Tx data */
@ -930,7 +927,6 @@ static void rp_enc_state_wait_rx_enc_req(struct ll_conn *conn, struct proc_ctx *
static void rp_enc_state_wait_tx_enc_rsp(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_RUN:
rp_enc_send_enc_rsp(conn, ctx, evt, param);
@ -944,7 +940,6 @@ static void rp_enc_state_wait_tx_enc_rsp(struct ll_conn *conn, struct proc_ctx *
static void rp_enc_state_wait_ntf_ltk_req(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_RUN:
rp_enc_send_ltk_ntf(conn, ctx, evt, param);
@ -958,7 +953,6 @@ static void rp_enc_state_wait_ntf_ltk_req(struct ll_conn *conn, struct proc_ctx
static void rp_enc_state_wait_ltk_reply(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_LTK_REQ_REPLY:
rp_enc_send_start_enc_req(conn, ctx, evt, param);
@ -975,7 +969,6 @@ static void rp_enc_state_wait_ltk_reply(struct ll_conn *conn, struct proc_ctx *c
static void rp_enc_state_wait_tx_start_enc_req(struct ll_conn *conn, struct proc_ctx *ctx,
uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_RUN:
rp_enc_send_start_enc_req(conn, ctx, evt, param);
@ -989,7 +982,6 @@ static void rp_enc_state_wait_tx_start_enc_req(struct ll_conn *conn, struct proc
static void rp_enc_state_wait_tx_reject_ind(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_RUN:
rp_enc_send_reject_ind(conn, ctx, evt, param);
@ -1003,7 +995,6 @@ static void rp_enc_state_wait_tx_reject_ind(struct ll_conn *conn, struct proc_ct
static void rp_enc_state_wait_rx_start_enc_rsp(struct ll_conn *conn, struct proc_ctx *ctx,
uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_START_ENC_RSP:
rp_enc_complete(conn, ctx, evt, param);
@ -1017,7 +1008,6 @@ static void rp_enc_state_wait_rx_start_enc_rsp(struct ll_conn *conn, struct proc
static void rp_enc_state_wait_ntf(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_RUN:
rp_enc_complete(conn, ctx, evt, param);
@ -1031,7 +1021,6 @@ static void rp_enc_state_wait_ntf(struct ll_conn *conn, struct proc_ctx *ctx, ui
static void rp_enc_state_wait_tx_start_enc_rsp(struct ll_conn *conn, struct proc_ctx *ctx,
uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_RUN:
rp_enc_send_start_enc_rsp(conn, ctx, evt, param);
@ -1058,7 +1047,6 @@ static void rp_enc_state_encrypted(struct ll_conn *conn, struct proc_ctx *ctx, u
static void rp_enc_state_wait_rx_pause_enc_req(struct ll_conn *conn, struct proc_ctx *ctx,
uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_PAUSE_ENC_REQ:
/* Pause Tx data */
@ -1080,7 +1068,6 @@ static void rp_enc_state_wait_rx_pause_enc_req(struct ll_conn *conn, struct proc
static void rp_enc_state_wait_tx_pause_enc_rsp(struct ll_conn *conn, struct proc_ctx *ctx,
uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_RUN:
rp_enc_send_pause_enc_rsp(conn, ctx, evt, param);
@ -1094,7 +1081,6 @@ static void rp_enc_state_wait_tx_pause_enc_rsp(struct ll_conn *conn, struct proc
static void rp_enc_state_wait_rx_pause_enc_rsp(struct ll_conn *conn, struct proc_ctx *ctx,
uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case RP_ENC_EVT_PAUSE_ENC_RSP:
/* Continue with an encapsulated Start Procedure */

View file

@ -56,14 +56,8 @@ struct llcp_enc {
/* NOTE: To save memory, SKD(m|s) and IV(m|s) are
* generated just-in-time for PDU enqueuing and are
* therefore not present in this structure.
*/
/* TODO(thoh): Do we want a version without JIT vector
* generation?
*/
/* TODO(thoh): Optimize memory layout.
* * Overlay memory?
* Further candidates for optimizing memory layout.
* * Overlay memory
* * Repurpose memory used by lll.ccm_tx/rx?
*/

View file

@ -293,7 +293,7 @@ static void lr_act_complete(struct ll_conn *conn)
static void lr_act_connect(struct ll_conn *conn)
{
/* TODO */
/* Empty on purpose */
}
static void lr_act_disconnect(struct ll_conn *conn)
@ -459,7 +459,6 @@ void llcp_lr_abort(struct ll_conn *conn)
ctx = lr_dequeue(conn);
}
/* TODO(thoh): Whats missing here ??? */
ull_conn_prt_clear(conn);
llcp_rr_set_incompat(conn, 0U);
lr_set_state(conn, LR_STATE_IDLE);

View file

@ -240,9 +240,6 @@ static uint8_t pu_apply_phy_update(struct ll_conn *conn, struct proc_ctx *ctx)
return (ctx->data.pu.c_to_p_phy || ctx->data.pu.p_to_c_phy);
}
/*
* TODO: this is the same as calc_eff_time in ull_connections.c
*/
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
static uint16_t pu_calc_eff_time(uint8_t max_octets, uint8_t phy, uint16_t default_time)
{
@ -470,7 +467,6 @@ static void lp_pu_send_phy_update_ind(struct ll_conn *conn, struct proc_ctx *ctx
static void lp_pu_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case LP_PU_EVT_RUN:
lp_pu_send_phy_req(conn, ctx, evt, param);
@ -500,7 +496,6 @@ static void lp_pu_st_wait_rx_phy_rsp(struct ll_conn *conn, struct proc_ctx *ctx,
{
switch (evt) {
case LP_PU_EVT_PHY_RSP:
/* TODO: should we swap the function call with variable declaration? */
llcp_rr_set_incompat(conn, INCOMPAT_RESERVED);
/* 'Prefer' the phys from the REQ */
uint8_t tx_pref = ctx->data.pu.tx;
@ -668,7 +663,6 @@ static void lp_pu_check_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint
static void lp_pu_st_wait_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case LP_PU_EVT_RUN:
lp_pu_check_instant(conn, ctx, evt, param);
@ -875,7 +869,6 @@ static void rp_pu_send_phy_rsp(struct ll_conn *conn, struct proc_ctx *ctx, uint8
static void rp_pu_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, void *param)
{
/* TODO */
switch (evt) {
case RP_PU_EVT_RUN:
ctx->state = RP_PU_STATE_WAIT_RX_PHY_REQ;
@ -1035,7 +1028,6 @@ static void rp_pu_check_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint
static void rp_pu_st_wait_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt,
void *param)
{
/* TODO */
switch (evt) {
case RP_PU_EVT_RUN:
rp_pu_check_instant(conn, ctx, evt, param);

View file

@ -444,7 +444,7 @@ static void rr_act_complete(struct ll_conn *conn)
static void rr_act_connect(struct ll_conn *conn)
{
/* TODO */
/* Empty on purpose */
}
static void rr_act_disconnect(struct ll_conn *conn)
@ -814,7 +814,6 @@ static void rr_abort(struct ll_conn *conn)
ctx = rr_dequeue(conn);
}
/* TODO(thoh): Whats missing here ??? */
rr_set_collision(conn, 0U);
rr_set_state(conn, RR_STATE_IDLE);
}