OSDN Git Service

Remove L2CA_ErtmConnectRsp
authorHansong Zhang <hsz@google.com>
Fri, 25 Sep 2020 22:32:40 +0000 (15:32 -0700)
committerHansong Zhang <hsz@google.com>
Sat, 26 Sep 2020 01:06:40 +0000 (18:06 -0700)
Just use L2CA_ConnectRsp.

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

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

index da6f015..34dd015 100644 (file)
@@ -103,19 +103,10 @@ uint16_t bluetooth::shim::L2CA_ConnectReq(uint16_t psm,
   return shim_l2cap.CreateConnection(psm, raw_address);
 }
 
-bool bluetooth::shim::L2CA_ErtmConnectRsp(const RawAddress& p_bd_addr,
-                                          uint8_t id, uint16_t lcid,
-                                          uint16_t result, uint16_t status,
-                                          tL2CAP_ERTM_INFO* p_ertm_info) {
-  return shim_l2cap.ConnectResponse(p_bd_addr, id, lcid, result, status,
-                                    p_ertm_info);
-}
-
 bool bluetooth::shim::L2CA_ConnectRsp(const RawAddress& p_bd_addr, uint8_t id,
                                       uint16_t lcid, uint16_t result,
                                       uint16_t status) {
-  return bluetooth::shim::L2CA_ErtmConnectRsp(p_bd_addr, id, lcid, result,
-                                              status, nullptr);
+  return shim_l2cap.ConnectResponse(p_bd_addr, id, lcid, result, status);
 }
 
 bool bluetooth::shim::L2CA_ConfigReq(uint16_t cid, tL2CAP_CFG_INFO* cfg_info) {
index 2c2da08..5fae24f 100644 (file)
@@ -189,22 +189,6 @@ bool L2CA_GetPeerLECocConfig(uint16_t lcid, tL2CAP_LE_CFG_INFO* peer_cfg);
 
 /*******************************************************************************
  *
- * Function         L2CA_ErtmConnectRsp
- *
- * Description      Higher layers call this function to accept an incoming
- *                  L2CAP connection, for which they had gotten an connect
- *                  indication callback, and for which the higher layer wants
- *                  to use Enhanced Retransmission Mode.
- *
- * Returns          true for success, false for failure
- *
- ******************************************************************************/
-bool L2CA_ErtmConnectRsp(const RawAddress& p_bd_addr, uint8_t id, uint16_t lcid,
-                         uint16_t result, uint16_t status,
-                         tL2CAP_ERTM_INFO* p_ertm_info);
-
-/*******************************************************************************
- *
  * Function         L2CA_ConfigReq
  *
  * Description      Higher layers call this function to send configuration.
index f8a9dbe..09ba5bc 100644 (file)
@@ -349,7 +349,7 @@ void bluetooth::shim::legacy::L2cap::SetDownstreamCallbacks(uint16_t cid) {
 
 bool bluetooth::shim::legacy::L2cap::ConnectResponse(
     const RawAddress& raw_address, uint8_t signal_id, uint16_t cid,
-    uint16_t result, uint16_t status, tL2CAP_ERTM_INFO* ertm_info) {
+    uint16_t result, uint16_t status) {
   CHECK(ConnectionExists(cid));
   LOG_DEBUG(
       "%s Silently dropping client connect response as channel is "
index 74b46ba..c710a97 100644 (file)
@@ -84,8 +84,7 @@ class L2cap {
 
   // Legacy API entry points
   bool ConnectResponse(const RawAddress& raw_address, uint8_t signal_id,
-                       uint16_t cid, uint16_t result, uint16_t status,
-                       tL2CAP_ERTM_INFO* ertm_info);
+                       uint16_t cid, uint16_t result, uint16_t status);
   bool ConfigRequest(uint16_t cid, const tL2CAP_CFG_INFO* config_info);
   bool ConfigResponse(uint16_t cid, const tL2CAP_CFG_INFO* config_info);
   bool DisconnectRequest(uint16_t cid);
index cfc64e1..bc04d38 100644 (file)
@@ -90,7 +90,7 @@ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid,
   ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE;
 
   /* Send L2CAP connect rsp */
-  L2CA_ErtmConnectRsp(bd_addr, id, lcid, result, 0, &ertm_info);
+  L2CA_ConnectRsp(bd_addr, id, lcid, result, 0);
 
   /* if result ok, proceed with connection */
   if (result == L2CAP_CONN_OK) {
index 961d827..4948629 100644 (file)
@@ -615,8 +615,7 @@ static void gap_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid,
 
   /* Send response to the L2CAP layer. */
   if (p_ccb->transport == BT_TRANSPORT_BR_EDR)
-    L2CA_ErtmConnectRsp(bd_addr, l2cap_id, l2cap_cid, L2CAP_CONN_OK,
-                        L2CAP_CONN_OK, &p_ccb->ertm_info);
+    L2CA_ConnectRsp(bd_addr, l2cap_id, l2cap_cid, L2CAP_CONN_OK, L2CAP_CONN_OK);
 
   if (p_ccb->transport == BT_TRANSPORT_LE) {
     L2CA_ConnectLECocRsp(bd_addr, l2cap_id, l2cap_cid, L2CAP_CONN_OK,
index c204683..2757fee 100644 (file)
@@ -448,22 +448,6 @@ extern bool L2CA_GetPeerLECocConfig(uint16_t lcid,
 
 /*******************************************************************************
  *
- * Function         L2CA_ErtmConnectRsp
- *
- * Description      Higher layers call this function to accept an incoming
- *                  L2CAP connection, for which they had gotten an connect
- *                  indication callback, and for which the higher layer wants
- *                  to use Enhanced Retransmission Mode.
- *
- * Returns          true for success, false for failure
- *
- ******************************************************************************/
-extern bool L2CA_ErtmConnectRsp(const RawAddress& p_bd_addr, uint8_t id,
-                                uint16_t lcid, uint16_t result, uint16_t status,
-                                tL2CAP_ERTM_INFO* p_ertm_info);
-
-/*******************************************************************************
- *
  * Function         L2CA_DisconnectReq
  *
  * Description      Higher layers call this function to disconnect a channel.
index fc85363..339355a 100644 (file)
@@ -715,28 +715,6 @@ bool L2CA_ConnectRsp(const RawAddress& p_bd_addr, uint8_t id, uint16_t lcid,
                                             status);
   }
 
-  return L2CA_ErtmConnectRsp(p_bd_addr, id, lcid, result, status, NULL);
-}
-
-/*******************************************************************************
- *
- * Function         L2CA_ErtmConnectRsp
- *
- * Description      Higher layers call this function to accept an incoming
- *                  L2CAP connection, for which they had gotten an connect
- *                  indication callback.
- *
- * Returns          true for success, false for failure
- *
- ******************************************************************************/
-bool L2CA_ErtmConnectRsp(const RawAddress& p_bd_addr, uint8_t id, uint16_t lcid,
-                         uint16_t result, uint16_t status,
-                         tL2CAP_ERTM_INFO* p_ertm_info) {
-  if (bluetooth::shim::is_gd_shim_enabled()) {
-    return bluetooth::shim::L2CA_ErtmConnectRsp(p_bd_addr, id, lcid, result,
-                                                status, p_ertm_info);
-  }
-
   tL2C_LCB* p_lcb;
   tL2C_CCB* p_ccb;