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