OSDN Git Service

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