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

Commit ba4b32c6 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

legacy: Decouple btsnoop from stack/l2cap,rfcomm am: 2bb20a73

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1893045

Change-Id: I72aa5ee055bbb4078c05d8ff9b69681fedb62298
parents 88a8903e 2bb20a73
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@
#include <string.h>

#include "bt_target.h"
#include "hci/include/btsnoop.h"
#include "hcimsgs.h"
#include "l2c_api.h"
#include "l2c_int.h"
@@ -413,14 +412,6 @@ static void process_l2cap_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
        p_ccb->remote_cid = rcid;
        p_ccb->connection_initiator = L2CAP_INITIATOR_REMOTE;

        if (p_rcb->psm == BT_PSM_RFCOMM) {
          btsnoop_get_interface()->add_rfc_l2c_channel(
              p_lcb->Handle(), p_ccb->local_cid, p_ccb->remote_cid);
        } else if (p_rcb->log_packets) {
          btsnoop_get_interface()->allowlist_l2c_channel(
              p_lcb->Handle(), p_ccb->local_cid, p_ccb->remote_cid);
        }

        l2c_csm_execute(p_ccb, L2CEVT_L2CAP_CONNECT_REQ, &con_info);
        break;
      }
@@ -454,15 +445,6 @@ static void process_l2cap_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
        else
          l2c_csm_execute(p_ccb, L2CEVT_L2CAP_CONNECT_RSP_NEG, &con_info);

        tL2C_RCB* p_rcb = p_ccb->p_rcb;
        if (p_rcb->psm == BT_PSM_RFCOMM) {
          btsnoop_get_interface()->add_rfc_l2c_channel(
              p_lcb->Handle(), p_ccb->local_cid, p_ccb->remote_cid);
        } else if (p_rcb->log_packets) {
          btsnoop_get_interface()->allowlist_l2c_channel(
              p_lcb->Handle(), p_ccb->local_cid, p_ccb->remote_cid);
        }

        break;
      }

+0 −4
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@

#include "btm_api.h"
#include "device/include/controller.h"
#include "hci/include/btsnoop.h"
#include "l2c_int.h"
#include "l2cdefs.h"
#include "main/shim/l2c_api.h"
@@ -1539,9 +1538,6 @@ void l2cu_release_ccb(tL2C_CCB* p_ccb) {
  /* If already released, could be race condition */
  if (!p_ccb->in_use) return;

  btsnoop_get_interface()->clear_l2cap_allowlist(
      p_lcb->Handle(), p_ccb->local_cid, p_ccb->remote_cid);

  if (p_rcb && (p_rcb->psm != p_rcb->real_psm)) {
    BTM_SecClrServiceByPsm(p_rcb->psm);
  }
+0 −13
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@
#include <set>

#include "bt_target.h"
#include "hci/include/btsnoop.h"
#include "osi/include/allocator.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"  // UNUSED_ATTR
@@ -236,12 +235,6 @@ void rfc_port_sm_sabme_wait_ua(tPORT* p_port, tRFC_PORT_EVENT event,
      rfc_port_timer_stop(p_port);
      p_port->rfc.state = RFC_STATE_OPENED;

      if (uuid_logging_acceptlist.find(p_port->uuid) !=
          uuid_logging_acceptlist.end()) {
        btsnoop_get_interface()->allowlist_rfc_dlci(p_port->rfc.p_mcb->lcid,
                                                    p_port->dlci);
      }

      PORT_DlcEstablishCnf(p_port->rfc.p_mcb, p_port->dlci,
                           p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_SUCCESS);
      return;
@@ -356,12 +349,6 @@ void rfc_port_sm_term_wait_sec_check(tPORT* p_port, tRFC_PORT_EVENT event,
      } else {
        rfc_send_ua(p_port->rfc.p_mcb, p_port->dlci);
        p_port->rfc.state = RFC_STATE_OPENED;

        if (uuid_logging_acceptlist.find(p_port->uuid) !=
            uuid_logging_acceptlist.end()) {
          btsnoop_get_interface()->allowlist_rfc_dlci(p_port->rfc.p_mcb->lcid,
                                                      p_port->dlci);
        }
      }
      return;
    default: