1 /******************************************************************************
3 * Copyright (C) 1999-2012 Broadcom Corporation
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 ******************************************************************************/
21 /******************************************************************************
23 ** Buffer configuration
25 ******************************************************************************/
27 /* The size of the buffers in pool 0. */
29 #define GKI_BUF0_SIZE 64
32 /* The number of buffers in buffer pool 0. */
34 #define GKI_BUF0_MAX 96
37 /* The ID of buffer pool 0. */
39 #define GKI_POOL_ID_0 0
42 /* The size of the buffers in pool 1. */
44 #define GKI_BUF1_SIZE 288
47 /* The number of buffers in buffer pool 1. */
49 #define GKI_BUF1_MAX 52
52 /* The ID of buffer pool 1. */
54 #define GKI_POOL_ID_1 1
57 /* The size of the buffers in pool 2. */
59 #define GKI_BUF2_SIZE 660
62 /* The number of buffers in buffer pool 2. */
64 #define GKI_BUF2_MAX 90
67 /* The ID of buffer pool 2. */
69 #define GKI_POOL_ID_2 2
72 /* The size of the buffers in pool 3. */
74 #define GKI_BUF3_SIZE (4096+16)
77 /* The number of buffers in buffer pool 3. */
79 #define GKI_BUF3_MAX 400
82 /* The ID of buffer pool 3. */
84 #define GKI_POOL_ID_3 3
87 /* The size of the largest PUBLIC fixed buffer in system. */
88 #ifndef GKI_MAX_BUF_SIZE
89 #define GKI_MAX_BUF_SIZE GKI_BUF3_SIZE
92 /* The pool ID of the largest PUBLIC fixed buffer in system. */
93 #ifndef GKI_MAX_BUF_SIZE_POOL_ID
94 #define GKI_MAX_BUF_SIZE_POOL_ID GKI_POOL_ID_3
97 /* Pool 4 is used for BluetoothSocket L2CAP connections */
98 /* The size of the buffers in pool 4. */
100 #define GKI_BUF4_SIZE (8080+26)
103 /* The number of buffers in buffer pool 4. */
105 #define GKI_BUF4_MAX (OBX_NUM_SERVERS + OBX_NUM_CLIENTS)
108 /* The ID of buffer pool 4. */
109 #ifndef GKI_POOL_ID_4
110 #define GKI_POOL_ID_4 4
113 /* The number of fixed GKI buffer pools.
114 eL2CAP requires Pool ID 5
115 If BTM_SCO_HCI_INCLUDED is FALSE, Pool ID 6 is unnecessary, otherwise set to 7
116 If BTA_HL_INCLUDED is FALSE then Pool ID 7 is uncessary and set the following to 7, otherwise set to 8
117 If BLE_INCLUDED is FALSE then Pool ID 8 is uncessary and set the following to 8, otherwise set to 9
118 POOL_ID 9 is a public pool meant for large buffer needs such as SDP_DB
120 #ifndef GKI_NUM_FIXED_BUF_POOLS
121 #define GKI_NUM_FIXED_BUF_POOLS 10
124 /* The buffer pool usage mask. */
125 #ifndef GKI_DEF_BUFPOOL_PERM_MASK
126 /* Setting POOL_ID 9 as a public pool meant for large buffers such as SDP_DB */
127 #define GKI_DEF_BUFPOOL_PERM_MASK 0xfdf0
130 /* The following is intended to be a reserved pool for L2CAP
131 Flow control and retransmissions and intentionally kept out
134 /* The number of buffers in buffer pool 5. */
136 #define GKI_BUF5_MAX 64
139 /* The ID of buffer pool 5. */
140 #ifndef GKI_POOL_ID_5
141 #define GKI_POOL_ID_5 5
144 /* The size of the buffers in pool 5
145 ** Special pool used by L2CAP retransmissions only. This size based on segment
146 ** that will fit into both DH5 and 2-DH3 packet types after accounting for GKI
147 ** header. 13 bytes of max headers allows us a 339 payload max. (in btui_app.txt)
148 ** Note: 748 used for insight scriptwrapper with CAT-2 scripts.
150 #ifndef GKI_BUF5_SIZE
151 #define GKI_BUF5_SIZE 748
154 /* The following is intended to be a reserved pool for SCO
155 over HCI data and intentionally kept out of order */
157 /* The ID of buffer pool 6. */
158 #ifndef GKI_POOL_ID_6
159 #define GKI_POOL_ID_6 6
162 /* The size of the buffers in pool 6,
163 BUF_SIZE = max SCO data 255 + sizeof(BT_HDR) = 8 + SCO packet header 3 + padding 2 = 268 */
164 #ifndef GKI_BUF6_SIZE
165 #define GKI_BUF6_SIZE 268
168 /* The number of buffers in buffer pool 6. */
170 #define GKI_BUF6_MAX 60
174 /* The following pool is a dedicated pool for HDP
175 If a shared pool is more desirable then
176 1. set BTA_HL_LRG_DATA_POOL_ID to the desired Gki Pool ID
177 2. make sure that the shared pool size is larger than 9472
178 3. adjust GKI_NUM_FIXED_BUF_POOLS accordingly since
179 POOL ID 7 is not needed
182 /* The ID of buffer pool 7. */
183 #ifndef GKI_POOL_ID_7
184 #define GKI_POOL_ID_7 7
187 /* The size of the buffers in pool 7 */
188 #ifndef GKI_BUF7_SIZE
189 #define GKI_BUF7_SIZE (10240 + 24)
192 /* The number of buffers in buffer pool 7. */
194 #define GKI_BUF7_MAX 2
197 /* The following pool is a dedicated pool for GATT
198 If a shared pool is more desirable then
199 1. set GATT_DB_POOL_ID to the desired Gki Pool ID
200 2. make sure that the shared pool size fit a common GATT database needs
201 3. adjust GKI_NUM_FIXED_BUF_POOLS accordingly since
202 POOL ID 8 is not needed
205 /* The ID of buffer pool 8. */
206 #ifndef GKI_POOL_ID_8
207 #define GKI_POOL_ID_8 8
210 /* The size of the buffers in pool 8 */
211 #ifndef GKI_BUF8_SIZE
212 #define GKI_BUF8_SIZE 128
215 /* The number of buffers in buffer pool 8. */
217 #define GKI_BUF8_MAX 30
220 /* The following pool is meant for large allocations such as SDP_DB */
221 #ifndef GKI_POOL_ID_9
222 #define GKI_POOL_ID_9 9
225 #ifndef GKI_BUF9_SIZE
226 #define GKI_BUF9_SIZE 8192
230 #define GKI_BUF9_MAX 5
233 /* The number of fixed and dynamic buffer pools */
234 #ifndef GKI_NUM_TOTAL_BUF_POOLS
235 #define GKI_NUM_TOTAL_BUF_POOLS 10
238 void LogMsg (UINT32 trace_set_mask, const char *fmt_str, ...);