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

Commit 7d0da768 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

L2CAP: Allowed mode is equivalent to preferred mode

In all use cases, we want one BASIC or ERTM exculsively, but we never
allow "both are ok" mode.

Remove allowed_mode.  Use preferred_mode to denote the desired mode.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I846eca1912fc9ea04dfa57c5698039d62e634186
parent 000f3ab5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -672,7 +672,6 @@ const tL2CAP_FCR_OPTS obex_l2c_fcr_opts_def = {
};
const tL2CAP_ERTM_INFO obex_l2c_etm_opt = {
    L2CAP_FCR_ERTM_MODE,     /* Mandatory for OBEX over l2cap */
    L2CAP_FCR_CHAN_OPT_ERTM, /* Mandatory for OBEX over l2cap */
    OBX_USER_RX_BUF_SIZE,    OBX_USER_TX_BUF_SIZE,
    OBX_FCR_RX_BUF_SIZE,     OBX_FCR_TX_BUF_SIZE};

+0 −1
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ void AVCT_Register(uint16_t mtu, UNUSED_ATTR uint16_t mtu_br) {
  /* Include the browsing channel which uses eFCR */
  tL2CAP_ERTM_INFO ertm_info;
  ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE;
  ertm_info.allowed_modes = L2CAP_FCR_CHAN_OPT_ERTM;
  ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
  ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
  ertm_info.fcr_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
+0 −1
Original line number Diff line number Diff line
@@ -107,7 +107,6 @@ void avct_bcb_chnl_open(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {

  /* Set the FCR options: Browsing channel mandates ERTM */
  ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE;
  ertm_info.allowed_modes = L2CAP_FCR_CHAN_OPT_ERTM;
  ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
  ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
  ertm_info.fcr_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
+0 −1
Original line number Diff line number Diff line
@@ -145,7 +145,6 @@ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid,

  /* Set the FCR options: Browsing channel mandates ERTM */
  ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE;
  ertm_info.allowed_modes = L2CAP_FCR_CHAN_OPT_ERTM;
  ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
  ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE;
  ertm_info.fcr_rx_buf_size = BT_DEFAULT_BUFFER_SIZE;
+0 −6
Original line number Diff line number Diff line
@@ -259,12 +259,6 @@ uint16_t GAP_ConnOpen(const char* p_serv_name, uint8_t service_id,
    }
  }

  /* optional FCR channel modes */
  if (ertm_info != NULL) {
    p_ccb->ertm_info.allowed_modes =
        (chan_mode_mask) ? chan_mode_mask : (uint8_t)L2CAP_FCR_CHAN_OPT_BASIC;
  }

  if (is_server) {
    p_ccb->con_flags |=
        GAP_CCB_FLAGS_SEC_DONE; /* assume btm/l2cap would handle it */
Loading