OSDN Git Service

Remove L2CA_ErtmConnectReq
authorHansong Zhang <hsz@google.com>
Fri, 25 Sep 2020 22:27:51 +0000 (15:27 -0700)
committerHansong Zhang <hsz@google.com>
Sat, 26 Sep 2020 01:06:40 +0000 (18:06 -0700)
Now that the p_ertm_info parameter is unused, just use L2CA_ConnectReq.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I458e0d8bcc2809c8bc2d295be29516be05bf05ba

main/shim/l2c_api.cc
main/shim/l2c_api.h
stack/avct/avct_bcb_act.cc
stack/gap/gap_conn.cc
stack/include/l2c_api.h
stack/l2cap/l2c_api.cc

index c9dcadd..da6f015 100644 (file)
@@ -98,12 +98,6 @@ void bluetooth::shim::L2CA_FreeLePSM(uint16_t psm) {
 /**
  * Classic Connection Oriented Channel APIS
  */
-uint16_t bluetooth::shim::L2CA_ErtmConnectReq(uint16_t psm,
-                                              const RawAddress& raw_address,
-                                              tL2CAP_ERTM_INFO* p_ertm_info) {
-  return shim_l2cap.CreateConnection(psm, raw_address);
-}
-
 uint16_t bluetooth::shim::L2CA_ConnectReq(uint16_t psm,
                                           const RawAddress& raw_address) {
   return shim_l2cap.CreateConnection(psm, raw_address);
index a926c41..2c2da08 100644 (file)
@@ -120,22 +120,6 @@ bool L2CA_ConnectRsp(const RawAddress& p_bd_addr, uint8_t id, uint16_t lcid,
 
 /*******************************************************************************
  *
- * Function         L2CA_ErtmConnectReq
- *
- * Description      Higher layers call this function to create an L2CAP
- *                  connection that needs to use Enhanced Retransmission Mode.
- *                  Note that the connection is not established at this time,
- *                  but connection establishment gets started. The callback
- *                  will be invoked when connection establishes or fails.
- *
- * Returns          the CID of the connection, or 0 if it failed to start
- *
- ******************************************************************************/
-uint16_t L2CA_ErtmConnectReq(uint16_t psm, const RawAddress& p_bd_addr,
-                             tL2CAP_ERTM_INFO* p_ertm_info);
-
-/*******************************************************************************
- *
  * Function         L2CA_RegisterLECoc
  *
  * Description      Other layers call this function to register for L2CAP
index 7f27b79..b227072 100644 (file)
@@ -110,8 +110,8 @@ void avct_bcb_chnl_open(tAVCT_BCB* p_bcb, UNUSED_ATTR tAVCT_LCB_EVT* p_data) {
 
   /* call l2cap connect req */
   p_bcb->ch_state = AVCT_CH_CONN;
-  p_bcb->ch_lcid = L2CA_ErtmConnectReq2(AVCT_BR_PSM, p_lcb->peer_addr,
-                                        &ertm_info, BTA_SEC_AUTHENTICATE);
+  p_bcb->ch_lcid =
+      L2CA_ConnectReq2(AVCT_BR_PSM, p_lcb->peer_addr, BTA_SEC_AUTHENTICATE);
   if (p_bcb->ch_lcid == 0) {
     /* if connect req failed, send ourselves close event */
     tAVCT_LCB_EVT avct_lcb_evt;
index fab07dc..961d827 100644 (file)
@@ -274,8 +274,7 @@ uint16_t GAP_ConnOpen(const char* p_serv_name, uint8_t service_id,
 
     /* Check if L2CAP started the connection process */
     if (p_rem_bda && (transport == BT_TRANSPORT_BR_EDR)) {
-      cid = L2CA_ErtmConnectReq2(p_ccb->psm, *p_rem_bda, &p_ccb->ertm_info,
-                                 security);
+      cid = L2CA_ConnectReq2(p_ccb->psm, *p_rem_bda, security);
       if (cid != 0) {
         p_ccb->connection_id = cid;
         return (p_ccb->gap_handle);
index d87c040..c204683 100644 (file)
@@ -373,26 +373,6 @@ extern uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr);
 extern bool L2CA_ConnectRsp(const RawAddress& p_bd_addr, uint8_t id,
                             uint16_t lcid, uint16_t result, uint16_t status);
 
-uint16_t L2CA_ErtmConnectReq2(uint16_t psm, const RawAddress& p_bd_addr,
-                              tL2CAP_ERTM_INFO* p_ertm_info,
-                              uint16_t sec_level);
-
-/*******************************************************************************
- *
- * Function         L2CA_ErtmConnectReq
- *
- * Description      Higher layers call this function to create an L2CAP
- *                  connection that needs to use Enhanced Retransmission Mode.
- *                  Note that the connection is not established at this time,
- *                  but connection establishment gets started. The callback
- *                  will be invoked when connection establishes or fails.
- *
- * Returns          the CID of the connection, or 0 if it failed to start
- *
- ******************************************************************************/
-extern uint16_t L2CA_ErtmConnectReq(uint16_t psm, const RawAddress& p_bd_addr,
-                                    tL2CAP_ERTM_INFO* p_ertm_info);
-
 /*******************************************************************************
  *
  * Function         L2CA_RegisterLECoc
index 15980a9..fc85363 100644 (file)
@@ -310,10 +310,10 @@ uint16_t L2CA_ConnectReq2(uint16_t psm, const RawAddress& p_bd_addr,
  * Function         L2CA_ConnectReq
  *
  * Description      Higher layers call this function to create an L2CAP
- *                  connection. Note that the connection is not established at
- *                  this time, but connection establishment gets started. The
- *                  callback function will be invoked when connection
- *                  establishes or fails.
+ *                  connection.
+ *                  Note that the connection is not established at this time,
+ *                  but connection establishment gets started. The callback
+ *                  will be invoked when connection establishes or fails.
  *
  * Returns          the CID of the connection, or 0 if it failed to start
  *
@@ -323,42 +323,8 @@ uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr) {
     return bluetooth::shim::L2CA_ConnectReq(psm, p_bd_addr);
   }
 
-  return L2CA_ErtmConnectReq(psm, p_bd_addr, nullptr);
-}
-
-uint16_t L2CA_ErtmConnectReq2(uint16_t psm, const RawAddress& p_bd_addr,
-                              tL2CAP_ERTM_INFO* p_ertm_info,
-                              uint16_t sec_level) {
-  BTM_SetSecurityLevel(true, "", 0, sec_level, psm, 0, 0);
-  return L2CA_ErtmConnectReq(psm, p_bd_addr, p_ertm_info);
-}
-
-/*******************************************************************************
- *
- * Function         L2CA_ErtmConnectReq
- *
- * Description      Higher layers call this function to create an L2CAP
- *                  connection. Note that the connection is not established at
- *                  this time, but connection establishment gets started. The
- *                  callback function will be invoked when connection
- *                  establishes or fails.
- *
- *  Parameters:       PSM: L2CAP PSM for the connection
- *                    BD address of the peer
- *                   Enhaced retransmission mode configurations
-
- * Returns          the CID of the connection, or 0 if it failed to start
- *
- ******************************************************************************/
-uint16_t L2CA_ErtmConnectReq(uint16_t psm, const RawAddress& p_bd_addr,
-                             tL2CAP_ERTM_INFO* p_ertm_info) {
-  if (bluetooth::shim::is_gd_shim_enabled()) {
-    return bluetooth::shim::L2CA_ErtmConnectReq(psm, p_bd_addr, p_ertm_info);
-  }
-
   VLOG(1) << __func__ << "BDA " << p_bd_addr
-          << StringPrintf(" PSM: 0x%04x preferred:%d", psm,
-                          (p_ertm_info) ? p_ertm_info->preferred_mode : 0);
+          << StringPrintf(" PSM: 0x%04x", psm);
 
   /* Fail if we have not established communications with the controller */
   if (!BTM_IsDeviceUp()) {