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

Commit 45ac3f75 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Simplify some L2cap code

Test: cert/run
Tag: #gd-refactor
Bug: 141555841
Change-Id: I0e9f3164892f91231391e58f3b7a97bca9a47b7e
parent 2777b9a7
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1144,8 +1144,6 @@ bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda) {
  if (bluetooth::shim::is_gd_l2cap_enabled()) {
    return bluetooth::shim::L2CA_ConnectFixedChnl(fixed_cid, rem_bda);
  }
  uint8_t initiating_phys =
      controller_get_interface()->get_le_all_initiating_phys();

  tL2C_LCB* p_lcb;
  tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;
@@ -1230,7 +1228,7 @@ bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda) {
  }

  if (transport == BT_TRANSPORT_LE) {
    bool ret = l2cu_create_conn_le(p_lcb, initiating_phys);
    bool ret = l2cu_create_conn_le(p_lcb);
    if (!ret) {
      LOG_WARN("Unable to create fixed channel le connection fixed_cid:0x%04x",
               fixed_cid);
+0 −1
Original line number Diff line number Diff line
@@ -721,7 +721,6 @@ extern bool l2cu_lcb_disconnecting(void);

extern void l2cu_create_conn_br_edr(tL2C_LCB* p_lcb);
extern bool l2cu_create_conn_le(tL2C_LCB* p_lcb);
extern bool l2cu_create_conn_le(tL2C_LCB* p_lcb, uint8_t initiating_phys);
extern void l2cu_create_conn_after_switch(tL2C_LCB* p_lcb);
extern void l2cu_adjust_out_mps(tL2C_CCB* p_ccb);

+1 −8
Original line number Diff line number Diff line
@@ -2038,18 +2038,11 @@ void l2cu_device_reset(void) {
  }
}

bool l2cu_create_conn_le(tL2C_LCB* p_lcb) {
  uint8_t phy = controller_get_interface()->get_le_all_initiating_phys();
  return l2cu_create_conn_le(p_lcb, phy);
}

/* This function initiates an acl connection to a LE device.
 * Returns true if request started successfully, false otherwise. */
bool l2cu_create_conn_le(tL2C_LCB* p_lcb, uint8_t initiating_phys) {
bool l2cu_create_conn_le(tL2C_LCB* p_lcb) {
  if (!controller_get_interface()->supports_ble()) return false;

  p_lcb->transport = BT_TRANSPORT_LE;

  return (l2cble_create_conn(p_lcb));
}