OSDN Git Service

L2CAP: Remove unused ConnectRsp
authorHansong Zhang <hsz@google.com>
Mon, 28 Sep 2020 20:00:18 +0000 (13:00 -0700)
committerHansong Zhang <hsz@google.com>
Mon, 28 Sep 2020 20:00:18 +0000 (13:00 -0700)
Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ifa6fc5470aeda670eb51482ed91a2b7ab665a813

main/shim/l2c_api.cc
main/shim/l2c_api.h
main/shim/l2cap.cc
main/shim/l2cap.h
stack/include/l2c_api.h
stack/l2cap/l2c_api.cc

index 7cbc751..1719960 100644 (file)
@@ -103,12 +103,6 @@ uint16_t bluetooth::shim::L2CA_ConnectReq(uint16_t psm,
   return shim_l2cap.CreateConnection(psm, raw_address);
 }
 
-bool bluetooth::shim::L2CA_ConnectRsp(const RawAddress& p_bd_addr, uint8_t id,
-                                      uint16_t lcid, uint16_t result,
-                                      uint16_t status) {
-  return shim_l2cap.ConnectResponse(p_bd_addr, id, lcid, result, status);
-}
-
 bool bluetooth::shim::L2CA_DisconnectReq(uint16_t cid) {
   return shim_l2cap.DisconnectRequest(cid);
 }
index 2432166..d261191 100644 (file)
@@ -106,20 +106,6 @@ uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr);
 
 /*******************************************************************************
  *
- * Function         L2CA_ConnectRsp
- *
- * 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_ConnectRsp(const RawAddress& p_bd_addr, uint8_t id, uint16_t lcid,
-                     uint16_t result, uint16_t status);
-
-/*******************************************************************************
- *
  * Function         L2CA_RegisterLECoc
  *
  * Description      Other layers call this function to register for L2CAP
index e7a1775..8b4eb42 100644 (file)
@@ -357,17 +357,6 @@ 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) {
-  CHECK(ConnectionExists(cid));
-  LOG_DEBUG(
-      "%s Silently dropping client connect response as channel is "
-      "already connected",
-      __func__);
-  return true;
-}
-
 bool bluetooth::shim::legacy::L2cap::DisconnectRequest(uint16_t cid) {
   CHECK(ConnectionExists(cid));
   if (cid_closing_set_.find(cid) != cid_closing_set_.end()) {
index 4821f99..581c35f 100644 (file)
@@ -82,10 +82,6 @@ class L2cap {
   uint16_t ConvertClientToRealPsm(uint16_t psm);
   void RemoveClientPsm(uint16_t client_psm);
 
-  // Legacy API entry points
-  bool ConnectResponse(const RawAddress& raw_address, uint8_t signal_id,
-                       uint16_t cid, uint16_t result, uint16_t status);
-
   bool DisconnectRequest(uint16_t cid);
 
   bool GetRemoteCid(uint16_t cid, uint16_t* remote_cid);
index be0d417..98c0524 100644 (file)
@@ -366,20 +366,6 @@ extern uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr);
 
 /*******************************************************************************
  *
- * Function         L2CA_ConnectRsp
- *
- * 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
- *
- ******************************************************************************/
-extern bool L2CA_ConnectRsp(const RawAddress& p_bd_addr, uint8_t id,
-                            uint16_t lcid, uint16_t result, uint16_t status);
-
-/*******************************************************************************
- *
  * Function         L2CA_RegisterLECoc
  *
  * Description      Other layers call this function to register for L2CAP
index 762d49b..0087a8c 100644 (file)
@@ -703,70 +703,6 @@ bool L2CA_GetPeerLECocConfig(uint16_t lcid, tL2CAP_LE_CFG_INFO* peer_cfg) {
 
 /*******************************************************************************
  *
- * Function         L2CA_ConnectRsp
- *
- * 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_ConnectRsp(const RawAddress& p_bd_addr, uint8_t id, uint16_t lcid,
-                     uint16_t result, uint16_t status) {
-  if (bluetooth::shim::is_gd_shim_enabled()) {
-    return bluetooth::shim::L2CA_ConnectRsp(p_bd_addr, id, lcid, result,
-                                            status);
-  }
-
-  tL2C_LCB* p_lcb;
-  tL2C_CCB* p_ccb;
-
-  VLOG(1) << __func__ << " BDA: " << p_bd_addr
-          << StringPrintf(" CID:0x%04x  Result:%d  Status:%d", lcid, result,
-                          status);
-
-  /* First, find the link control block */
-  p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_BR_EDR);
-  if (p_lcb == NULL) {
-    /* No link. Get an LCB and start link establishment */
-    L2CAP_TRACE_WARNING("L2CAP - no LCB for L2CA_conn_rsp");
-    return (false);
-  }
-
-  /* Now, find the channel control block */
-  p_ccb = l2cu_find_ccb_by_cid(p_lcb, lcid);
-  if (p_ccb == NULL) {
-    L2CAP_TRACE_WARNING("L2CAP - no CCB for L2CA_conn_rsp");
-    return (false);
-  }
-
-  /* The IDs must match */
-  if (p_ccb->remote_id != id) {
-    L2CAP_TRACE_WARNING("L2CAP - bad id in L2CA_conn_rsp. Exp: %d  Got: %d",
-                        p_ccb->remote_id, id);
-    return (false);
-  }
-
-  if (result == L2CAP_CONN_OK) {
-    l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_RSP, NULL);
-  } else {
-    tL2C_CONN_INFO conn_info;
-
-    conn_info.l2cap_result = result;
-    conn_info.l2cap_status = status;
-
-    if (result == L2CAP_CONN_PENDING)
-      l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_RSP, &conn_info);
-    else
-      l2c_csm_execute(p_ccb, L2CEVT_L2CA_CONNECT_RSP_NEG, &conn_info);
-  }
-
-  return (true);
-}
-
-/*******************************************************************************
- *
  * Function         L2CA_DisconnectReq
  *
  * Description      Higher layers call this function to disconnect a channel.