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