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

Commit 8a0fcaf6 authored by Chris Manton's avatar Chris Manton
Browse files

Remove def L2CAP_NUM_FIXED_CHNLS Optimization

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Idbfc3b0dd32cdb6161b38f8436e4b5d3a89b6d0a
parent 9bfc706f
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -747,7 +747,6 @@ typedef struct {
      pL2CA_FixedTxComplete_Cb; /* fixed channel tx complete callback */
} tL2CAP_FIXED_CHNL_REG;

#if (L2CAP_NUM_FIXED_CHNLS > 0)
/*******************************************************************************
 *
 *  Function        L2CA_RegisterFixedChannel
@@ -833,8 +832,6 @@ extern bool L2CA_RemoveFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda);
extern bool L2CA_SetFixedChannelTout(const RawAddress& rem_bda,
                                     uint16_t fixed_cid, uint16_t idle_tout);

#endif /* (L2CAP_NUM_FIXED_CHNLS > 0) */

/*******************************************************************************
 *
 *  Function        L2CA_CancelBleConnectReq
+0 −3
Original line number Diff line number Diff line
@@ -1316,7 +1316,6 @@ bool L2CA_GetPeerFeatures(const RawAddress& bd_addr, uint32_t* p_ext_feat,
  return true;
}

#if (L2CAP_NUM_FIXED_CHNLS > 0)
/*******************************************************************************
 *
 *  Function        L2CA_RegisterFixedChannel
@@ -1700,8 +1699,6 @@ bool L2CA_SetFixedChannelTout(const RawAddress& rem_bda, uint16_t fixed_cid,
  return true;
}

#endif /* #if (L2CAP_NUM_FIXED_CHNLS > 0) */

/*******************************************************************************
 *
 * Function         L2CA_DataWrite
+0 −2
Original line number Diff line number Diff line
@@ -918,7 +918,6 @@ static void l2c_csm_config(tL2C_CCB* p_ccb, uint16_t event, void* p_data) {
    case L2CEVT_L2CAP_DATA: /* Peer data packet rcvd    */
      L2CAP_TRACE_API("L2CAP - Calling DataInd_Cb(), CID: 0x%04x",
                      p_ccb->local_cid);
#if (L2CAP_NUM_FIXED_CHNLS > 0)
      if (p_ccb->local_cid >= L2CAP_FIRST_FIXED_CHNL &&
          p_ccb->local_cid <= L2CAP_LAST_FIXED_CHNL) {
        if (p_ccb->local_cid < L2CAP_BASE_APPL_CID) {
@@ -933,7 +932,6 @@ static void l2c_csm_config(tL2C_CCB* p_ccb, uint16_t event, void* p_data) {
          break;
        }
      }
#endif
      (*p_ccb->p_rcb->api.pL2CA_DataInd_Cb)(p_ccb->local_cid, (BT_HDR*)p_data);
      break;

+0 −2
Original line number Diff line number Diff line
@@ -1357,7 +1357,6 @@ static bool do_sar_reassembly(tL2C_CCB* p_ccb, BT_HDR* p_buf,
  if (!packet_ok) {
    osi_free(p_buf);
  } else if (p_buf != NULL) {
#if (L2CAP_NUM_FIXED_CHNLS > 0)
    if (p_ccb->local_cid < L2CAP_BASE_APPL_CID &&
        (p_ccb->local_cid >= L2CAP_FIRST_FIXED_CHNL &&
         p_ccb->local_cid <= L2CAP_LAST_FIXED_CHNL)) {
@@ -1367,7 +1366,6 @@ static bool do_sar_reassembly(tL2C_CCB* p_ccb, BT_HDR* p_buf,
              .pL2CA_FixedData_Cb)(p_ccb->local_cid,
                                   p_ccb->p_lcb->remote_bd_addr, p_buf);
    } else
#endif
      l2c_csm_execute(p_ccb, L2CEVT_L2CAP_DATA, p_buf);
  }

+0 −6
Original line number Diff line number Diff line
@@ -289,9 +289,7 @@ typedef struct t_l2c_ccb {

  bool is_flushable; /* true if channel is flushable */

#if (L2CAP_NUM_FIXED_CHNLS > 0)
  uint16_t fixed_chnl_idle_tout; /* Idle timeout to use for the fixed channel */
#endif
  uint16_t tx_data_len;

  /* Number of LE frames that the remote can send to us (credit count in
@@ -373,10 +371,8 @@ typedef struct t_l2c_linkcb {
  uint8_t acl_priority;     /* L2C_PRIORITY_NORMAL or L2C_PRIORITY_HIGH */
  tL2CA_NOCP_CB* p_nocp_cb; /* Num Cmpl pkts callback */

#if (L2CAP_NUM_FIXED_CHNLS > 0)
  tL2C_CCB* p_fixed_ccbs[L2CAP_NUM_FIXED_CHNLS];
  uint16_t disc_reason;
#endif

  tBT_TRANSPORT transport;
  uint8_t initiating_phys;  // LE PHY used for connection initiation
@@ -449,10 +445,8 @@ typedef struct {
  uint32_t test_info_resp; /* Conformance testing needs a dynamic response */
#endif

#if (L2CAP_NUM_FIXED_CHNLS > 0)
  tL2CAP_FIXED_CHNL_REG
      fixed_reg[L2CAP_NUM_FIXED_CHNLS]; /* Reg info for fixed channels */
#endif

  uint16_t num_ble_links_active; /* Number of LE links active */
  uint16_t controller_le_xmit_window; /* Total ACL window for all links */
Loading