OSDN Git Service

8cceebcd95763b59a1da9c9aa9bde797a45b40bd
[android-x86/system-bt.git] / include / bt_target.h
1 /******************************************************************************
2  *
3  *  Copyright (c) 2014 The Android Open Source Project
4  *  Copyright (C) 1999-2012 Broadcom Corporation
5  *
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at:
9  *
10  *  http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *
18  ******************************************************************************/
19
20 #ifndef BT_TARGET_H
21 #define BT_TARGET_H
22
23 #ifndef BUILDCFG
24 #define BUILDCFG
25 #endif
26 #include "bt_types.h"
27
28 #ifdef BUILDCFG
29
30 #if !defined(HAS_BDROID_BUILDCFG) && !defined(HAS_NO_BDROID_BUILDCFG)
31 #error "An Android.mk file did not include bdroid_CFLAGS and possibly not bdorid_C_INCLUDES"
32 #endif
33
34 #ifdef HAS_BDROID_BUILDCFG
35 #include "bdroid_buildcfg.h"
36 #endif
37
38 #endif  // BUILDCFG
39
40 /* Include common GKI definitions used by this platform */
41 #include "gki_target.h"
42
43 #include "bt_types.h"   /* This must be defined AFTER buildcfg.h */
44 #include "dyn_mem.h"    /* defines static and/or dynamic memory for components */
45
46 //------------------Added from bdroid_buildcfg.h---------------------
47 #ifndef L2CAP_EXTFEA_SUPPORTED_MASK
48 #define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
49 #endif
50
51 #ifndef BTUI_OPS_FORMATS
52 #define BTUI_OPS_FORMATS (BTA_OP_VCARD21_MASK | BTA_OP_ANY_MASK)
53 #endif
54
55 #ifndef BTA_RFC_MTU_SIZE
56 #define BTA_RFC_MTU_SIZE (L2CAP_MTU_SIZE-L2CAP_MIN_OFFSET-RFCOMM_DATA_OVERHEAD)
57 #endif
58
59 #ifndef SBC_NO_PCM_CPY_OPTION
60 #define SBC_NO_PCM_CPY_OPTION FALSE
61 #endif
62
63 #ifndef BTA_INCLUDED
64 #define BTA_INCLUDED TRUE
65 #endif
66
67 #ifndef BTA_AG_INCLUDED
68 #define BTA_AG_INCLUDED  TRUE
69 #endif
70
71 #ifndef BTA_PAN_INCLUDED
72 #define BTA_PAN_INCLUDED TRUE
73 #endif
74
75 #ifndef BTA_HH_INCLUDED
76 #define BTA_HH_INCLUDED TRUE
77 #endif
78
79 #ifndef BTA_HH_ROLE
80 #define BTA_HH_ROLE BTA_MASTER_ROLE_PREF
81 #endif
82
83 #ifndef BTA_HH_LE_INCLUDED
84 #define BTA_HH_LE_INCLUDED TRUE
85 #endif
86
87 #ifndef BTA_AR_INCLUDED
88 #define BTA_AR_INCLUDED TRUE
89 #endif
90
91 #ifndef BTA_AV_INCLUDED
92 #define BTA_AV_INCLUDED TRUE
93 #endif
94
95 #ifndef BTA_GATT_INCLUDED
96 #define BTA_GATT_INCLUDED TRUE
97 #endif
98
99 #ifndef BTA_AV_SINK_INCLUDED
100 #define BTA_AV_SINK_INCLUDED FALSE
101 #endif
102
103 #ifndef BTA_DISABLE_DELAY
104 #define BTA_DISABLE_DELAY 200 /* in milliseconds */
105 #endif
106
107 #ifndef ANDROID_APP_INCLUDED
108 #define ANDROID_APP_INCLUDED  TRUE
109 #endif
110
111 #ifndef ANDROID_USE_LOGCAT
112 #define ANDROID_USE_LOGCAT  TRUE
113 #endif
114
115 // If the next wakeup time is less than this threshold, we should acquire
116 // a wakelock instead of setting a wake alarm so we're not bouncing in
117 // and out of suspend frequently.
118 // in millisecond
119 // TODO(zachoverflow): reinstate in alarm code
120 #ifndef GKI_TIMER_INTERVAL_FOR_WAKELOCK
121 #define GKI_TIMER_INTERVAL_FOR_WAKELOCK 3000
122 #endif
123
124 #ifndef BTA_SYS_TIMER_PERIOD
125 #define BTA_SYS_TIMER_PERIOD  100
126 #endif
127
128 #ifndef GKI_SHUTDOWN_EVT
129 #define GKI_SHUTDOWN_EVT  APPL_EVT_7
130 #endif
131
132 #ifndef SBC_FOR_EMBEDDED_LINUX
133 #define SBC_FOR_EMBEDDED_LINUX TRUE
134 #endif
135
136 #ifndef AVDT_VERSION
137 #define AVDT_VERSION  0x0102
138 #endif
139
140 #ifndef BTA_AG_AT_MAX_LEN
141 #define BTA_AG_AT_MAX_LEN  512
142 #endif
143
144 #ifndef BTA_AVRCP_FF_RW_SUPPORT
145 #define BTA_AVRCP_FF_RW_SUPPORT TRUE
146 #endif
147
148 #ifndef BTA_AG_SCO_PKT_TYPES
149 #define BTA_AG_SCO_PKT_TYPES  (BTM_SCO_LINK_ONLY_MASK | BTM_SCO_PKT_TYPES_MASK_EV3 |  BTM_SCO_PKT_TYPES_MASK_NO_3_EV3 | BTM_SCO_PKT_TYPES_MASK_NO_2_EV5 | BTM_SCO_PKT_TYPES_MASK_NO_3_EV5)
150 #endif
151
152 #ifndef BTA_AV_RET_TOUT
153 #define BTA_AV_RET_TOUT 15
154 #endif
155
156 #ifndef PORCHE_PAIRING_CONFLICT
157 #define PORCHE_PAIRING_CONFLICT  TRUE
158 #endif
159
160 #ifndef BTA_AV_CO_CP_SCMS_T
161 #define BTA_AV_CO_CP_SCMS_T  FALSE
162 #endif
163
164 /* This feature is used to eanble interleaved scan*/
165 #ifndef BTA_HOST_INTERLEAVE_SEARCH
166 #define BTA_HOST_INTERLEAVE_SEARCH FALSE
167 #endif
168
169 #ifndef BT_USE_TRACES
170 #define BT_USE_TRACES  TRUE
171 #endif
172
173 #ifndef BT_TRACE_BTIF
174 #define BT_TRACE_BTIF  TRUE
175 #endif
176
177 #ifndef BT_TRACE_VERBOSE
178 #define BT_TRACE_VERBOSE  FALSE
179 #endif
180
181 #ifndef BTA_DM_SDP_DB_SIZE
182 #define BTA_DM_SDP_DB_SIZE  8000
183 #endif
184
185 #ifndef HL_INCLUDED
186 #define HL_INCLUDED  TRUE
187 #endif
188
189 #ifndef AG_VOICE_SETTINGS
190 #define AG_VOICE_SETTINGS  HCI_DEFAULT_VOICE_SETTINGS
191 #endif
192
193 #ifndef BTIF_DM_OOB_TEST
194 #define BTIF_DM_OOB_TEST  TRUE
195 #endif
196
197 // How long to wait before activating sniff mode after entering the
198 // idle state for FTS, OPS connections
199 #ifndef BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS
200 #define BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS 7000
201 #endif
202
203 //------------------End added from bdroid_buildcfg.h---------------------
204
205
206 /******************************************************************************
207 **
208 ** GKI Buffer Pools
209 **
210 ******************************************************************************/
211
212 /* Receives HCI events from the lower-layer. */
213 #ifndef HCI_CMD_POOL_ID
214 #define HCI_CMD_POOL_ID             GKI_POOL_ID_2
215 #endif
216
217 #ifndef HCI_CMD_POOL_BUF_SIZE
218 #define HCI_CMD_POOL_BUF_SIZE       GKI_BUF2_SIZE
219 #endif
220
221 /* Receives ACL data packets from thelower-layer. */
222 #ifndef HCI_ACL_POOL_ID
223 #define HCI_ACL_POOL_ID             GKI_POOL_ID_3
224 #endif
225
226 /* Maximum number of buffers available for ACL receive data. */
227 #ifndef HCI_ACL_BUF_MAX
228 #define HCI_ACL_BUF_MAX             GKI_BUF3_MAX
229 #endif
230
231 /* Receives SCO data packets from the lower-layer. */
232 #ifndef HCI_SCO_POOL_ID
233 #define HCI_SCO_POOL_ID             GKI_POOL_ID_6
234 #endif
235
236 /* Sends SDP data packets. */
237 #ifndef SDP_POOL_ID
238 #define SDP_POOL_ID                 3
239 #endif
240
241 /* Sends RFCOMM command packets. */
242 #ifndef RFCOMM_CMD_POOL_ID
243 #define RFCOMM_CMD_POOL_ID          GKI_POOL_ID_2
244 #endif
245
246 /* Sends RFCOMM data packets. */
247 #ifndef RFCOMM_DATA_POOL_ID
248 #define RFCOMM_DATA_POOL_ID         GKI_POOL_ID_3
249 #endif
250
251 #ifndef RFCOMM_DATA_POOL_BUF_SIZE
252 #define RFCOMM_DATA_POOL_BUF_SIZE   GKI_BUF3_SIZE
253 #endif
254
255 /* Sends L2CAP packets to the peer and HCI messages to the controller. */
256 #ifndef L2CAP_CMD_POOL_ID
257 #define L2CAP_CMD_POOL_ID           GKI_POOL_ID_2
258 #endif
259
260 /* Sends L2CAP segmented packets in ERTM mode */
261 #ifndef L2CAP_FCR_TX_POOL_ID
262 #define L2CAP_FCR_TX_POOL_ID        HCI_ACL_POOL_ID
263 #endif
264
265 /* Receives L2CAP segmented packets in ERTM mode */
266 #ifndef L2CAP_FCR_RX_POOL_ID
267 #define L2CAP_FCR_RX_POOL_ID        HCI_ACL_POOL_ID
268 #endif
269
270 /* Number of ACL buffers to assign to LE
271    if the HCI buffer pool is shared with BR/EDR */
272 #ifndef L2C_DEF_NUM_BLE_BUF_SHARED
273 #define L2C_DEF_NUM_BLE_BUF_SHARED      1
274 #endif
275
276 /* Used by BTM when it sends HCI commands to the controller. */
277 #ifndef BTM_CMD_POOL_ID
278 #define BTM_CMD_POOL_ID             GKI_POOL_ID_2
279 #endif
280
281 /* Used to send data to L2CAP. */
282 #ifndef GAP_DATA_POOL_ID
283 #define GAP_DATA_POOL_ID            GKI_POOL_ID_3
284 #endif
285
286 #ifndef SPP_DB_SIZE
287 #define SPP_DB_SIZE                 GKI_BUF3_SIZE
288 #endif
289
290 /* BNEP data and protocol messages. */
291 #ifndef BNEP_POOL_ID
292 #define BNEP_POOL_ID                GKI_POOL_ID_3
293 #endif
294
295 /* RPC pool for temporary trace message buffers. */
296 #ifndef RPC_SCRATCH_POOL_ID
297 #define RPC_SCRATCH_POOL_ID         GKI_POOL_ID_2
298 #endif
299
300 /* AVDTP pool for protocol messages */
301 #ifndef AVDT_CMD_POOL_ID
302 #define AVDT_CMD_POOL_ID            GKI_POOL_ID_2
303 #endif
304
305 /* AVDTP pool size for media packets in case of fragmentation */
306 #ifndef AVDT_DATA_POOL_SIZE
307 #define AVDT_DATA_POOL_SIZE         GKI_BUF3_SIZE
308 #endif
309
310 #ifndef PAN_POOL_ID
311 #define PAN_POOL_ID                 GKI_POOL_ID_3
312 /* Maximum amount of the shared buffer to allocate for PAN */
313 #define PAN_POOL_MAX                (GKI_BUF3_MAX / 4)
314 #endif
315
316 /* AVCTP pool for protocol messages */
317 #ifndef AVCT_CMD_POOL_ID
318 #define AVCT_CMD_POOL_ID            GKI_POOL_ID_1
319 #endif
320
321 /* AVRCP pool for protocol messages */
322 #ifndef AVRC_CMD_POOL_ID
323 #define AVRC_CMD_POOL_ID            GKI_POOL_ID_1
324 #endif
325
326 /* AVRCP pool size for protocol messages */
327 #ifndef AVRC_CMD_POOL_SIZE
328 #define AVRC_CMD_POOL_SIZE          GKI_BUF1_SIZE
329 #endif
330
331 /* AVRCP Metadata pool for protocol messages */
332 #ifndef AVRC_META_CMD_POOL_ID
333 #define AVRC_META_CMD_POOL_ID       GKI_POOL_ID_2
334 #endif
335
336 /* AVRCP Metadata pool size for protocol messages */
337 #ifndef AVRC_META_CMD_POOL_SIZE
338 #define AVRC_META_CMD_POOL_SIZE     GKI_BUF2_SIZE
339 #endif
340
341
342 /* AVRCP buffer size for browsing channel messages */
343 #ifndef AVRC_BROWSE_POOL_SIZE
344 #define AVRC_BROWSE_POOL_SIZE     GKI_MAX_BUF_SIZE
345 #endif
346
347 #ifndef BTA_HL_LRG_DATA_POOL_ID
348 #define BTA_HL_LRG_DATA_POOL_ID        GKI_POOL_ID_7
349 #endif
350
351 /* GATT Server Database pool ID */
352 #ifndef GATT_DB_POOL_ID
353 #define GATT_DB_POOL_ID                 GKI_POOL_ID_8
354 #endif
355
356 /* GATT Data sending buffer pool ID, use default ACL pool for fix channel data */
357 #ifndef GATT_BUF_POOL_ID
358 #define GATT_BUF_POOL_ID                HCI_ACL_POOL_ID
359 #endif
360
361 /******************************************************************************
362 **
363 ** Lower Layer Interface
364 **
365 ******************************************************************************/
366
367 /* Macro for allocating buffer for HCI commands */
368 #ifndef HCI_GET_CMD_BUF
369 #if (!defined(HCI_USE_VARIABLE_SIZE_CMD_BUF) || (HCI_USE_VARIABLE_SIZE_CMD_BUF == FALSE))
370 /* Allocate fixed-size buffer from HCI_CMD_POOL (default case) */
371 #define HCI_GET_CMD_BUF(paramlen)    ((BT_HDR *)GKI_getpoolbuf (HCI_CMD_POOL_ID))
372 #else
373 /* Allocate smallest possible buffer (for platforms with limited RAM) */
374 #define HCI_GET_CMD_BUF(paramlen)    ((BT_HDR *)GKI_getbuf ((UINT16)(BT_HDR_SIZE + HCIC_PREAMBLE_SIZE + (paramlen))))
375 #endif
376 #endif  /* HCI_GET_CMD_BUF */
377
378 /******************************************************************************
379 **
380 ** HCI Services (H4)
381 **
382 ******************************************************************************/
383 #ifdef __cplusplus
384 extern "C" {
385 #endif
386
387 #ifdef __cplusplus
388 }
389 #endif
390
391 /* Use 2 second for low-resolution systems, override to 1 for high-resolution systems */
392 #ifndef BT_1SEC_TIMEOUT
393 #define BT_1SEC_TIMEOUT             (2)
394 #endif
395
396 /* Quick Timer */
397 /* if L2CAP_FCR_INCLUDED is TRUE then it should have 100 millisecond resolution */
398 /* if none of them is included then QUICK_TIMER_TICKS_PER_SEC is set to 0 to exclude quick timer */
399 #ifndef QUICK_TIMER_TICKS_PER_SEC
400 #define QUICK_TIMER_TICKS_PER_SEC   10       /* 100ms timer */
401 #endif
402
403 /******************************************************************************
404 **
405 ** BTM
406 **
407 ******************************************************************************/
408 /* Include inquiry code. */
409 #ifndef BTM_INQUIRY_INCLUDED
410 #define BTM_INQUIRY_INCLUDED        TRUE
411 #endif
412
413 /* Cancel Inquiry on incoming SSP */
414 #ifndef BTM_NO_SSP_ON_INQUIRY
415 #define BTM_NO_SSP_ON_INQUIRY       FALSE
416 #endif
417
418 /* Includes SCO if TRUE */
419 #ifndef BTM_SCO_INCLUDED
420 #define BTM_SCO_INCLUDED            TRUE       /* TRUE includes SCO code */
421 #endif
422
423 /* Includes SCO if TRUE */
424 #ifndef BTM_SCO_HCI_INCLUDED
425 #define BTM_SCO_HCI_INCLUDED            FALSE       /* TRUE includes SCO over HCI code */
426 #endif
427
428 /* Includes WBS if TRUE */
429 #ifndef BTM_WBS_INCLUDED
430 #define BTM_WBS_INCLUDED            FALSE       /* TRUE includes WBS code */
431 #endif
432
433 /* Includes PCM2 support if TRUE */
434 #ifndef BTM_PCM2_INCLUDED
435 #define BTM_PCM2_INCLUDED           FALSE
436 #endif
437
438 /*  This is used to work around a controller bug that doesn't like Disconnect
439 **  issued while there is a role switch in progress
440 */
441 #ifndef BTM_DISC_DURING_RS
442 #define BTM_DISC_DURING_RS TRUE
443 #endif
444
445 /**************************
446 ** Initial SCO TX credit
447 *************************/
448 /* max TX SCO data packet size */
449 #ifndef BTM_SCO_DATA_SIZE_MAX
450 #define BTM_SCO_DATA_SIZE_MAX       240
451 #endif
452
453 /* The size in bytes of the BTM inquiry database. */
454 #ifndef BTM_INQ_DB_SIZE
455 #define BTM_INQ_DB_SIZE             40
456 #endif
457
458 /* TRUE if controller does not support inquiry event filtering. */
459 #ifndef BTM_BYPASS_EVENT_FILTERING
460 #define BTM_BYPASS_EVENT_FILTERING  FALSE
461 #endif
462
463 /* TRUE if inquiry filtering is desired from BTM. */
464 #ifndef BTM_USE_INQ_RESULTS_FILTER
465 #define BTM_USE_INQ_RESULTS_FILTER  TRUE
466 #endif
467
468 /* The default scan mode */
469 #ifndef BTM_DEFAULT_SCAN_TYPE
470 #define BTM_DEFAULT_SCAN_TYPE       BTM_SCAN_TYPE_INTERLACED
471 #endif
472
473 /* Should connections to unknown devices be allowed when not discoverable? */
474 #ifndef BTM_ALLOW_CONN_IF_NONDISCOVER
475 #define BTM_ALLOW_CONN_IF_NONDISCOVER   TRUE
476 #endif
477
478 /* Sets the Page_Scan_Window:  the length of time that the device is performing a page scan. */
479 #ifndef BTM_DEFAULT_CONN_WINDOW
480 #define BTM_DEFAULT_CONN_WINDOW     0x0012
481 #endif
482
483 /* Sets the Page_Scan_Activity:  the interval between the start of two consecutive page scans. */
484 #ifndef BTM_DEFAULT_CONN_INTERVAL
485 #define BTM_DEFAULT_CONN_INTERVAL   0x0800
486 #endif
487
488 /* When automatic inquiry scan is enabled, this sets the inquiry scan window. */
489 #ifndef BTM_DEFAULT_DISC_WINDOW
490 #define BTM_DEFAULT_DISC_WINDOW     0x0012
491 #endif
492
493 /* When automatic inquiry scan is enabled, this sets the inquiry scan interval. */
494 #ifndef BTM_DEFAULT_DISC_INTERVAL
495 #define BTM_DEFAULT_DISC_INTERVAL   0x0800
496 #endif
497
498 /* Default class of device
499 * {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
500 *
501 * SERVICE_CLASS:0x5A (Bit17 -Networking,Bit19 - Capturing,Bit20 -Object Transfer,Bit22 -Telephony)
502 * MAJOR_CLASS:0x02 - PHONE
503 * MINOR_CLASS:0x0C - SMART_PHONE
504 *
505 */
506 #ifndef BTA_DM_COD
507 #define BTA_DM_COD {0x5A, 0x02, 0x0C}
508 #endif
509
510 /* The number of SCO links. */
511 #ifndef BTM_MAX_SCO_LINKS
512 #define BTM_MAX_SCO_LINKS           3
513 #endif
514
515 /* The preferred type of SCO links (2-eSCO, 0-SCO). */
516 #ifndef BTM_DEFAULT_SCO_MODE
517 #define BTM_DEFAULT_SCO_MODE        2
518 #endif
519
520 /* The number of security records for peer devices. */
521 #ifndef BTM_SEC_MAX_DEVICE_RECORDS
522 #define BTM_SEC_MAX_DEVICE_RECORDS  100
523 #endif
524
525 /* The number of security records for services. */
526 #ifndef BTM_SEC_MAX_SERVICE_RECORDS
527 #define BTM_SEC_MAX_SERVICE_RECORDS 32
528 #endif
529
530 /* If True, force a retrieval of remote device name for each bond in case it's changed */
531 #ifndef BTM_SEC_FORCE_RNR_FOR_DBOND
532 #define BTM_SEC_FORCE_RNR_FOR_DBOND  FALSE
533 #endif
534
535 /* Maximum device name length used in btm database. */
536 #ifndef BTM_MAX_REM_BD_NAME_LEN
537 #define BTM_MAX_REM_BD_NAME_LEN     248
538 #endif
539
540 /* Maximum local device name length stored btm database.
541   '0' disables storage of the local name in BTM */
542 #ifndef BTM_MAX_LOC_BD_NAME_LEN
543 #define BTM_MAX_LOC_BD_NAME_LEN     248
544 #endif
545
546 /* Fixed Default String. When this is defined as null string, the device's
547  * product model name is used as the default local name.
548  */
549 #ifndef BTM_DEF_LOCAL_NAME
550 #define BTM_DEF_LOCAL_NAME      ""
551 #endif
552
553 /* Maximum service name stored with security authorization (0 if not needed) */
554 #ifndef BTM_SEC_SERVICE_NAME_LEN
555 #define BTM_SEC_SERVICE_NAME_LEN    BT_MAX_SERVICE_NAME_LEN
556 #endif
557
558 /* Maximum length of the service name. */
559 #ifndef BT_MAX_SERVICE_NAME_LEN
560 #define BT_MAX_SERVICE_NAME_LEN     21
561 #endif
562
563 /* ACL buffer size in HCI Host Buffer Size command. */
564 #ifndef BTM_ACL_BUF_SIZE
565 #define BTM_ACL_BUF_SIZE            0
566 #endif
567
568 /* The maximum number of clients that can register with the power manager. */
569 #ifndef BTM_MAX_PM_RECORDS
570 #define BTM_MAX_PM_RECORDS          2
571 #endif
572
573 /* This is set to show debug trace messages for the power manager. */
574 #ifndef BTM_PM_DEBUG
575 #define BTM_PM_DEBUG                FALSE
576 #endif
577
578 /* This is set to TRUE if link is to be unparked due to BTM_CreateSCO API. */
579 #ifndef BTM_SCO_WAKE_PARKED_LINK
580 #define BTM_SCO_WAKE_PARKED_LINK    TRUE
581 #endif
582
583 /* If the user does not respond to security process requests within this many seconds,
584  * a negative response would be sent automatically.
585  * 30 is LMP response timeout value */
586 #ifndef BTM_SEC_TIMEOUT_VALUE
587 #define BTM_SEC_TIMEOUT_VALUE           35
588 #endif
589
590 /* Maximum number of callbacks that can be registered using BTM_RegisterForVSEvents */
591 #ifndef BTM_MAX_VSE_CALLBACKS
592 #define BTM_MAX_VSE_CALLBACKS           3
593 #endif
594
595 /******************************************
596 **    Lisbon Features
597 *******************************************/
598 /* This is set to TRUE if the server Extended Inquiry Response feature is desired. */
599 /* server sends EIR to client */
600 #ifndef BTM_EIR_SERVER_INCLUDED
601 #define BTM_EIR_SERVER_INCLUDED         TRUE
602 #endif
603
604 /* This is set to TRUE if the FEC is required for EIR packet. */
605 #ifndef BTM_EIR_DEFAULT_FEC_REQUIRED
606 #define BTM_EIR_DEFAULT_FEC_REQUIRED    TRUE
607 #endif
608
609 /* The IO capability of the local device (for Simple Pairing) */
610 #ifndef BTM_LOCAL_IO_CAPS
611 #define BTM_LOCAL_IO_CAPS               BTM_IO_CAP_IO
612 #endif
613
614 #ifndef BTM_LOCAL_IO_CAPS_BLE
615 #define BTM_LOCAL_IO_CAPS_BLE           BTM_IO_CAP_KBDISP
616 #endif
617
618 /* The default MITM Protection Requirement (for Simple Pairing)
619  * Possible values are BTM_AUTH_SP_YES or BTM_AUTH_SP_NO */
620 #ifndef BTM_DEFAULT_AUTH_REQ
621 #define BTM_DEFAULT_AUTH_REQ            BTM_AUTH_SP_NO
622 #endif
623
624 /* The default MITM Protection Requirement for dedicated bonding using Simple Pairing
625  * Possible values are BTM_AUTH_AP_YES or BTM_AUTH_AP_NO */
626 #ifndef BTM_DEFAULT_DD_AUTH_REQ
627 #define BTM_DEFAULT_DD_AUTH_REQ            BTM_AUTH_AP_YES
628 #endif
629
630 /* Include Out-of-Band implementation for Simple Pairing */
631 #ifndef BTM_OOB_INCLUDED
632 #define BTM_OOB_INCLUDED                TRUE
633 #endif
634
635 /* TRUE to include Sniff Subrating */
636 #ifndef BTM_SSR_INCLUDED
637 #define BTM_SSR_INCLUDED                TRUE
638 #endif
639
640 /*************************
641 ** End of Lisbon Features
642 **************************/
643
644 /* Used for conformance testing ONLY */
645 #ifndef BTM_BLE_CONFORMANCE_TESTING
646 #define BTM_BLE_CONFORMANCE_TESTING           FALSE
647 #endif
648
649 /******************************************************************************
650 **
651 ** L2CAP
652 **
653 ******************************************************************************/
654
655 /* Flow control and retransmission mode */
656
657 #ifndef L2CAP_FCR_INCLUDED
658 #define L2CAP_FCR_INCLUDED TRUE
659 #endif
660
661 /* The maximum number of simultaneous links that L2CAP can support. */
662 #ifndef MAX_ACL_CONNECTIONS
663 #define MAX_L2CAP_LINKS             7
664 #else
665 #define MAX_L2CAP_LINKS             MAX_ACL_CONNECTIONS
666 #endif
667
668 /* The maximum number of simultaneous channels that L2CAP can support. */
669 #ifndef MAX_L2CAP_CHANNELS
670 #define MAX_L2CAP_CHANNELS          16
671 #endif
672
673 /* The maximum number of simultaneous applications that can register with L2CAP. */
674 #ifndef MAX_L2CAP_CLIENTS
675 #define MAX_L2CAP_CLIENTS           15
676 #endif
677
678 /* The number of seconds of link inactivity before a link is disconnected. */
679 #ifndef L2CAP_LINK_INACTIVITY_TOUT
680 #define L2CAP_LINK_INACTIVITY_TOUT  4
681 #endif
682
683 /* The number of seconds of link inactivity after bonding before a link is disconnected. */
684 #ifndef L2CAP_BONDING_TIMEOUT
685 #define L2CAP_BONDING_TIMEOUT       3
686 #endif
687
688 /* The time from the HCI connection complete to disconnect if no channel is established. */
689 #ifndef L2CAP_LINK_STARTUP_TOUT
690 #define L2CAP_LINK_STARTUP_TOUT     60
691 #endif
692
693 /* The L2CAP MTU; must be in accord with the HCI ACL pool size. */
694 #ifndef L2CAP_MTU_SIZE
695 #define L2CAP_MTU_SIZE              1691
696 #endif
697
698 /* The L2CAP MPS over Bluetooth; must be in accord with the FCR tx pool size and ACL down buffer size. */
699 #ifndef L2CAP_MPS_OVER_BR_EDR
700 #define L2CAP_MPS_OVER_BR_EDR       1010
701 #endif
702
703 /* If host flow control enabled, this is the number of buffers the controller can have unacknowledged. */
704 #ifndef L2CAP_HOST_FC_ACL_BUFS
705 #define L2CAP_HOST_FC_ACL_BUFS      20
706 #endif
707
708 /* This is set to enable L2CAP to  take the ACL link out of park mode when ACL data is to be sent. */
709 #ifndef L2CAP_WAKE_PARKED_LINK
710 #define L2CAP_WAKE_PARKED_LINK      TRUE
711 #endif
712
713 /* Whether link wants to be the master or the slave. */
714 #ifndef L2CAP_DESIRED_LINK_ROLE
715 #define L2CAP_DESIRED_LINK_ROLE     HCI_ROLE_SLAVE
716 #endif
717
718 /* Include Non-Flushable Packet Boundary Flag feature of Lisbon */
719 #ifndef L2CAP_NON_FLUSHABLE_PB_INCLUDED
720 #define L2CAP_NON_FLUSHABLE_PB_INCLUDED     TRUE
721 #endif
722
723 /* Minimum number of ACL credit for high priority link */
724 #ifndef L2CAP_HIGH_PRI_MIN_XMIT_QUOTA
725 #define L2CAP_HIGH_PRI_MIN_XMIT_QUOTA       5
726 #endif
727
728 /* used for monitoring HCI ACL credit management */
729 #ifndef L2CAP_HCI_FLOW_CONTROL_DEBUG
730 #define L2CAP_HCI_FLOW_CONTROL_DEBUG        TRUE
731 #endif
732
733 /* Used for calculating transmit buffers off of */
734 #ifndef L2CAP_NUM_XMIT_BUFFS
735 #define L2CAP_NUM_XMIT_BUFFS                HCI_ACL_BUF_MAX
736 #endif
737
738 /* Unicast Connectionless Data */
739 #ifndef L2CAP_UCD_INCLUDED
740 #define L2CAP_UCD_INCLUDED                  FALSE
741 #endif
742
743 /* Unicast Connectionless Data MTU */
744 #ifndef L2CAP_UCD_MTU
745 #define L2CAP_UCD_MTU                       L2CAP_MTU_SIZE
746 #endif
747
748 /* Unicast Connectionless Data Idle Timeout */
749 #ifndef L2CAP_UCD_IDLE_TIMEOUT
750 #define L2CAP_UCD_IDLE_TIMEOUT              2
751 #endif
752
753 /* Unicast Connectionless Data Idle Timeout */
754 #ifndef L2CAP_UCD_CH_PRIORITY
755 #define L2CAP_UCD_CH_PRIORITY               L2CAP_CHNL_PRIORITY_MEDIUM
756 #endif
757
758 /* Used for features using fixed channels; set to zero if no fixed channels supported (BLE, etc.) */
759 /* Excluding L2CAP signaling channel and UCD */
760 #ifndef L2CAP_NUM_FIXED_CHNLS
761 #define L2CAP_NUM_FIXED_CHNLS               4
762 #endif
763
764 /* First fixed channel supported */
765 #ifndef L2CAP_FIRST_FIXED_CHNL
766 #define L2CAP_FIRST_FIXED_CHNL              3
767 #endif
768
769 #ifndef L2CAP_LAST_FIXED_CHNL
770 #define L2CAP_LAST_FIXED_CHNL           (L2CAP_FIRST_FIXED_CHNL + L2CAP_NUM_FIXED_CHNLS - 1)
771 #endif
772
773 /* Round Robin service channels in link */
774 #ifndef L2CAP_ROUND_ROBIN_CHANNEL_SERVICE
775 #define L2CAP_ROUND_ROBIN_CHANNEL_SERVICE   TRUE
776 #endif
777
778 /* Used for calculating transmit buffers off of */
779 #ifndef L2CAP_NUM_XMIT_BUFFS
780 #define L2CAP_NUM_XMIT_BUFFS                HCI_ACL_BUF_MAX
781 #endif
782
783 /* used for monitoring eL2CAP data flow */
784 #ifndef L2CAP_ERTM_STATS
785 #define L2CAP_ERTM_STATS                    FALSE
786 #endif
787
788 /* Used for conformance testing ONLY:  When TRUE lets scriptwrapper overwrite info response */
789 #ifndef L2CAP_CONFORMANCE_TESTING
790 #define L2CAP_CONFORMANCE_TESTING           FALSE
791 #endif
792
793 #ifndef TIMER_PARAM_TYPE
794 #define TIMER_PARAM_TYPE    UINT32
795 #endif
796
797 /******************************************************************************
798 **
799 ** BLE
800 **
801 ******************************************************************************/
802
803 #ifndef BLE_INCLUDED
804 #define BLE_INCLUDED            TRUE
805 #endif
806
807 #ifndef BLE_ANDROID_CONTROLLER_SCAN_FILTER
808 #define BLE_ANDROID_CONTROLLER_SCAN_FILTER            TRUE
809 #endif
810
811 #ifndef LOCAL_BLE_CONTROLLER_ID
812 #define LOCAL_BLE_CONTROLLER_ID         (1)
813 #endif
814
815 /*
816  * Toggles support for general LE privacy features such as remote address
817  * resolution, local address rotation etc.
818  */
819 #ifndef BLE_PRIVACY_SPT
820 #define BLE_PRIVACY_SPT         TRUE
821 #endif
822
823 /*
824  * Enables or disables support for local privacy (ex. address rotation)
825  */
826 #ifndef BLE_LOCAL_PRIVACY_ENABLED
827 #define BLE_LOCAL_PRIVACY_ENABLED         TRUE
828 #endif
829
830 /*
831  * Toggles support for vendor specific extensions such as RPA offloading,
832  * feature discovery, multi-adv etc.
833  */
834 #ifndef BLE_VND_INCLUDED
835 #define BLE_VND_INCLUDED        FALSE
836 #endif
837
838 #ifndef BTM_BLE_ADV_TX_POWER
839 #define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}
840 #endif
841
842
843 #ifndef BLE_BATCH_SCAN_INCLUDED
844 #define BLE_BATCH_SCAN_INCLUDED  TRUE
845 #endif
846
847 /******************************************************************************
848 **
849 ** ATT/GATT Protocol/Profile Settings
850 **
851 ******************************************************************************/
852 #ifndef BTA_GATT_INCLUDED
853 #if BLE_INCLUDED == TRUE
854 #define BTA_GATT_INCLUDED TRUE
855 #else
856 #define BTA_GATT_INCLUDED FALSE
857 #endif
858 #endif
859
860 #if BTA_GATT_INCLUDED == TRUE && BLE_INCLUDED == FALSE
861 #error "can't have GATT without BLE"
862 #endif
863
864 #ifndef BLE_LLT_INCLUDED
865 #define BLE_LLT_INCLUDED    TRUE
866 #endif
867
868 #ifndef ATT_INCLUDED
869 #define ATT_INCLUDED         TRUE
870 #endif
871
872 #ifndef ATT_DEBUG
873 #define ATT_DEBUG           TRUE
874 #endif
875
876 #ifndef BLE_PERIPHERAL_MODE_SUPPORT
877 #define BLE_PERIPHERAL_MODE_SUPPORT  TRUE
878 #endif
879
880 #ifndef BLE_PERIPHERAL_ADV_NAME
881 #define BLE_PERIPHERAL_ADV_NAME      FALSE
882 #endif
883
884 #ifndef BLE_DELAY_REQUEST_ENC
885 /* This flag is to work around IPHONE problem, We need to wait for iPhone ready
886    before send encryption request to iPhone */
887 #define BLE_DELAY_REQUEST_ENC        FALSE
888 #endif
889
890 #ifndef GAP_TRANSPORT_SUPPORTED
891 #define GAP_TRANSPORT_SUPPORTED      GATT_TRANSPORT_LE_BR_EDR
892 #endif
893
894 #ifndef GATTP_TRANSPORT_SUPPORTED
895 #define GATTP_TRANSPORT_SUPPORTED    GATT_TRANSPORT_LE_BR_EDR
896 #endif
897
898 #ifndef GATT_MAX_SR_PROFILES
899 #define GATT_MAX_SR_PROFILES        32 /* max is 32 */
900 #endif
901
902 #ifndef GATT_MAX_APPS
903 #define GATT_MAX_APPS            32 /* note: 2 apps used internally GATT and GAP */
904 #endif
905
906 #ifndef GATT_MAX_PHY_CHANNEL
907 #define GATT_MAX_PHY_CHANNEL        7
908 #endif
909
910 /* Used for conformance testing ONLY */
911 #ifndef GATT_CONFORMANCE_TESTING
912 #define GATT_CONFORMANCE_TESTING           FALSE
913 #endif
914
915 /* number of background connection device allowence, ideally to be the same as WL size
916 */
917 #ifndef GATT_MAX_BG_CONN_DEV
918 #define GATT_MAX_BG_CONN_DEV        32
919 #endif
920
921 /******************************************************************************
922 **
923 ** SMP
924 **
925 ******************************************************************************/
926 #ifndef SMP_INCLUDED
927 #if BLE_INCLUDED == TRUE
928 #define SMP_INCLUDED         TRUE
929 #else
930 #define SMP_INCLUDED         FALSE
931 #endif
932 #endif
933
934 #if SMP_INCLUDED == TRUE && BLE_INCLUDED == FALSE
935 #error "can't have SMP without BLE"
936 #endif
937
938 #ifndef SMP_DEBUG
939 #define SMP_DEBUG            FALSE
940 #endif
941
942 #ifndef SMP_DEFAULT_AUTH_REQ
943 #define SMP_DEFAULT_AUTH_REQ    SMP_AUTH_NB_ENC_ONLY
944 #endif
945
946 #ifndef SMP_MAX_ENC_KEY_SIZE
947 #define SMP_MAX_ENC_KEY_SIZE    16
948 #endif
949
950 #ifndef SMP_MIN_ENC_KEY_SIZE
951 #define SMP_MIN_ENC_KEY_SIZE    7
952 #endif
953
954 /* Used for conformance testing ONLY */
955 #ifndef SMP_CONFORMANCE_TESTING
956 #define SMP_CONFORMANCE_TESTING           FALSE
957 #endif
958
959 /******************************************************************************
960 **
961 ** SDP
962 **
963 ******************************************************************************/
964
965 /* This is set to enable SDP server functionality. */
966 #ifndef SDP_SERVER_ENABLED
967 #define SDP_SERVER_ENABLED          TRUE
968 #endif
969
970 /* The maximum number of SDP records the server can support. */
971 #ifndef SDP_MAX_RECORDS
972 #define SDP_MAX_RECORDS             20
973 #endif
974
975 /* The maximum number of attributes in each record. */
976 #ifndef SDP_MAX_REC_ATTR
977 #define SDP_MAX_REC_ATTR            25
978 #endif
979
980 #ifndef SDP_MAX_PAD_LEN
981 #define SDP_MAX_PAD_LEN             600
982 #endif
983
984 /* The maximum length, in bytes, of an attribute. */
985 #ifndef SDP_MAX_ATTR_LEN
986 #define SDP_MAX_ATTR_LEN            400
987 #endif
988
989 /* The maximum number of attribute filters supported by SDP databases. */
990 #ifndef SDP_MAX_ATTR_FILTERS
991 #define SDP_MAX_ATTR_FILTERS        15
992 #endif
993
994 /* The maximum number of UUID filters supported by SDP databases. */
995 #ifndef SDP_MAX_UUID_FILTERS
996 #define SDP_MAX_UUID_FILTERS        3
997 #endif
998
999 /* This is set to enable SDP client functionality. */
1000 #ifndef SDP_CLIENT_ENABLED
1001 #define SDP_CLIENT_ENABLED          TRUE
1002 #endif
1003
1004 /* The maximum number of record handles retrieved in a search. */
1005 #ifndef SDP_MAX_DISC_SERVER_RECS
1006 #define SDP_MAX_DISC_SERVER_RECS    21
1007 #endif
1008
1009 /* The size of a scratchpad buffer, in bytes, for storing the response to an attribute request. */
1010 #ifndef SDP_MAX_LIST_BYTE_COUNT
1011 #define SDP_MAX_LIST_BYTE_COUNT     4096
1012 #endif
1013
1014 /* The maximum number of parameters in an SDP protocol element. */
1015 #ifndef SDP_MAX_PROTOCOL_PARAMS
1016 #define SDP_MAX_PROTOCOL_PARAMS     2
1017 #endif
1018
1019 /* The maximum number of simultaneous client and server connections. */
1020 #ifndef SDP_MAX_CONNECTIONS
1021 #define SDP_MAX_CONNECTIONS         4
1022 #endif
1023
1024 /* The MTU size for the L2CAP configuration. */
1025 #ifndef SDP_MTU_SIZE
1026 #define SDP_MTU_SIZE                672
1027 #endif
1028
1029 /* The flush timeout for the L2CAP configuration. */
1030 #ifndef SDP_FLUSH_TO
1031 #define SDP_FLUSH_TO                0xFFFF
1032 #endif
1033
1034 /* The name for security authorization. */
1035 #ifndef SDP_SERVICE_NAME
1036 #define SDP_SERVICE_NAME            "Service Discovery"
1037 #endif
1038
1039 /* The security level for BTM. */
1040 #ifndef SDP_SECURITY_LEVEL
1041 #define SDP_SECURITY_LEVEL          BTM_SEC_NONE
1042 #endif
1043
1044 /******************************************************************************
1045 **
1046 ** RFCOMM
1047 **
1048 ******************************************************************************/
1049
1050 #ifndef RFCOMM_INCLUDED
1051 #define RFCOMM_INCLUDED             TRUE
1052 #endif
1053
1054 /* The maximum number of ports supported. */
1055 #ifndef MAX_RFC_PORTS
1056 #define MAX_RFC_PORTS               30
1057 #endif
1058
1059 /* The maximum simultaneous links to different devices. */
1060 #ifndef MAX_ACL_CONNECTIONS
1061 #define MAX_BD_CONNECTIONS          7
1062 #else
1063 #define MAX_BD_CONNECTIONS          MAX_ACL_CONNECTIONS
1064 #endif
1065
1066 /* The port receive queue low watermark level, in bytes. */
1067 #ifndef PORT_RX_LOW_WM
1068 #define PORT_RX_LOW_WM              (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
1069 #endif
1070
1071 /* The port receive queue high watermark level, in bytes. */
1072 #ifndef PORT_RX_HIGH_WM
1073 #define PORT_RX_HIGH_WM             (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
1074 #endif
1075
1076 /* The port receive queue critical watermark level, in bytes. */
1077 #ifndef PORT_RX_CRITICAL_WM
1078 #define PORT_RX_CRITICAL_WM         (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
1079 #endif
1080
1081 /* The port receive queue low watermark level, in number of buffers. */
1082 #ifndef PORT_RX_BUF_LOW_WM
1083 #define PORT_RX_BUF_LOW_WM          4
1084 #endif
1085
1086 /* The port receive queue high watermark level, in number of buffers. */
1087 #ifndef PORT_RX_BUF_HIGH_WM
1088 #define PORT_RX_BUF_HIGH_WM         10
1089 #endif
1090
1091 /* The port receive queue critical watermark level, in number of buffers. */
1092 #ifndef PORT_RX_BUF_CRITICAL_WM
1093 #define PORT_RX_BUF_CRITICAL_WM     15
1094 #endif
1095
1096 /* The port transmit queue high watermark level, in bytes. */
1097 #ifndef PORT_TX_HIGH_WM
1098 #define PORT_TX_HIGH_WM             (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
1099 #endif
1100
1101 /* The port transmit queue critical watermark level, in bytes. */
1102 #ifndef PORT_TX_CRITICAL_WM
1103 #define PORT_TX_CRITICAL_WM         (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
1104 #endif
1105
1106 /* The port transmit queue high watermark level, in number of buffers. */
1107 #ifndef PORT_TX_BUF_HIGH_WM
1108 #define PORT_TX_BUF_HIGH_WM         10
1109 #endif
1110
1111 /* The port transmit queue high watermark level, in number of buffers. */
1112 #ifndef PORT_TX_BUF_CRITICAL_WM
1113 #define PORT_TX_BUF_CRITICAL_WM     15
1114 #endif
1115
1116 /* The RFCOMM multiplexer preferred flow control mechanism. */
1117 #ifndef PORT_FC_DEFAULT
1118 #define PORT_FC_DEFAULT             PORT_FC_CREDIT
1119 #endif
1120
1121 /* The maximum number of credits receiver sends to peer when using credit-based flow control. */
1122 #ifndef PORT_CREDIT_RX_MAX
1123 #define PORT_CREDIT_RX_MAX          16
1124 #endif
1125
1126 /* The credit low watermark level. */
1127 #ifndef PORT_CREDIT_RX_LOW
1128 #define PORT_CREDIT_RX_LOW          8
1129 #endif
1130
1131 /* if application like BTA, Java or script test engine is running on other than BTU thread, */
1132 /* PORT_SCHEDULE_LOCK shall be defined as GKI_sched_lock() or GKI_disable() */
1133 #ifndef PORT_SCHEDULE_LOCK
1134 #define PORT_SCHEDULE_LOCK          GKI_disable()
1135 #endif
1136
1137 /* if application like BTA, Java or script test engine is running on other than BTU thread, */
1138 /* PORT_SCHEDULE_LOCK shall be defined as GKI_sched_unlock() or GKI_enable() */
1139 #ifndef PORT_SCHEDULE_UNLOCK
1140 #define PORT_SCHEDULE_UNLOCK        GKI_enable()
1141 #endif
1142
1143 /******************************************************************************
1144 **
1145 ** BNEP
1146 **
1147 ******************************************************************************/
1148
1149 #ifndef BNEP_INCLUDED
1150 #define BNEP_INCLUDED               TRUE
1151 #endif
1152
1153 /* Protocol filtering is an optional feature. Bydefault it will be turned on */
1154 #ifndef BNEP_SUPPORTS_PROT_FILTERS
1155 #define BNEP_SUPPORTS_PROT_FILTERS          TRUE
1156 #endif
1157
1158 /* Multicast filtering is an optional feature. Bydefault it will be turned on */
1159 #ifndef BNEP_SUPPORTS_MULTI_FILTERS
1160 #define BNEP_SUPPORTS_MULTI_FILTERS         TRUE
1161 #endif
1162
1163 /* BNEP status API call is used mainly to get the L2CAP handle */
1164 #ifndef BNEP_SUPPORTS_STATUS_API
1165 #define BNEP_SUPPORTS_STATUS_API            TRUE
1166 #endif
1167
1168 /* This is just a debug function */
1169 #ifndef BNEP_SUPPORTS_DEBUG_DUMP
1170 #define BNEP_SUPPORTS_DEBUG_DUMP            TRUE
1171 #endif
1172
1173 #ifndef BNEP_SUPPORTS_ALL_UUID_LENGTHS
1174 #define BNEP_SUPPORTS_ALL_UUID_LENGTHS      TRUE    /* Otherwise it will support only 16bit UUIDs */
1175 #endif
1176
1177 /*
1178 ** When BNEP connection changes roles after the connection is established
1179 ** we will do an authentication check again on the new role
1180 */
1181 #ifndef BNEP_DO_AUTH_FOR_ROLE_SWITCH
1182 #define BNEP_DO_AUTH_FOR_ROLE_SWITCH        TRUE
1183 #endif
1184
1185
1186 /* Maximum number of protocol filters supported. */
1187 #ifndef BNEP_MAX_PROT_FILTERS
1188 #define BNEP_MAX_PROT_FILTERS       5
1189 #endif
1190
1191 /* Maximum number of multicast filters supported. */
1192 #ifndef BNEP_MAX_MULTI_FILTERS
1193 #define BNEP_MAX_MULTI_FILTERS      5
1194 #endif
1195
1196 /* Minimum MTU size. */
1197 #ifndef BNEP_MIN_MTU_SIZE
1198 #define BNEP_MIN_MTU_SIZE           L2CAP_MTU_SIZE
1199 #endif
1200
1201 /* Preferred MTU size. */
1202 #ifndef BNEP_MTU_SIZE
1203 #define BNEP_MTU_SIZE               BNEP_MIN_MTU_SIZE
1204 #endif
1205
1206 /* Maximum number of buffers allowed in transmit data queue. */
1207 #ifndef BNEP_MAX_XMITQ_DEPTH
1208 #define BNEP_MAX_XMITQ_DEPTH        20
1209 #endif
1210
1211 /* Maximum number BNEP of connections supported. */
1212 #ifndef BNEP_MAX_CONNECTIONS
1213 #define BNEP_MAX_CONNECTIONS        7
1214 #endif
1215
1216
1217 /******************************************************************************
1218 **
1219 ** AVDTP
1220 **
1221 ******************************************************************************/
1222
1223 #ifndef AVDT_INCLUDED
1224 #define AVDT_INCLUDED               TRUE
1225 #endif
1226
1227 /* Include reporting capability in AVDTP */
1228 #ifndef AVDT_REPORTING
1229 #define AVDT_REPORTING              TRUE
1230 #endif
1231
1232 /* Include multiplexing capability in AVDTP */
1233 #ifndef AVDT_MULTIPLEXING
1234 #define AVDT_MULTIPLEXING           TRUE
1235 #endif
1236
1237 /* Number of simultaneous links to different peer devices. */
1238 #ifndef AVDT_NUM_LINKS
1239 #define AVDT_NUM_LINKS              2
1240 #endif
1241
1242 /* Number of simultaneous stream endpoints. */
1243 #ifndef AVDT_NUM_SEPS
1244 #define AVDT_NUM_SEPS               3
1245 #endif
1246
1247 /* Number of transport channels setup per media stream(audio or video) */
1248 #ifndef AVDT_NUM_CHANNELS
1249
1250 #if AVDT_REPORTING == TRUE
1251 /* signaling, media and reporting channels */
1252 #define AVDT_NUM_CHANNELS   3
1253 #else
1254 /* signaling and media channels */
1255 #define AVDT_NUM_CHANNELS   2
1256 #endif  // AVDT_REPORTING
1257
1258 #endif  // AVDT_NUM_CHANNELS
1259
1260 /* Number of transport channels setup by AVDT for all media streams
1261  * AVDT_NUM_CHANNELS * Number of simultaneous streams.
1262  */
1263 #ifndef AVDT_NUM_TC_TBL
1264 #define AVDT_NUM_TC_TBL             6
1265 #endif
1266
1267 /* Maximum size in bytes of the codec capabilities information element. */
1268 #ifndef AVDT_CODEC_SIZE
1269 #define AVDT_CODEC_SIZE             10
1270 #endif
1271
1272 /* Maximum size in bytes of the content protection information element. */
1273 #ifndef AVDT_PROTECT_SIZE
1274 #define AVDT_PROTECT_SIZE           90
1275 #endif
1276
1277 /* Maximum number of GKI buffers in the fragment queue (for video frames).
1278  * Must be less than the number of buffers in the buffer pool of size AVDT_DATA_POOL_SIZE */
1279 #ifndef AVDT_MAX_FRAG_COUNT
1280 #define AVDT_MAX_FRAG_COUNT         15
1281 #endif
1282
1283 /******************************************************************************
1284 **
1285 ** PAN
1286 **
1287 ******************************************************************************/
1288
1289 #ifndef PAN_INCLUDED
1290 #define PAN_INCLUDED                     TRUE
1291 #endif
1292
1293 /* This will enable the PANU role */
1294 #ifndef PAN_SUPPORTS_ROLE_PANU
1295 #define PAN_SUPPORTS_ROLE_PANU              TRUE
1296 #endif
1297
1298 /* This will enable the GN role */
1299 #ifndef PAN_SUPPORTS_ROLE_GN
1300 #define PAN_SUPPORTS_ROLE_GN                TRUE
1301 #endif
1302
1303 /* This will enable the NAP role */
1304 #ifndef PAN_SUPPORTS_ROLE_NAP
1305 #define PAN_SUPPORTS_ROLE_NAP               TRUE
1306 #endif
1307
1308 /* This is just for debugging purposes */
1309 #ifndef PAN_SUPPORTS_DEBUG_DUMP
1310 #define PAN_SUPPORTS_DEBUG_DUMP             TRUE
1311 #endif
1312
1313 /* Maximum number of PAN connections allowed */
1314 #ifndef MAX_PAN_CONNS
1315 #define MAX_PAN_CONNS                    7
1316 #endif
1317
1318 /* Default service name for NAP role */
1319 #ifndef PAN_NAP_DEFAULT_SERVICE_NAME
1320 #define PAN_NAP_DEFAULT_SERVICE_NAME    "Network Access Point Service"
1321 #endif
1322
1323 /* Default service name for GN role */
1324 #ifndef PAN_GN_DEFAULT_SERVICE_NAME
1325 #define PAN_GN_DEFAULT_SERVICE_NAME     "Group Network Service"
1326 #endif
1327
1328 /* Default service name for PANU role */
1329 #ifndef PAN_PANU_DEFAULT_SERVICE_NAME
1330 #define PAN_PANU_DEFAULT_SERVICE_NAME   "PAN User Service"
1331 #endif
1332
1333 /* Default description for NAP role service */
1334 #ifndef PAN_NAP_DEFAULT_DESCRIPTION
1335 #define PAN_NAP_DEFAULT_DESCRIPTION     "NAP"
1336 #endif
1337
1338 /* Default description for GN role service */
1339 #ifndef PAN_GN_DEFAULT_DESCRIPTION
1340 #define PAN_GN_DEFAULT_DESCRIPTION      "GN"
1341 #endif
1342
1343 /* Default description for PANU role service */
1344 #ifndef PAN_PANU_DEFAULT_DESCRIPTION
1345 #define PAN_PANU_DEFAULT_DESCRIPTION    "PANU"
1346 #endif
1347
1348 /* Default Security level for PANU role. */
1349 #ifndef PAN_PANU_SECURITY_LEVEL
1350 #define PAN_PANU_SECURITY_LEVEL          0
1351 #endif
1352
1353 /* Default Security level for GN role. */
1354 #ifndef PAN_GN_SECURITY_LEVEL
1355 #define PAN_GN_SECURITY_LEVEL            0
1356 #endif
1357
1358 /* Default Security level for NAP role. */
1359 #ifndef PAN_NAP_SECURITY_LEVEL
1360 #define PAN_NAP_SECURITY_LEVEL           0
1361 #endif
1362
1363 /******************************************************************************
1364 **
1365 ** GAP
1366 **
1367 ******************************************************************************/
1368
1369 #ifndef GAP_INCLUDED
1370 #define GAP_INCLUDED                TRUE
1371 #endif
1372
1373 /* keep the raw data received from SDP server in database. */
1374 #ifndef SDP_RAW_DATA_INCLUDED
1375 #define SDP_RAW_DATA_INCLUDED       TRUE
1376 #endif
1377
1378 /* Inquiry duration in 1.28 second units. */
1379 #ifndef SDP_DEBUG
1380 #define SDP_DEBUG                   TRUE
1381 #endif
1382
1383 /******************************************************************************
1384 **
1385 ** HID
1386 **
1387 ******************************************************************************/
1388
1389 #ifndef HID_DEV_PM_INCLUDED
1390 #define HID_DEV_PM_INCLUDED         TRUE
1391 #endif
1392
1393 #ifndef HID_DEV_SUBCLASS
1394 #define HID_DEV_SUBCLASS            COD_MINOR_POINTING
1395 #endif
1396
1397 #ifndef HID_CONTROL_POOL_ID
1398 #define HID_CONTROL_POOL_ID             2
1399 #endif
1400
1401 #ifndef HID_INTERRUPT_POOL_ID
1402 #define HID_INTERRUPT_POOL_ID           2
1403 #endif
1404
1405 /*************************************************************************
1406 ** Definitions for Both HID-Host & Device
1407 */
1408 #ifndef HID_MAX_SVC_NAME_LEN
1409 #define HID_MAX_SVC_NAME_LEN  32
1410 #endif
1411
1412 #ifndef HID_MAX_SVC_DESCR_LEN
1413 #define HID_MAX_SVC_DESCR_LEN 32
1414 #endif
1415
1416 #ifndef HID_MAX_PROV_NAME_LEN
1417 #define HID_MAX_PROV_NAME_LEN 32
1418 #endif
1419
1420 /*************************************************************************
1421 ** Definitions for HID-Host
1422 */
1423 #ifndef  HID_HOST_INCLUDED
1424 #define HID_HOST_INCLUDED           TRUE
1425 #endif
1426
1427 #ifndef HID_HOST_MAX_DEVICES
1428 #define HID_HOST_MAX_DEVICES        7
1429 #endif
1430
1431 #ifndef HID_HOST_MTU
1432 #define HID_HOST_MTU                640
1433 #endif
1434
1435 #ifndef HID_HOST_FLUSH_TO
1436 #define HID_HOST_FLUSH_TO                 0xffff
1437 #endif
1438
1439 #ifndef HID_HOST_MAX_CONN_RETRY
1440 #define HID_HOST_MAX_CONN_RETRY     (3)
1441 #endif
1442
1443 #ifndef HID_HOST_REPAGE_WIN
1444 #define HID_HOST_REPAGE_WIN          (2)
1445 #endif
1446
1447 /******************************************************************************
1448 **
1449 ** PAN
1450 **
1451 ******************************************************************************/
1452
1453 #ifndef PAN_INCLUDED
1454 #define PAN_INCLUDED                FALSE
1455 #endif
1456
1457 /*************************************************************************
1458  * A2DP Definitions
1459  */
1460 #ifndef A2D_INCLUDED
1461 #define A2D_INCLUDED            TRUE
1462 #endif
1463
1464 /* TRUE to include SBC utility functions */
1465 #ifndef A2D_SBC_INCLUDED
1466 #define A2D_SBC_INCLUDED        A2D_INCLUDED
1467 #endif
1468
1469 /******************************************************************************
1470 **
1471 ** AVCTP
1472 **
1473 ******************************************************************************/
1474
1475 #ifndef AVCT_INCLUDED
1476 #define AVCT_INCLUDED               TRUE
1477 #endif
1478
1479 /* Number of simultaneous ACL links to different peer devices. */
1480 #ifndef AVCT_NUM_LINKS
1481 #define AVCT_NUM_LINKS              2
1482 #endif
1483
1484 /* Number of simultaneous AVCTP connections. */
1485 #ifndef AVCT_NUM_CONN
1486 #define AVCT_NUM_CONN               3
1487 #endif
1488
1489 /******************************************************************************
1490 **
1491 ** AVRCP
1492 **
1493 ******************************************************************************/
1494
1495 #ifndef AVRC_INCLUDED
1496 #define AVRC_INCLUDED               TRUE
1497 #endif
1498
1499 #ifndef AVRC_METADATA_INCLUDED
1500 #define AVRC_METADATA_INCLUDED      TRUE
1501 #endif
1502
1503 #ifndef AVRC_ADV_CTRL_INCLUDED
1504 #define AVRC_ADV_CTRL_INCLUDED      TRUE
1505 #endif
1506
1507 #ifndef AVRC_CTLR_INCLUDED
1508 #define AVRC_CTLR_INCLUDED          TRUE
1509 #endif
1510
1511 /******************************************************************************
1512 **
1513 ** MCAP
1514 **
1515 ******************************************************************************/
1516 #ifndef MCA_INCLUDED
1517 #define MCA_INCLUDED                FALSE
1518 #endif
1519
1520 /* The MTU size for the L2CAP configuration on control channel. 48 is the minimal */
1521 #ifndef MCA_CTRL_MTU
1522 #define MCA_CTRL_MTU    60
1523 #endif
1524
1525 /* The maximum number of registered MCAP instances. */
1526 #ifndef MCA_NUM_REGS
1527 #define MCA_NUM_REGS    12
1528 #endif
1529
1530 /* The maximum number of control channels (to difference devices) per registered MCAP instances. */
1531 #ifndef MCA_NUM_LINKS
1532 #define MCA_NUM_LINKS   3
1533 #endif
1534
1535 /* The maximum number of MDEP (including HDP echo) per registered MCAP instances. */
1536 #ifndef MCA_NUM_DEPS
1537 #define MCA_NUM_DEPS    13
1538 #endif
1539
1540 /* The maximum number of MDL link per control channel. */
1541 #ifndef MCA_NUM_MDLS
1542 #define MCA_NUM_MDLS    4
1543 #endif
1544
1545 /* Pool ID where to reassemble the SDU. */
1546 #ifndef MCA_USER_RX_POOL_ID
1547 #define MCA_USER_RX_POOL_ID     HCI_ACL_POOL_ID
1548 #endif
1549
1550 /* Pool ID where to hold the SDU. */
1551 #ifndef MCA_USER_TX_POOL_ID
1552 #define MCA_USER_TX_POOL_ID     HCI_ACL_POOL_ID
1553 #endif
1554
1555 /*
1556 GKI Buffer Pool ID used to hold MPS segments during SDU reassembly
1557 */
1558 #ifndef MCA_FCR_RX_POOL_ID
1559 #define MCA_FCR_RX_POOL_ID      HCI_ACL_POOL_ID
1560 #endif
1561
1562 /*
1563 GKI Buffer Pool ID used to hold MPS segments used in (re)transmissions.
1564 L2CAP_DEFAULT_ERM_POOL_ID is specified to use the HCI ACL data pool.
1565 Note:  This pool needs to have enough buffers to hold two times the window size negotiated
1566  in the tL2CAP_FCR_OPTIONS (2 * tx_win_size)  to allow for retransmissions.
1567  The size of each buffer must be able to hold the maximum MPS segment size passed in
1568  tL2CAP_FCR_OPTIONS plus BT_HDR (8) + HCI preamble (4) + L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
1569 */
1570 #ifndef MCA_FCR_TX_POOL_ID
1571 #define MCA_FCR_TX_POOL_ID      HCI_ACL_POOL_ID
1572 #endif
1573
1574 /* MCAP control channel FCR Option:
1575 Size of the transmission window when using enhanced retransmission mode.
1576 1 is defined by HDP specification for control channel.
1577 */
1578 #ifndef MCA_FCR_OPT_TX_WINDOW_SIZE
1579 #define MCA_FCR_OPT_TX_WINDOW_SIZE      1
1580 #endif
1581
1582 /* MCAP control channel FCR Option:
1583 Number of transmission attempts for a single I-Frame before taking
1584 Down the connection. Used In ERTM mode only. Value is Ignored in basic and
1585 Streaming modes.
1586 Range: 0, 1-0xFF
1587 0 - infinite retransmissions
1588 1 - single transmission
1589 */
1590 #ifndef MCA_FCR_OPT_MAX_TX_B4_DISCNT
1591 #define MCA_FCR_OPT_MAX_TX_B4_DISCNT    20
1592 #endif
1593
1594 /* MCAP control channel FCR Option: Retransmission Timeout
1595 The AVRCP specification set a value in the range of 300 - 2000 ms
1596 Timeout (in msecs) to detect Lost I-Frames. Only used in Enhanced retransmission mode.
1597 Range: Minimum 2000 (2 secs) when supporting PBF.
1598  */
1599 #ifndef MCA_FCR_OPT_RETX_TOUT
1600 #define MCA_FCR_OPT_RETX_TOUT           2000
1601 #endif
1602
1603 /* MCAP control channel FCR Option: Monitor Timeout
1604 The AVRCP specification set a value in the range of 300 - 2000 ms
1605 Timeout (in msecs) to detect Lost S-Frames. Only used in Enhanced retransmission mode.
1606 Range: Minimum 12000 (12 secs) when supporting PBF.
1607 */
1608 #ifndef MCA_FCR_OPT_MONITOR_TOUT
1609 #define MCA_FCR_OPT_MONITOR_TOUT        12000
1610 #endif
1611
1612 /* MCAP control channel FCR Option: Maximum PDU payload size.
1613 The maximum number of payload octets that the local device can receive in a single PDU.
1614 */
1615 #ifndef MCA_FCR_OPT_MPS_SIZE
1616 #define MCA_FCR_OPT_MPS_SIZE            1000
1617 #endif
1618
1619 /* Shared transport */
1620 #ifndef NFC_SHARED_TRANSPORT_ENABLED
1621 #define NFC_SHARED_TRANSPORT_ENABLED    FALSE
1622 #endif
1623
1624 /******************************************************************************
1625 **
1626 ** SER
1627 **
1628 ******************************************************************************/
1629
1630 #ifndef SER_INCLUDED
1631 #define SER_INCLUDED                FALSE
1632 #endif
1633
1634 /* Mailbox used by serial application. */
1635 #ifndef SER_MBOX
1636 #define SER_MBOX                    TASK_MBOX_1
1637 #endif
1638
1639 /******************************************************************************
1640 **
1641 ** Sleep Mode (Low Power Mode)
1642 **
1643 ******************************************************************************/
1644
1645 #ifndef HCILP_INCLUDED
1646 #define HCILP_INCLUDED                  TRUE
1647 #endif
1648
1649 /******************************************************************************
1650 **
1651 ** SAP - Sample applications
1652 **
1653 ******************************************************************************/
1654
1655 #ifndef MMI_INCLUDED
1656 #define MMI_INCLUDED                FALSE
1657 #endif
1658
1659 /******************************************************************************
1660 **
1661 ** APPL - Application Task
1662 **
1663 ******************************************************************************/
1664 /* When TRUE indicates that an application task is to be run */
1665 #ifndef APPL_INCLUDED
1666 #define APPL_INCLUDED                TRUE
1667 #endif
1668
1669 #define L2CAP_FEATURE_REQ_ID      73
1670 #define L2CAP_FEATURE_RSP_ID     173
1671
1672 /******************************************************************************
1673 **
1674 ** BTA
1675 **
1676 ******************************************************************************/
1677 /* BTA EIR canned UUID list (default is dynamic) */
1678 #ifndef BTA_EIR_CANNED_UUID_LIST
1679 #define BTA_EIR_CANNED_UUID_LIST FALSE
1680 #endif
1681
1682 /* Number of supported customer UUID in EIR */
1683 #ifndef BTA_EIR_SERVER_NUM_CUSTOM_UUID
1684 #define BTA_EIR_SERVER_NUM_CUSTOM_UUID     8
1685 #endif
1686
1687 /* CHLD override for bluedroid */
1688 #ifndef BTA_AG_CHLD_VAL_ECC
1689 #define BTA_AG_CHLD_VAL_ECC  "(0,1,1x,2,2x,3)"
1690 #endif
1691
1692 #ifndef BTA_AG_CHLD_VAL
1693 #define BTA_AG_CHLD_VAL  "(0,1,2,3)"
1694 #endif
1695
1696 /* Set the CIND to match HFP 1.5 */
1697 #ifndef BTA_AG_CIND_INFO
1698 #define BTA_AG_CIND_INFO "(\"call\",(0,1)),(\"callsetup\",(0-3)),(\"service\",(0-1)),(\"signal\",(0-5)),(\"roam\",(0,1)),(\"battchg\",(0-5)),(\"callheld\",(0-2))"
1699 #endif
1700
1701 #ifndef BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY
1702 #define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY TRUE
1703 #endif
1704
1705 /******************************************************************************
1706 **
1707 ** Tracing:  Include trace header file here.
1708 **
1709 ******************************************************************************/
1710
1711 #include "bt_trace.h"
1712
1713 #endif /* BT_TARGET_H */