OSDN Git Service

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