Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18d791d8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Check CCB state before executing channel state machine events"

parents 1cecd151 6f697b45
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -67,6 +67,11 @@ static char *l2c_csm_get_event_name (UINT16 event);
*******************************************************************************/
void l2c_csm_execute (tL2C_CCB *p_ccb, UINT16 event, void *p_data)
{
    if (!l2cu_is_ccb_active(p_ccb)) {
        L2CAP_TRACE_WARNING("%s CCB not in use, event (%d) cannot be processed", __func__, event);
        return;
    }

    switch (p_ccb->chnl_state)
    {
    case CST_CLOSED:
+1 −0
Original line number Diff line number Diff line
@@ -639,6 +639,7 @@ extern void l2cu_send_peer_ble_credit_based_disconn_req(tL2C_CCB *p_ccb);
extern BOOLEAN l2cu_initialize_fixed_ccb (tL2C_LCB *p_lcb, UINT16 fixed_cid, tL2CAP_FCR_OPTS *p_fcr);
extern void    l2cu_no_dynamic_ccbs (tL2C_LCB *p_lcb);
extern void    l2cu_process_fixed_chnl_resp (tL2C_LCB *p_lcb);
extern BOOLEAN l2cu_is_ccb_active (tL2C_CCB *p_ccb);

/* Functions provided by l2c_ucd.c
************************************
+14 −0
Original line number Diff line number Diff line
@@ -3824,3 +3824,17 @@ void l2cu_check_channel_congestion (tL2C_CCB *p_ccb)
    }
}

/*******************************************************************************
**
** Function         l2cu_is_ccb_active
**
** Description      Check if Channel Control Block is in use or released
**
** Returns          BOOLEAN - TRUE if Channel Control Block is in use
**                            FALSE if p_ccb is null or is released.
**
*******************************************************************************/
BOOLEAN l2cu_is_ccb_active (tL2C_CCB *p_ccb)
{
    return (p_ccb && p_ccb->in_use);
}