OSDN Git Service

Simplify some L2cap code
authorHansong Zhang <hsz@google.com>
Sat, 16 Jan 2021 00:31:19 +0000 (16:31 -0800)
committerHansong Zhang <hsz@google.com>
Tue, 19 Jan 2021 19:05:30 +0000 (11:05 -0800)
Test: cert/run
Tag: #gd-refactor
Bug: 141555841
Change-Id: I0e9f3164892f91231391e58f3b7a97bca9a47b7e

stack/l2cap/l2c_api.cc
stack/l2cap/l2c_int.h
stack/l2cap/l2c_utils.cc

index 823e62f..5158ff5 100644 (file)
@@ -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);
index feb6fe5..f86e160 100644 (file)
@@ -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);
 
index bef8a65..3c64713 100644 (file)
@@ -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));
 }