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

Commit bef7a499 authored by Pomai Ahlo's avatar Pomai Ahlo
Browse files

RFCOMM: move from bt_target to rfcdefs.h

Move all RFCOMM related defines from bt_target.h to rfcdefs.h

Bug: 355732703
Test: m com.android.btservices
Flag: EXEMPT mechanical refactor
Change-Id: Ie9031b491cd4d541ff5b7acb6ff3ee682584b20d
parent 9524d040
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "internal_include/bt_target.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/l2c_api.h"
#include "stack/include/rfcdefs.h"
#include "types/bluetooth/uuid.h"
#include "types/raw_address.h"

+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
#include "stack/include/gap_api.h"
#include "stack/include/l2cdefs.h"
#include "stack/include/port_api.h"
#include "stack/include/rfcdefs.h"
#include "stack/include/sdp_api.h"
#include "types/bluetooth/uuid.h"
#include "types/raw_address.h"
+1 −90
Original line number Diff line number Diff line
@@ -17,8 +17,7 @@
 *
 ******************************************************************************/

#ifndef BT_TARGET_H
#define BT_TARGET_H
#pragma once

#ifndef FALSE
#define FALSE false
@@ -39,10 +38,6 @@
#define BTUI_OPS_FORMATS (BTA_OP_VCARD21_MASK | BTA_OP_ANY_MASK)
#endif

#ifndef BTA_RFC_MTU_SIZE
#define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE - L2CAP_MIN_OFFSET - RFCOMM_DATA_OVERHEAD)
#endif

#ifndef BTA_PAN_INCLUDED
#define BTA_PAN_INCLUDED TRUE
#endif
@@ -117,16 +112,6 @@
#define SDP_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif

/* Sends RFCOMM command packets. */
#ifndef RFCOMM_CMD_BUF_SIZE
#define RFCOMM_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
#endif

/* Sends RFCOMM data packets. */
#ifndef RFCOMM_DATA_BUF_SIZE
#define RFCOMM_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif

/* Sends L2CAP packets to the peer and HCI messages to the controller. */
#ifndef L2CAP_CMD_BUF_SIZE
#define L2CAP_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
@@ -487,72 +472,6 @@
#define SDP_MTU_SIZE 1024
#endif

/******************************************************************************
 *
 * RFCOMM
 *
 *****************************************************************************/

/* The maximum number of ports supported. */
#ifndef MAX_RFC_PORTS
#define MAX_RFC_PORTS 30
#endif

/* The maximum simultaneous links to different devices. */
#ifndef MAX_BD_CONNECTIONS
#define MAX_BD_CONNECTIONS 16
#endif

/* The port receive queue low watermark level, in bytes. */
#ifndef PORT_RX_LOW_WM
#define PORT_RX_LOW_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
#endif

/* The port receive queue high watermark level, in bytes. */
#ifndef PORT_RX_HIGH_WM
#define PORT_RX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
#endif

/* The port receive queue critical watermark level, in bytes. */
#ifndef PORT_RX_CRITICAL_WM
#define PORT_RX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
#endif

/* The port receive queue low watermark level, in number of buffers. */
#ifndef PORT_RX_BUF_LOW_WM
#define PORT_RX_BUF_LOW_WM 4
#endif

/* The port receive queue high watermark level, in number of buffers. */
#ifndef PORT_RX_BUF_HIGH_WM
#define PORT_RX_BUF_HIGH_WM 10
#endif

/* The port receive queue critical watermark level, in number of buffers. */
#ifndef PORT_RX_BUF_CRITICAL_WM
#define PORT_RX_BUF_CRITICAL_WM 15
#endif

/* The port transmit queue high watermark level, in bytes. */
#ifndef PORT_TX_HIGH_WM
#define PORT_TX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
#endif

/* The port transmit queue critical watermark level, in bytes. */
#ifndef PORT_TX_CRITICAL_WM
#define PORT_TX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
#endif

/* The port transmit queue high watermark level, in number of buffers. */
#ifndef PORT_TX_BUF_HIGH_WM
#define PORT_TX_BUF_HIGH_WM 10
#endif

/* The port transmit queue high watermark level, in number of buffers. */
#ifndef PORT_TX_BUF_CRITICAL_WM
#define PORT_TX_BUF_CRITICAL_WM 15
#endif

/******************************************************************************
 *
 * BNEP
@@ -766,11 +685,3 @@
#ifndef BTA_EIR_SERVER_NUM_CUSTOM_UUID
#define BTA_EIR_SERVER_NUM_CUSTOM_UUID 8
#endif

/******************************************************************************
 *
 * Tracing:  Include trace header file here.
 *
 *****************************************************************************/

#endif /* BT_TARGET_H */
+54 −3
Original line number Diff line number Diff line
@@ -22,18 +22,34 @@
 *
 ****************************************************************************/

#ifndef RFCDEFS_H
#define RFCDEFS_H
#pragma once

/*
 *  Server Channel Numbers (SCN) range between 1 and 30, inclusive
 */
#define RFCOMM_MAX_SCN 30

/*
 * The maximum number of ports supported.
 */
#define MAX_RFC_PORTS 30

/*
 * The maximum simultaneous links to different devices.
 */
#define MAX_BD_CONNECTIONS 16

/*
 *  If nothing is negotiated MTU should be 127
 */
#define RFCOMM_DEFAULT_MTU 127

/*
 * RFCOMM buffer sizes
 */
#define RFCOMM_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE     // command packet buffer size
#define RFCOMM_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE  // data packet buffer size

/*
 * Define used by RFCOMM TS frame types
 */
@@ -235,4 +251,39 @@

#define RFCOMM_MX_RLS 0x50
#define RFCOMM_MX_RLS_LEN 2
#endif

/*
 * Define RFCOMM port rx and tx queue watermarks
 */
// MTU size used to calculate watermark levels
#define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE - L2CAP_MIN_OFFSET - RFCOMM_DATA_OVERHEAD)

// The port receive queue low watermark level, in number of buffers.
#define PORT_RX_BUF_LOW_WM 4

// The port receive queue high watermark level, in number of buffers.
#define PORT_RX_BUF_HIGH_WM 10

// The port receive queue critical watermark level, in number of buffers.
#define PORT_RX_BUF_CRITICAL_WM 15

// The port receive queue low watermark level, in bytes.
#define PORT_RX_LOW_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)

// The port receive queue high watermark level, in bytes.
#define PORT_RX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)

// The port receive queue critical watermark level, in bytes.
#define PORT_RX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)

// The port transmit queue high watermark level, in number of buffers.
#define PORT_TX_BUF_HIGH_WM 10

// The port transmit queue high watermark level, in number of buffers.
#define PORT_TX_BUF_CRITICAL_WM 15

// The port transmit queue high watermark level, in bytes.
#define PORT_TX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)

// The port transmit queue critical watermark level, in bytes.
#define PORT_TX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@

#include <cstdint>

#include "internal_include/bt_target.h"
#include "internal_include/bt_trace.h"
#include "os/logging/log_adapter.h"
#include "osi/include/allocator.h"
@@ -40,6 +39,7 @@
#include "stack/include/bt_types.h"
#include "stack/include/bt_uuid16.h"
#include "stack/include/btm_log_history.h"
#include "stack/include/rfcdefs.h"
#include "stack/rfcomm/rfc_int.h"
#include "types/raw_address.h"

Loading