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

Commit 29fb4969 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

L2cap: Remove FCR option in FixedChannel registration

Flow control and retransmission only applies to dynamic channel.

Test: Use nRF connection app to test GATT
Change-Id: I6cc7a2ffaf707013d2d7afa3f2b37cb0f328eda9
parent 63f8a85a
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1890,15 +1890,6 @@ static struct fc_channel* fcchan_get(uint16_t chan, char create) {
  static tL2CAP_FIXED_CHNL_REG fcr = {
      .pL2CA_FixedConn_Cb = fcchan_conn_chng_cbk,
      .pL2CA_FixedData_Cb = fcchan_data_cbk,
      .fixed_chnl_opts =
          {
              .mode = L2CAP_FCR_BASIC_MODE,
              .tx_win_sz = 1,
              .max_transmit = 0xFF,
              .rtrans_tout = 2000,
              .mon_tout = 12000,
              .mps = 670,
          },
      .default_idle_tout = 0xffff,
  };

+0 −7
Original line number Diff line number Diff line
@@ -109,13 +109,6 @@ void gatt_init(void) {
  gatt_cb.sign_op_queue = fixed_queue_new(SIZE_MAX);
  gatt_cb.srv_chg_clt_q = fixed_queue_new(SIZE_MAX);
  /* First, register fixed L2CAP channel for ATT over BLE */
  fixed_reg.fixed_chnl_opts.mode = L2CAP_FCR_BASIC_MODE;
  fixed_reg.fixed_chnl_opts.max_transmit = 0xFF;
  fixed_reg.fixed_chnl_opts.rtrans_tout = 2000;
  fixed_reg.fixed_chnl_opts.mon_tout = 12000;
  fixed_reg.fixed_chnl_opts.mps = 670;
  fixed_reg.fixed_chnl_opts.tx_win_sz = 1;

  fixed_reg.pL2CA_FixedConn_Cb = gatt_le_connect_cback;
  fixed_reg.pL2CA_FixedData_Cb = gatt_le_data_ind;
  fixed_reg.pL2CA_FixedCong_Cb = gatt_le_cong_cback; /* congestion callback */
+0 −1
Original line number Diff line number Diff line
@@ -772,7 +772,6 @@ typedef struct {
  tL2CA_FIXED_CHNL_CB* pL2CA_FixedConn_Cb;
  tL2CA_FIXED_DATA_CB* pL2CA_FixedData_Cb;
  tL2CA_FIXED_CONGESTION_STATUS_CB* pL2CA_FixedCong_Cb;
  tL2CAP_FCR_OPTS fixed_chnl_opts;

  uint16_t default_idle_tout;
  tL2CA_TX_COMPLETE_CB*
+3 −11
Original line number Diff line number Diff line
@@ -1460,10 +1460,7 @@ bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda,
    }

    // Get a CCB and link the lcb to it
    if (!l2cu_initialize_fixed_ccb(
            p_lcb, fixed_cid,
            &l2cb.fixed_reg[fixed_cid - L2CAP_FIRST_FIXED_CHNL]
                 .fixed_chnl_opts)) {
    if (!l2cu_initialize_fixed_ccb(p_lcb, fixed_cid)) {
      L2CAP_TRACE_WARNING("%s(0x%04x) - LCB but no CCB", __func__, fixed_cid);
      return false;
    }
@@ -1490,9 +1487,7 @@ bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda,
  }

  // Get a CCB and link the lcb to it
  if (!l2cu_initialize_fixed_ccb(
          p_lcb, fixed_cid, &l2cb.fixed_reg[fixed_cid - L2CAP_FIRST_FIXED_CHNL]
                                 .fixed_chnl_opts)) {
  if (!l2cu_initialize_fixed_ccb(p_lcb, fixed_cid)) {
    p_lcb->disc_reason = L2CAP_CONN_NO_RESOURCES;
    L2CAP_TRACE_WARNING("%s(0x%04x) - no CCB", __func__, fixed_cid);
    l2cu_release_lcb(p_lcb);
@@ -1588,10 +1583,7 @@ uint16_t L2CA_SendFixedChnlData(uint16_t fixed_cid, const RawAddress& rem_bda,
  p_buf->layer_specific = L2CAP_FLUSHABLE_CH_BASED;

  if (!p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]) {
    if (!l2cu_initialize_fixed_ccb(
            p_lcb, fixed_cid,
            &l2cb.fixed_reg[fixed_cid - L2CAP_FIRST_FIXED_CHNL]
                 .fixed_chnl_opts)) {
    if (!l2cu_initialize_fixed_ccb(p_lcb, fixed_cid)) {
      L2CAP_TRACE_WARNING("L2CA_SendFixedChnlData() - no CCB for chnl: 0x%4x",
                          fixed_cid);
      osi_free(p_buf);
+1 −4
Original line number Diff line number Diff line
@@ -279,10 +279,7 @@ void l2cble_conn_comp(uint16_t handle, uint8_t role, const RawAddress& bda,
      LOG(ERROR) << __func__ << "failed to allocate LCB";
      return;
    } else {
      if (!l2cu_initialize_fixed_ccb(
              p_lcb, L2CAP_ATT_CID,
              &l2cb.fixed_reg[L2CAP_ATT_CID - L2CAP_FIRST_FIXED_CHNL]
                   .fixed_chnl_opts)) {
      if (!l2cu_initialize_fixed_ccb(p_lcb, L2CAP_ATT_CID)) {
        btm_sec_disconnect(handle, HCI_ERR_NO_CONNECTION);
        LOG(WARNING) << __func__ << "LCB but no CCB";
        return;
Loading