OSDN Git Service

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