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