OSDN Git Service

GKI cleanup - Remove GKI pool related defines
authorPavlin Radoslavov <pavlin@google.com>
Wed, 23 Sep 2015 21:49:24 +0000 (14:49 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Wed, 23 Sep 2015 22:43:44 +0000 (15:43 -0700)
 * Removed pool ID related defines
 * Updated / renamed / cleanup buffer size related defines
 * Added new #define BT_DEFAULT_BUFFER_SIZE
 * Removed unused defines

Change-Id: Ib1fbf463d1e6fda2c71631347de0c365a37ba5ce

16 files changed:
bta/ag/bta_ag_ci.c
bta/hl/bta_hl_int.h
bta/hl/bta_hl_utils.c
bta/include/bta_hl_api.h
btif/co/bta_dm_co.c
btif/src/btif_media_task.c
btif/src/btif_pan.c
btif/src/btif_sock_l2cap.c
include/bt_target.h
stack/avdt/avdt_scb_act.c
stack/avrc/avrc_api.c
stack/avrc/avrc_bld_ct.c
stack/avrc/avrc_bld_tg.c
stack/hcic/hcicmds.c
stack/include/l2cdefs.h
stack/rfcomm/port_api.c

index c9f0a10..18ea1dd 100644 (file)
@@ -46,8 +46,8 @@ void bta_ag_ci_rx_write(UINT16 handle, char *p_data, UINT16 len)
     UINT16 len_remaining = len;
     char *p_data_area;
 
-    if (len > (RFCOMM_DATA_POOL_BUF_SIZE - sizeof(tBTA_AG_CI_RX_WRITE) - 1))
-        len = RFCOMM_DATA_POOL_BUF_SIZE - sizeof(tBTA_AG_CI_RX_WRITE) - 1;
+    if (len > (RFCOMM_DATA_BUF_SIZE - sizeof(tBTA_AG_CI_RX_WRITE) - 1))
+        len = RFCOMM_DATA_BUF_SIZE - sizeof(tBTA_AG_CI_RX_WRITE) - 1;
 
     while (len_remaining)
     {
index 70d4a6a..28ed06b 100644 (file)
@@ -50,10 +50,6 @@ typedef UINT16 (tBTA_HL_ALLOCATE_PSM) (void);
 #define BTA_HL_L2C_RTRANS_TOUT          2000
 #define BTA_HL_L2C_MON_TOUT             12000
 #define BTA_HL_L2C_MPS                  1017
-#define BTA_HL_L2C_USER_RX_POOL_ID      L2CAP_DEFAULT_ERM_POOL_ID
-#define BTA_HL_L2C_USER_TX_POOL_ID      L2CAP_DEFAULT_ERM_POOL_ID /* todo this should be based on data type */
-#define BTA_HL_L2C_FCR_RX_POOL_ID       L2CAP_DEFAULT_ERM_POOL_ID
-#define BTA_HL_L2C_FCR_TX_POOL_ID       L2CAP_DEFAULT_ERM_POOL_ID
 
 /* L2CAP FCS setting*/
 #define BTA_HL_MCA_USE_FCS              MCA_FCS_USE
index 9acb8da..3a6dff5 100644 (file)
@@ -91,7 +91,7 @@ BOOLEAN bta_hl_set_ctrl_psm_for_dch(UINT8 app_idx, UINT8 mcl_idx,
 **
 ** Description
 **
-** Returns      UINT8 pool_id
+** Returns      TRUE if found
 **
 *******************************************************************************/
 BOOLEAN bta_hl_find_sdp_idx_using_ctrl_psm(tBTA_HL_SDP *p_sdp,
@@ -143,7 +143,7 @@ BOOLEAN bta_hl_find_sdp_idx_using_ctrl_psm(tBTA_HL_SDP *p_sdp,
 
 UINT16 bta_hl_set_user_tx_buf_size(UINT16 max_tx_size)
 {
-    if (max_tx_size > HCI_ACL_BUF_SIZE)
+    if (max_tx_size > BT_DEFAULT_BUFFER_SIZE)
         return BTA_HL_LRG_DATA_BUF_SIZE;
     return L2CAP_INVALID_ERM_BUF_SIZE;
 }
@@ -160,7 +160,7 @@ UINT16 bta_hl_set_user_tx_buf_size(UINT16 max_tx_size)
 
 UINT16 bta_hl_set_user_rx_buf_size(UINT16 mtu)
 {
-    if (mtu > HCI_ACL_BUF_SIZE)
+    if (mtu > BT_DEFAULT_BUFFER_SIZE)
         return BTA_HL_LRG_DATA_BUF_SIZE;
     return L2CAP_INVALID_ERM_BUF_SIZE;
 }
index 3a154a5..b8e2c9a 100644 (file)
 #define BTA_HL_NUM_TIMERS               7
 
 #define BTA_HL_CCH_RSP_TOUT             2000
-#define BTA_HL_LRG_POOL_ID              GKI_POOL_ID_7
 #define BTA_HL_MAX_TIME                 255
 #define BTA_HL_MIN_TIME                 1
 #define BTA_HL_INVALID_APP_HANDLE       0xFF
index 641b60c..8213bd5 100644 (file)
@@ -267,8 +267,6 @@ void bta_dm_sco_co_open(UINT16 handle, UINT8 pkt_size, UINT16 event)
     if (btui_cb.sco_hci)
     {
         BTIF_TRACE_DEBUG("bta_dm_sco_co_open handle:%d pkt_size:%d", handle, pkt_size);
-        /* use dedicated SCO buffer pool for SCO TX data */
-        cfg.pool_id = HCI_SCO_POOL_ID;
         cfg.p_cback = btui_sco_codec_callback;
         cfg.pkt_size = pkt_size;
         cfg.cb_event = event;
index 8a6a5ce..7861a0a 100644 (file)
@@ -133,8 +133,7 @@ enum {
 
 
 /* buffer pool */
-#define BTIF_MEDIA_AA_POOL_ID GKI_POOL_ID_3
-#define BTIF_MEDIA_AA_BUF_SIZE GKI_BUF3_SIZE
+#define BTIF_MEDIA_AA_BUF_SIZE  BT_DEFAULT_BUFFER_SIZE
 
 /* offset */
 #if (BTA_AV_CO_CP_SCMS_T == TRUE)
index 91680dd..fc05e23 100644 (file)
@@ -667,10 +667,10 @@ static void btu_exec_tap_fd_read(void *p_param) {
     if (fd == INVALID_FD || fd != btpan_cb.tap_fd)
         return;
 
-    // Don't occupy BTU context too long, avoid GKI buffer overruns and
+    // Don't occupy BTU context too long, avoid buffer overruns and
     // give other profiles a chance to run by limiting the amount of memory
-    // PAN can use from the shared pool buffer.
-    for (int i = 0; i < PAN_POOL_MAX && btif_is_enabled() && btpan_cb.flow; i++) {
+    // PAN can use.
+    for (int i = 0; i < PAN_BUF_MAX && btif_is_enabled() && btpan_cb.flow; i++) {
         BT_HDR *buffer = (BT_HDR *)GKI_getbuf(PAN_BUF_SIZE);
         if (!buffer) {
             BTIF_TRACE_WARNING("%s unable to allocate buffer for packet.", __func__);
index db58263..a67f4d0 100644 (file)
@@ -787,10 +787,10 @@ const tL2CAP_ERTM_INFO obex_l2c_etm_opt =
 {
         L2CAP_FCR_ERTM_MODE,            /* Mandatory for OBEX over l2cap */
         L2CAP_FCR_CHAN_OPT_ERTM,        /* Mandatory for OBEX over l2cap */
-        OBX_USER_RX_POOL_ID,
-        OBX_USER_TX_POOL_ID,
-        OBX_FCR_RX_POOL_ID,
-        OBX_FCR_TX_POOL_ID
+        OBX_USER_RX_BUF_SIZE,
+        OBX_USER_TX_BUF_SIZE,
+        OBX_FCR_RX_BUF_SIZE,
+        OBX_FCR_TX_BUF_SIZE
 };
 
 /**
index e865088..0a32109 100644 (file)
 #define BTA_DISABLE_DELAY 200 /* in milliseconds */
 #endif
 
-// If the next wakeup time is less than this threshold, we should acquire
-// a wakelock instead of setting a wake alarm so we're not bouncing in
-// and out of suspend frequently.
-// in millisecond
-// TODO(zachoverflow): reinstate in alarm code
-#ifndef GKI_TIMER_INTERVAL_FOR_WAKELOCK
-#define GKI_TIMER_INTERVAL_FOR_WAKELOCK 3000
-#endif
-
-#ifndef BTA_SYS_TIMER_PERIOD
-#define BTA_SYS_TIMER_PERIOD  100
-#endif
-
 #ifndef SBC_FOR_EMBEDDED_LINUX
 #define SBC_FOR_EMBEDDED_LINUX TRUE
 #endif
 #define BT_USE_TRACES  TRUE
 #endif
 
-#ifndef BT_TRACE_BTIF
-#define BT_TRACE_BTIF  TRUE
-#endif
-
 #ifndef BT_TRACE_VERBOSE
 #define BT_TRACE_VERBOSE  FALSE
 #endif
 
 /******************************************************************************
 **
-** GKI Buffer Pools
+** Buffer sizes
 **
 ******************************************************************************/
 
-/* Receives HCI events from the lower-layer. */
-#ifndef HCI_CMD_POOL_ID
-#define HCI_CMD_POOL_ID             GKI_POOL_ID_2
-#endif
-
-#ifndef HCI_CMD_POOL_BUF_SIZE
-#define HCI_CMD_POOL_BUF_SIZE       GKI_BUF2_SIZE
-#endif
-
-/* Receives ACL data packets from the lower-layer. */
-#ifndef HCI_ACL_POOL_ID
-#define HCI_ACL_POOL_ID             GKI_POOL_ID_3
+#ifndef BT_DEFAULT_BUFFER_SIZE
+#define BT_DEFAULT_BUFFER_SIZE          (4096 + 16)
 #endif
 
-/* Maximum number of buffers available for ACL receive data. */
-#ifndef HCI_ACL_BUF_MAX
-#define HCI_ACL_BUF_MAX             GKI_BUF3_MAX
+#ifndef BT_SMALL_BUFFER_SIZE
+#define BT_SMALL_BUFFER_SIZE            660
 #endif
 
-#ifndef HCI_ACL_BUF_SIZE
-#define HCI_ACL_BUF_SIZE            (4096+16)
-#endif
-
-/* Receives SCO data packets from the lower-layer. */
-#ifndef HCI_SCO_POOL_ID
-#define HCI_SCO_POOL_ID             GKI_POOL_ID_6
+/* Receives HCI events from the lower-layer. */
+#ifndef HCI_CMD_BUF_SIZE
+#define HCI_CMD_BUF_SIZE                BT_SMALL_BUFFER_SIZE
 #endif
 
 /* Sends SDP data packets. */
 #ifndef SDP_DATA_BUF_SIZE
-#define SDP_DATA_BUF_SIZE           (4096+16)
-#endif
-
-#ifndef SDP_POOL_ID
-#define SDP_POOL_ID                 3
+#define SDP_DATA_BUF_SIZE               BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /* Sends RFCOMM command packets. */
 #ifndef RFCOMM_CMD_BUF_SIZE
-#define RFCOMM_CMD_BUF_SIZE         660
-#endif
-
-#ifndef RFCOMM_CMD_POOL_ID
-#define RFCOMM_CMD_POOL_ID          GKI_POOL_ID_2
+#define RFCOMM_CMD_BUF_SIZE             BT_SMALL_BUFFER_SIZE
 #endif
 
 /* Sends RFCOMM data packets. */
 #ifndef RFCOMM_DATA_BUF_SIZE
-#define RFCOMM_DATA_BUF_SIZE        (4096+16)
-#endif
-
-#ifndef RFCOMM_DATA_POOL_ID
-#define RFCOMM_DATA_POOL_ID         GKI_POOL_ID_3
-#endif
-
-#ifndef RFCOMM_DATA_POOL_BUF_SIZE
-#define RFCOMM_DATA_POOL_BUF_SIZE   GKI_BUF3_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          660
-#endif
-
-#ifndef L2CAP_CMD_POOL_ID
-#define L2CAP_CMD_POOL_ID           GKI_POOL_ID_2
+#define L2CAP_CMD_BUF_SIZE              BT_SMALL_BUFFER_SIZE
 #endif
 
 #ifndef L2CAP_USER_TX_BUF_SIZE
-#define L2CAP_USER_TX_BUF_SIZE       (4096+16)
+#define L2CAP_USER_TX_BUF_SIZE          BT_DEFAULT_BUFFER_SIZE
 #endif
 
 #ifndef L2CAP_USER_RX_BUF_SIZE
-#define L2CAP_USER_RX_BUF_SIZE       (4096+16)
+#define L2CAP_USER_RX_BUF_SIZE          BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /* Sends L2CAP segmented packets in ERTM mode */
-#ifndef L2CAP_FCR_TX_POOL_ID
-#define L2CAP_FCR_TX_POOL_ID        HCI_ACL_POOL_ID
-#endif
-
 #ifndef L2CAP_FCR_TX_BUF_SIZE
-#define L2CAP_FCR_TX_BUF_SIZE       (4096+16)
-#endif
-
-#ifndef L2CAP_FCR_RX_BUF_SIZE
-#define L2CAP_FCR_RX_BUF_SIZE       (4096+16)
+#define L2CAP_FCR_TX_BUF_SIZE           BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /* Receives L2CAP segmented packets in ERTM mode */
-#ifndef L2CAP_FCR_RX_POOL_ID
-#define L2CAP_FCR_RX_POOL_ID        HCI_ACL_POOL_ID
+#ifndef L2CAP_FCR_RX_BUF_SIZE
+#define L2CAP_FCR_RX_BUF_SIZE           BT_DEFAULT_BUFFER_SIZE
 #endif
 
 #ifndef L2CAP_FCR_ERTM_BUF_SIZE
 #define L2CAP_FCR_ERTM_BUF_SIZE         (10240 + 24)
 #endif
 
-/* Number of ACL buffers to assign to LE
-   if the HCI buffer pool is shared with BR/EDR */
+/* Number of ACL buffers to assign to LE */
+/*
+ * TODO: Do we need this?
+ * It was used when the HCI buffers were shared with BR/EDR.
+ */
 #ifndef L2C_DEF_NUM_BLE_BUF_SHARED
 #define L2C_DEF_NUM_BLE_BUF_SHARED      1
 #endif
 
 /* Used by BTM when it sends HCI commands to the controller. */
 #ifndef BTM_CMD_BUF_SIZE
-#define BTM_CMD_BUF_SIZE            660
-#endif
-
-#ifndef BTM_CMD_POOL_ID
-#define BTM_CMD_POOL_ID             GKI_POOL_ID_2
-#endif
-
-#ifndef OBX_LRG_DATA_POOL_SIZE
-#define OBX_LRG_DATA_POOL_SIZE      GKI_BUF4_SIZE
+#define BTM_CMD_BUF_SIZE                BT_SMALL_BUFFER_SIZE
 #endif
 
-#ifndef OBX_LRG_DATA_POOL_ID
-#define OBX_LRG_DATA_POOL_ID        GKI_POOL_ID_4
+#ifndef OBX_LRG_DATA_BUF_SIZE
+#define OBX_LRG_DATA_BUF_SIZE           (8080 + 26)
 #endif
 
 /* Used to send data to L2CAP. */
 #ifndef GAP_DATA_BUF_SIZE
-#define GAP_DATA_BUF_SIZE           (4096+16)
-#endif
-
-#ifndef GAP_DATA_POOL_ID
-#define GAP_DATA_POOL_ID            GKI_POOL_ID_3
+#define GAP_DATA_BUF_SIZE               BT_DEFAULT_BUFFER_SIZE
 #endif
 
 #ifndef SPP_DB_SIZE
-#define SPP_DB_SIZE                 GKI_BUF3_SIZE
+#define SPP_DB_SIZE                     BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /* BNEP data and protocol messages. */
 #ifndef BNEP_BUF_SIZE
-#define BNEP_BUF_SIZE               (4096+16)
-#endif
-
-#ifndef BNEP_POOL_ID
-#define BNEP_POOL_ID                GKI_POOL_ID_3
-#endif
-
-/* RPC pool for temporary trace message buffers. */
-#ifndef RPC_SCRATCH_POOL_ID
-#define RPC_SCRATCH_POOL_ID         GKI_POOL_ID_2
+#define BNEP_BUF_SIZE                   BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /* AVDTP buffer size for protocol messages */
 #ifndef AVDT_CMD_BUF_SIZE
-#define AVDT_CMD_BUF_SIZE           660
+#define AVDT_CMD_BUF_SIZE               BT_SMALL_BUFFER_SIZE
 #endif
 
-/* AVDTP pool for protocol messages */
-#ifndef AVDT_CMD_POOL_ID
-#define AVDT_CMD_POOL_ID            GKI_POOL_ID_2
-#endif
-
-/* AVDTP pool size for media packets in case of fragmentation */
-#ifndef AVDT_DATA_POOL_SIZE
-#define AVDT_DATA_POOL_SIZE         GKI_BUF3_SIZE
+/* AVDTP buffer size for media packets in case of fragmentation */
+#ifndef AVDT_DATA_BUF_SIZE
+#define AVDT_DATA_BUF_SIZE              BT_DEFAULT_BUFFER_SIZE
 #endif
 
 #ifndef PAN_BUF_SIZE
-#define PAN_BUF_SIZE                (4096+16)
+#define PAN_BUF_SIZE                    BT_DEFAULT_BUFFER_SIZE
 #endif
 
-#ifndef PAN_POOL_ID
-#define PAN_POOL_ID                 GKI_POOL_ID_3
-/* Maximum amount of the shared buffer to allocate for PAN */
-#define PAN_POOL_MAX                (GKI_BUF3_MAX / 4)
+/* Maximum number of buffers to allocate for PAN */
+#ifndef PAN_BUF_MAX
+#define PAN_BUF_MAX                     100
 #endif
 
 /* AVCTP buffer size for protocol messages */
 #ifndef AVCT_CMD_BUF_SIZE
-#define AVCT_CMD_BUF_SIZE           288
-#endif
-
-/* AVCTP pool for protocol messages */
-#ifndef AVCT_CMD_POOL_ID
-#define AVCT_CMD_POOL_ID            GKI_POOL_ID_1
+#define AVCT_CMD_BUF_SIZE               288
 #endif
 
 /* AVRCP buffer size for protocol messages */
 #ifndef AVRC_CMD_BUF_SIZE
-#define AVRC_CMD_BUF_SIZE           288
-#endif
-
-/* AVRCP pool for protocol messages */
-#ifndef AVRC_CMD_POOL_ID
-#define AVRC_CMD_POOL_ID            GKI_POOL_ID_1
-#endif
-
-/* AVRCP pool size for protocol messages */
-#ifndef AVRC_CMD_POOL_SIZE
-#define AVRC_CMD_POOL_SIZE          GKI_BUF1_SIZE
+#define AVRC_CMD_BUF_SIZE               288
 #endif
 
 /* AVRCP Metadata buffer size for protocol messages */
 #ifndef AVRC_META_CMD_BUF_SIZE
-#define AVRC_META_CMD_BUF_SIZE     660
-#endif
-
-/* AVRCP Metadata pool for protocol messages */
-#ifndef AVRC_META_CMD_POOL_ID
-#define AVRC_META_CMD_POOL_ID       GKI_POOL_ID_2
+#define AVRC_META_CMD_BUF_SIZE          BT_SMALL_BUFFER_SIZE
 #endif
 
-/* AVRCP Metadata pool size for protocol messages */
-#ifndef AVRC_META_CMD_POOL_SIZE
-#define AVRC_META_CMD_POOL_SIZE     GKI_BUF2_SIZE
-#endif
-
-
 /* AVRCP buffer size for browsing channel messages */
-#ifndef AVRC_BROWSE_POOL_SIZE
-#define AVRC_BROWSE_POOL_SIZE     GKI_MAX_BUF_SIZE
+#ifndef AVRC_BROWSE_BUF_SIZE
+#define AVRC_BROWSE_BUF_SIZE            BT_DEFAULT_BUFFER_SIZE
 #endif
 
 #ifndef BTA_HL_USER_TX_BUF_SIZE
-#define BTA_HL_USER_TX_BUF_SIZE         (4096+16)
+#define BTA_HL_USER_TX_BUF_SIZE         BT_DEFAULT_BUFFER_SIZE
 #endif
 
 #ifndef BTA_HL_LRG_DATA_BUF_SIZE
 #define BTA_HL_LRG_DATA_BUF_SIZE        (10240 + 24)
 #endif
 
-#ifndef BTA_HL_LRG_DATA_POOL_ID
-#define BTA_HL_LRG_DATA_POOL_ID        GKI_POOL_ID_7
-#endif
-
 /* GATT Server Database buffer size */
 #ifndef GATT_DB_BUF_SIZE
 #define GATT_DB_BUF_SIZE                128
 #endif
 
-/* GATT Server Database pool ID */
-#ifndef GATT_DB_POOL_ID
-#define GATT_DB_POOL_ID                 GKI_POOL_ID_8
-#endif
-
-/* GATT Data sending buffer size, use default ACL pool for fix channel data */
+/* GATT Data sending buffer size */
 #ifndef GATT_DATA_BUF_SIZE
-#define GATT_DATA_BUF_SIZE              (4096+16)
-#endif
-
-/* GATT Data sending buffer pool ID, use default ACL pool for fix channel data */
-#ifndef GATT_BUF_POOL_ID
-#define GATT_BUF_POOL_ID                HCI_ACL_POOL_ID
+#define GATT_DATA_BUF_SIZE              BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /******************************************************************************
 /* Macro for allocating buffer for HCI commands */
 #ifndef HCI_GET_CMD_BUF
 #if (!defined(HCI_USE_VARIABLE_SIZE_CMD_BUF) || (HCI_USE_VARIABLE_SIZE_CMD_BUF == FALSE))
-/* Allocate fixed-size buffer from HCI_CMD_POOL (default case) */
-#define HCI_GET_CMD_BUF(paramlen)    ((BT_HDR *)GKI_getbuf (HCI_CMD_POOL_BUF_SIZE))
+/* Allocate fixed-size HCI_CMD buffer (default case) */
+#define HCI_GET_CMD_BUF(paramlen)    ((BT_HDR *)GKI_getbuf (HCI_CMD_BUF_SIZE))
 #else
 /* Allocate smallest possible buffer (for platforms with limited RAM) */
 #define HCI_GET_CMD_BUF(paramlen)    ((BT_HDR *)GKI_getbuf ((UINT16)(BT_HDR_SIZE + HCIC_PREAMBLE_SIZE + (paramlen))))
 
 /* Cancel Inquiry on incoming SSP */
 #ifndef BTM_NO_SSP_ON_INQUIRY
-#define BTM_NO_SSP_ON_INQUIRY       FALSE
+#define BTM_NO_SSP_ON_INQUIRY   FALSE
 #endif
 
 /* Includes SCO if TRUE */
 #ifndef BTM_SCO_INCLUDED
-#define BTM_SCO_INCLUDED            TRUE       /* TRUE includes SCO code */
+#define BTM_SCO_INCLUDED        TRUE    /* TRUE includes SCO code */
 #endif
 
 /* Includes SCO if TRUE */
 #ifndef BTM_SCO_HCI_INCLUDED
-#define BTM_SCO_HCI_INCLUDED            FALSE       /* TRUE includes SCO over HCI code */
+#define BTM_SCO_HCI_INCLUDED    FALSE   /* TRUE includes SCO over HCI code */
 #endif
 
 /* Includes WBS if TRUE */
 #ifndef BTM_WBS_INCLUDED
-#define BTM_WBS_INCLUDED            FALSE       /* TRUE includes WBS code */
+#define BTM_WBS_INCLUDED        FALSE   /* TRUE includes WBS code */
 #endif
 
 /*  This is used to work around a controller bug that doesn't like Disconnect
 #define L2CAP_LINK_STARTUP_TOUT     60
 #endif
 
-/* The L2CAP MTU; must be in accord with the HCI ACL pool size. */
+/* The L2CAP MTU; must be in accord with the HCI ACL buffer size. */
 #ifndef L2CAP_MTU_SIZE
 #define L2CAP_MTU_SIZE              1691
 #endif
 
-/* The L2CAP MPS over Bluetooth; must be in accord with the FCR tx pool size and ACL down buffer size. */
+/*
+ * The L2CAP MPS over Bluetooth; must be in accord with the FCR tx buffer size
+ * and ACL down buffer size.
+ */
 #ifndef L2CAP_MPS_OVER_BR_EDR
 #define L2CAP_MPS_OVER_BR_EDR       1010
 #endif
 #define L2CAP_HCI_FLOW_CONTROL_DEBUG        TRUE
 #endif
 
-/* Used for calculating transmit buffers off of */
-#ifndef L2CAP_NUM_XMIT_BUFFS
-#define L2CAP_NUM_XMIT_BUFFS                HCI_ACL_BUF_MAX
-#endif
-
 /* Unicast Connectionless Data */
 #ifndef L2CAP_UCD_INCLUDED
 #define L2CAP_UCD_INCLUDED                  FALSE
 #define L2CAP_ROUND_ROBIN_CHANNEL_SERVICE   TRUE
 #endif
 
-/* Used for calculating transmit buffers off of */
-#ifndef L2CAP_NUM_XMIT_BUFFS
-#define L2CAP_NUM_XMIT_BUFFS                HCI_ACL_BUF_MAX
-#endif
-
 /* used for monitoring eL2CAP data flow */
 #ifndef L2CAP_ERTM_STATS
 #define L2CAP_ERTM_STATS                    FALSE
 ** OBEX
 **
 ******************************************************************************/
-#define OBX_14_INCLUDED             FALSE
 
 /* The maximum number of registered servers. */
 #ifndef OBX_NUM_SERVERS
 #define OBX_NUM_CLIENTS             8
 #endif
 
-/* This option is application when OBX_14_INCLUDED=TRUE
  Pool ID where to reassemble the SDU.
-   This Pool will allow buffers to be used that are larger than
  the L2CAP_MAX_MTU. */
-#ifndef OBX_USER_RX_POOL_ID
-#define OBX_USER_RX_POOL_ID     OBX_LRG_DATA_POOL_ID
+/*
* Buffer size to reassemble the SDU.
+ * It will allow buffers to be used that are larger than the L2CAP_MAX_MTU.
+ */
+#ifndef OBX_USER_RX_BUF_SIZE
+#define OBX_USER_RX_BUF_SIZE    OBX_LRG_DATA_BUF_SIZE
 #endif
 
-/* This option is application when OBX_14_INCLUDED=TRUE
  Pool ID where to hold the SDU.
-   This Pool will allow buffers to be used that are larger than
  the L2CAP_MAX_MTU. */
-#ifndef OBX_USER_TX_POOL_ID
-#define OBX_USER_TX_POOL_ID     OBX_LRG_DATA_POOL_ID
+/*
* Buffer size to hold the SDU.
+ * It will allow buffers to be used that are larger than the L2CAP_MAX_MTU.
+ */
+#ifndef OBX_USER_TX_BUF_SIZE
+#define OBX_USER_TX_BUF_SIZE    OBX_LRG_DATA_BUF_SIZE
 #endif
 
-/* This option is application when OBX_14_INCLUDED=TRUE
-GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
-*/
-#ifndef OBX_FCR_RX_POOL_ID
-#define OBX_FCR_RX_POOL_ID      HCI_ACL_POOL_ID
+/* Buffer size used to hold MPS segments during SDU reassembly. */
+#ifndef OBX_FCR_RX_BUF_SIZE
+#define OBX_FCR_RX_BUF_SIZE     BT_DEFAULT_BUFFER_SIZE
 #endif
 
-/* This option is application when OBX_14_INCLUDED=TRUE
-GKI Buffer Pool ID used to hold MPS segments used in (re)transmissions.
-L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
-Note:  This pool needs to have enough buffers to hold two times the window size negotiated
- in the L2CA_SetFCROptions (2 * tx_win_size)  to allow for retransmissions.
- The size of each buffer must be able to hold the maximum MPS segment size passed in
- L2CA_SetFCROptions plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
-*/
-#ifndef OBX_FCR_TX_POOL_ID
-#define OBX_FCR_TX_POOL_ID      HCI_ACL_POOL_ID
+/*
+ * Buffer size used to hold MPS segments used in (re)transmissions.
+ * The size of each buffer must be able to hold the maximum MPS segment size
+ * passed in L2CA_SetFCROptions plus BT_HDR (8) + HCI preamble (4) +
+ * L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
+ */
+#ifndef OBX_FCR_TX_BUF_SIZE
+#define OBX_FCR_TX_BUF_SIZE     BT_DEFAULT_BUFFER_SIZE
 #endif
 
-/* This option is application when OBX_14_INCLUDED=TRUE
-Size of the transmission window when using enhanced retransmission mode. Not used
-in basic and streaming modes. Range: 1 - 63
-*/
+/*
+ * Size of the transmission window when using enhanced retransmission mode.
+ * Not used in basic and streaming modes. Range: 1 - 63
+ */
 #ifndef OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR
 #define OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR       20
 #endif
 
-/* This option is application when OBX_14_INCLUDED=TRUE
-Number of transmission attempts for a single I-Frame before taking
-Down the connection. Used In ERTM mode only. Value is Ignored in basic and
-Streaming modes.
-Range: 0, 1-0xFF
-0 - infinite retransmissions
-1 - single transmission
-*/
+/*
+ * Number of transmission attempts for a single I-Frame before taking
+ * Down the connection. Used In ERTM mode only. Value is Ignored in basic and
+ * Streaming modes.
+ * Range: 0, 1-0xFF
+ * 0 - infinite retransmissions
+ * 1 - single transmission
+ */
 #ifndef OBX_FCR_OPT_MAX_TX_B4_DISCNT
 #define OBX_FCR_OPT_MAX_TX_B4_DISCNT    20
 #endif
 
-/* This option is application when OBX_14_INCLUDED=TRUE
-Retransmission Timeout
-Range: Minimum 2000 (2 secs) on BR/EDR when supporting PBF.
+/*
+ * Retransmission Timeout
+ * Range: Minimum 2000 (2 secs) on BR/EDR when supporting PBF.
  */
 #ifndef OBX_FCR_OPT_RETX_TOUT
 #define OBX_FCR_OPT_RETX_TOUT           2000
 #endif
 
-/* This option is application when OBX_14_INCLUDED=TRUE
-Monitor Timeout
-Range: Minimum 12000 (12 secs) on BR/EDR when supporting PBF.
-*/
+/*
+ * Monitor Timeout
+ * Range: Minimum 12000 (12 secs) on BR/EDR when supporting PBF.
+ */
 #ifndef OBX_FCR_OPT_MONITOR_TOUT
 #define OBX_FCR_OPT_MONITOR_TOUT        12000
 #endif
 
-/* This option is application when OBX_14_INCLUDED=TRUE
-Maximum PDU payload size.
-Suggestion: The maximum amount of data that will fit into a 3-DH5 packet.
-Range: 2 octets
-*/
+/*
+ * Maximum PDU payload size.
+ * Suggestion: The maximum amount of data that will fit into a 3-DH5 packet.
+ * Range: 2 octets
+ */
 #ifndef OBX_FCR_OPT_MAX_PDU_SIZE
 #define OBX_FCR_OPT_MAX_PDU_SIZE        L2CAP_MPS_OVER_BR_EDR
 #endif
@@ -1408,8 +1272,7 @@ Range: 2 octets
 #define AVDT_PROTECT_SIZE           90
 #endif
 
-/* Maximum number of GKI buffers in the fragment queue (for video frames).
- * Must be less than the number of buffers in the buffer pool of size AVDT_DATA_POOL_SIZE */
+/* Maximum number of buffers in the fragment queue (for video frames). */
 #ifndef AVDT_MAX_FRAG_COUNT
 #define AVDT_MAX_FRAG_COUNT         15
 #endif
@@ -1540,19 +1403,11 @@ Range: 2 octets
 #endif
 
 #ifndef HID_CONTROL_BUF_SIZE
-#define HID_CONTROL_BUF_SIZE            (4096+16)
-#endif
-
-#ifndef HID_CONTROL_POOL_ID
-#define HID_CONTROL_POOL_ID             2
+#define HID_CONTROL_BUF_SIZE            BT_DEFAULT_BUFFER_SIZE
 #endif
 
 #ifndef HID_INTERRUPT_BUF_SIZE
-#define HID_INTERRUPT_BUF_SIZE          (4096+16)
-#endif
-
-#ifndef HID_INTERRUPT_POOL_ID
-#define HID_INTERRUPT_POOL_ID           2
+#define HID_INTERRUPT_BUF_SIZE          BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /*************************************************************************
@@ -1672,49 +1527,31 @@ Range: 2 octets
 #define MCA_NUM_MDLS    4
 #endif
 
-/* Pool ID where to reassemble the SDU. */
-#ifndef MCA_USER_RX_POOL_ID
-#define MCA_USER_RX_POOL_ID     HCI_ACL_POOL_ID
-#endif
-
-/* Pool ID where to hold the SDU. */
-#ifndef MCA_USER_TX_POOL_ID
-#define MCA_USER_TX_POOL_ID     HCI_ACL_POOL_ID
-#endif
-
+/* Buffer size to reassemble the SDU. */
 #ifndef MCA_USER_RX_BUF_SIZE
-#define MCA_USER_RX_BUF_SIZE    (4096+16)
+#define MCA_USER_RX_BUF_SIZE    BT_DEFAULT_BUFFER_SIZE
 #endif
 
+/* Buffer size to hold the SDU. */
 #ifndef MCA_USER_TX_BUF_SIZE
-#define MCA_USER_TX_BUF_SIZE    (4096+16)
+#define MCA_USER_TX_BUF_SIZE    BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /*
-GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
-*/
-#ifndef MCA_FCR_RX_POOL_ID
-#define MCA_FCR_RX_POOL_ID      HCI_ACL_POOL_ID
-#endif
-
+ * Buffer size used to hold MPS segments during SDU reassembly
+ */
 #ifndef MCA_FCR_RX_BUF_SIZE
-#define MCA_FCR_RX_BUF_SIZE     (4096+16)
-#endif
-
-#ifndef MCA_FCR_TX_BUF_SIZE
-#define MCA_FCR_TX_BUF_SIZE     (4096+16)
+#define MCA_FCR_RX_BUF_SIZE     BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /*
-GKI Buffer Pool ID used to hold MPS segments used in (re)transmissions.
-L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
-Note:  This pool needs to have enough buffers to hold two times the window size negotiated
- in the tL2CAP_FCR_OPTIONS (2 * tx_win_size)  to allow for retransmissions.
- The size of each buffer must be able to hold the maximum MPS segment size passed in
- tL2CAP_FCR_OPTIONS plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
-*/
-#ifndef MCA_FCR_TX_POOL_ID
-#define MCA_FCR_TX_POOL_ID      HCI_ACL_POOL_ID
+ * Default buffer size used to hold MPS segments used in (re)transmissions.
+ * The size of each buffer must be able to hold the maximum MPS segment size
+ * passed in tL2CAP_FCR_OPTIONS plus BT_HDR (8) + HCI preamble (4) +
+ * L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
+ */
+#ifndef MCA_FCR_TX_BUF_SIZE
+#define MCA_FCR_TX_BUF_SIZE     BT_DEFAULT_BUFFER_SIZE
 #endif
 
 /* MCAP control channel FCR Option:
index 3ab1c26..3400789 100644 (file)
@@ -2127,8 +2127,8 @@ void avdt_scb_queue_frags(tAVDT_SCB *p_scb, UINT8 **pp_data, UINT32 *p_data_len,
     AVDT_TRACE_DEBUG("peer_mtu: %d, buf_size: %d num_frag=%d",
         p_tbl->peer_mtu, buf_size, num_frag);
 
-    if(buf_size > AVDT_DATA_POOL_SIZE)
-        buf_size = AVDT_DATA_POOL_SIZE;
+    if (buf_size > AVDT_DATA_BUF_SIZE)
+        buf_size = AVDT_DATA_BUF_SIZE;
 
     mtu_used = buf_size - BT_HDR_SIZE;
 
index adf966d..ae92386 100755 (executable)
@@ -832,7 +832,7 @@ static void avrc_msg_cback(UINT8 handle, UINT8 label, UINT8 cr,
 static BT_HDR  * avrc_pass_msg(tAVRC_MSG_PASS *p_msg)
 {
     assert(p_msg != NULL);
-    assert(AVRC_CMD_POOL_SIZE > (AVRC_MIN_CMD_LEN+p_msg->pass_len));
+    assert(AVRC_CMD_BUF_SIZE > (AVRC_MIN_CMD_LEN+p_msg->pass_len));
 
     BT_HDR  *p_cmd = (BT_HDR *) GKI_getbuf(AVRC_CMD_BUF_SIZE);
     if (p_cmd != NULL)
index 7e23967..b7f233a 100644 (file)
@@ -126,11 +126,12 @@ static tAVRC_STS avrc_bld_vol_change_notfn(BT_HDR * p_pkt)
 *******************************************************************************/
 static BT_HDR *avrc_bld_init_cmd_buffer(tAVRC_COMMAND *p_cmd)
 {
-    UINT16 offset = 0, chnl = AVCT_DATA_CTRL, len=AVRC_META_CMD_POOL_SIZE;
-    BT_HDR *p_pkt=NULL;
-    UINT8  opcode;
+    UINT16 offset = 0;
+    UINT16 chnl = AVCT_DATA_CTRL;
+    UINT16 len = AVRC_META_CMD_BUF_SIZE;
+    BT_HDR *p_pkt = NULL;
+    UINT8  opcode = avrc_opcode_from_pdu(p_cmd->pdu);
 
-    opcode = avrc_opcode_from_pdu(p_cmd->pdu);
     AVRC_TRACE_API("avrc_bld_init_cmd_buffer: pdu=%x, opcode=%x", p_cmd->pdu, opcode);
 
     switch (opcode)
index a9b1a2a..089516b 100644 (file)
@@ -738,8 +738,10 @@ static tAVRC_STS avrc_bld_rejected_rsp( tAVRC_RSP *p_rsp, BT_HDR *p_pkt )
 *******************************************************************************/
 static BT_HDR *avrc_bld_init_rsp_buffer(tAVRC_RESPONSE *p_rsp)
 {
-    UINT16 offset = AVRC_MSG_PASS_THRU_OFFSET, chnl = AVCT_DATA_CTRL, len=AVRC_META_CMD_POOL_SIZE;
-    BT_HDR *p_pkt=NULL;
+    UINT16 offset = AVRC_MSG_PASS_THRU_OFFSET;
+    UINT16 chnl = AVCT_DATA_CTRL;
+    UINT16 len = AVRC_META_CMD_BUF_SIZE;
+    BT_HDR *p_pkt = NULL;
     UINT8  opcode = avrc_opcode_from_pdu(p_rsp->pdu);
 
     AVRC_TRACE_API("avrc_bld_init_rsp_buffer: pdu=%x, opcode=%x/%x", p_rsp->pdu, opcode,
@@ -754,13 +756,13 @@ static BT_HDR *avrc_bld_init_rsp_buffer(tAVRC_RESPONSE *p_rsp)
     switch (opcode)
     {
     case AVRC_OP_PASS_THRU:
-        offset  = AVRC_MSG_PASS_THRU_OFFSET;
+        offset = AVRC_MSG_PASS_THRU_OFFSET;
         break;
 
     case AVRC_OP_VENDOR:
-        offset  = AVRC_MSG_VENDOR_OFFSET;
+        offset = AVRC_MSG_VENDOR_OFFSET;
         if (p_rsp->pdu == AVRC_PDU_GET_ELEMENT_ATTR)
-            len     = AVRC_BROWSE_POOL_SIZE;
+            len = AVRC_BROWSE_BUF_SIZE;
         break;
     }
 
index 8d340cb..e7a328e 100644 (file)
@@ -1784,8 +1784,8 @@ BOOLEAN btsnd_hcic_write_pagescan_type (UINT8 type)
 }
 
 /* Must have room to store BT_HDR + max VSC length + callback pointer */
-#if (HCI_CMD_POOL_BUF_SIZE < 268)
-#error "HCI_CMD_POOL_BUF_SIZE must be larger than 268"
+#if (HCI_CMD_BUF_SIZE < 268)
+#error "HCI_CMD_BUF_SIZE must be larger than 268"
 #endif
 
 void btsnd_hcic_vendor_spec_cmd (void *buffer, UINT16 opcode, UINT8 len,
index 472fa49..75b9f4a 100644 (file)
 
 /* Define a value that tells L2CAP to use the default HCI ACL buffer size */
 #define L2CAP_INVALID_ERM_BUF_SIZE      0
-/* Define a value that tells L2CAP to use the default HCI ACL buffer pool */
-#define L2CAP_DEFAULT_ERM_POOL_ID       0xFF
 /* Define a value that tells L2CAP to use the default MPS */
 #define L2CAP_DEFAULT_ERM_MPS           0x0000
 
 /* To optimize this, it must be a multiplum of the L2CAP PDU length AND match the 3DH5 air
  * including the l2cap headers in each packet - to match the latter - the -5 is added
  */
-#define L2CAP_MAX_SDU_LENGTH     (GKI_BUF4_SIZE - (L2CAP_MIN_OFFSET + L2CAP_MAX_HEADER_FCS) -5)
+#define L2CAP_MAX_SDU_LENGTH     (8080 + 26 - (L2CAP_MIN_OFFSET + L2CAP_MAX_HEADER_FCS) -5)
 #define L2CAP_MAX_BUF_SIZE      (10240 + 24)
 
 /* Part of L2CAP_MIN_OFFSET that is not part of L2CAP
index 23c83bd..c2dcb50 100644 (file)
@@ -1543,7 +1543,7 @@ int PORT_WriteDataCO (UINT16 handle, int* p_len)
     if(available == 0)
         return PORT_SUCCESS;
     /* Length for each buffer is the smaller of GKI buffer, peer MTU, or max_len */
-    length = RFCOMM_DATA_POOL_BUF_SIZE -
+    length = RFCOMM_DATA_BUF_SIZE -
             (UINT16)(sizeof(BT_HDR) + L2CAP_MIN_OFFSET + RFCOMM_DATA_OVERHEAD);
 
     /* If there are buffers scheduled for transmission check if requested */
@@ -1691,7 +1691,7 @@ int PORT_WriteData (UINT16 handle, char *p_data, UINT16 max_len, UINT16 *p_len)
     }
 
     /* Length for each buffer is the smaller of GKI buffer, peer MTU, or max_len */
-    length = RFCOMM_DATA_POOL_BUF_SIZE -
+    length = RFCOMM_DATA_BUF_SIZE -
             (UINT16)(sizeof(BT_HDR) + L2CAP_MIN_OFFSET + RFCOMM_DATA_OVERHEAD);
 
     /* If there are buffers scheduled for transmission check if requested */