• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "bt_types.h" /* This must be defined AFTER buildcfg.h */
28 
29 #ifndef FALSE
30 #define FALSE false
31 #endif
32 
33 #ifndef TRUE
34 #define TRUE true
35 #endif
36 
37 //------------------Added from bdroid_buildcfg.h---------------------
38 #ifndef L2CAP_EXTFEA_SUPPORTED_MASK
39 #define L2CAP_EXTFEA_SUPPORTED_MASK                                            \
40   (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | \
41    L2CAP_EXTFEA_FIXED_CHNLS)
42 #endif
43 
44 #ifndef BTUI_OPS_FORMATS
45 #define BTUI_OPS_FORMATS (BTA_OP_VCARD21_MASK | BTA_OP_ANY_MASK)
46 #endif
47 
48 #ifndef BTA_RFC_MTU_SIZE
49 #define BTA_RFC_MTU_SIZE \
50   (L2CAP_MTU_SIZE - L2CAP_MIN_OFFSET - RFCOMM_DATA_OVERHEAD)
51 #endif
52 
53 #ifndef BTA_PAN_INCLUDED
54 #define BTA_PAN_INCLUDED TRUE
55 #endif
56 
57 #ifndef BTA_HD_INCLUDED
58 #define BTA_HD_INCLUDED TRUE
59 #endif
60 
61 #ifndef BTA_HH_INCLUDED
62 #define BTA_HH_INCLUDED TRUE
63 #endif
64 
65 #ifndef BTA_HH_ROLE
66 #define BTA_HH_ROLE BTA_CENTRAL_ROLE_PREF
67 #endif
68 
69 #ifndef AVDT_VERSION
70 #define AVDT_VERSION 0x0103
71 #endif
72 
73 #ifndef BTA_AG_AT_MAX_LEN
74 #define BTA_AG_AT_MAX_LEN 512
75 #endif
76 
77 #ifndef BTA_AG_SCO_PKT_TYPES
78 #define BTA_AG_SCO_PKT_TYPES                                     \
79   (BTM_SCO_LINK_ONLY_MASK | ESCO_PKT_TYPES_MASK_EV3 |            \
80    ESCO_PKT_TYPES_MASK_NO_3_EV3 | ESCO_PKT_TYPES_MASK_NO_2_EV5 | \
81    ESCO_PKT_TYPES_MASK_NO_3_EV5)
82 #endif
83 
84 #ifndef BTA_AV_RET_TOUT
85 #define BTA_AV_RET_TOUT 15
86 #endif
87 
88 /* TRUE to use SCMS-T content protection */
89 #ifndef BTA_AV_CO_CP_SCMS_T
90 #define BTA_AV_CO_CP_SCMS_T FALSE
91 #endif
92 
93 #ifndef BTA_DM_SDP_DB_SIZE
94 #define BTA_DM_SDP_DB_SIZE 20000
95 #endif
96 
97 #ifndef HL_INCLUDED
98 #define HL_INCLUDED TRUE
99 #endif
100 
101 #ifndef AG_VOICE_SETTINGS
102 #define AG_VOICE_SETTINGS HCI_DEFAULT_VOICE_SETTINGS
103 #endif
104 
105 #ifndef BTIF_DM_OOB_TEST
106 #define BTIF_DM_OOB_TEST TRUE
107 #endif
108 
109 // How long to wait before activating sniff mode after entering the
110 // idle state for server FT/RFCOMM, OPS connections
111 #ifndef BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS
112 #define BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS 7000
113 #endif
114 
115 // How long to wait before activating sniff mode after entering the
116 // idle state for client FT/RFCOMM connections
117 #ifndef BTA_FTC_IDLE_TO_SNIFF_DELAY_MS
118 #define BTA_FTC_IDLE_TO_SNIFF_DELAY_MS 5000
119 #endif
120 
121 //------------------End added from bdroid_buildcfg.h---------------------
122 
123 /******************************************************************************
124  *
125  * Buffer sizes
126  *
127  *****************************************************************************/
128 
129 #ifndef BT_DEFAULT_BUFFER_SIZE
130 #define BT_DEFAULT_BUFFER_SIZE (4096 + 16)
131 #endif
132 
133 #ifndef BT_SMALL_BUFFER_SIZE
134 #define BT_SMALL_BUFFER_SIZE 660
135 #endif
136 
137 /* Receives HCI events from the lower-layer. */
138 #ifndef HCI_CMD_BUF_SIZE
139 #define HCI_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
140 #endif
141 
142 /* Sends SDP data packets. */
143 #ifndef SDP_DATA_BUF_SIZE
144 #define SDP_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
145 #endif
146 
147 /* Sends RFCOMM command packets. */
148 #ifndef RFCOMM_CMD_BUF_SIZE
149 #define RFCOMM_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
150 #endif
151 
152 /* Sends RFCOMM data packets. */
153 #ifndef RFCOMM_DATA_BUF_SIZE
154 #define RFCOMM_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
155 #endif
156 
157 /* Sends L2CAP packets to the peer and HCI messages to the controller. */
158 #ifndef L2CAP_CMD_BUF_SIZE
159 #define L2CAP_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
160 #endif
161 
162 #ifndef L2CAP_FCR_ERTM_BUF_SIZE
163 #define L2CAP_FCR_ERTM_BUF_SIZE (10240 + 24)
164 #endif
165 
166 /* Number of ACL buffers to assign to LE */
167 /*
168  * TODO: Do we need this?
169  * It was used when the HCI buffers were shared with BR/EDR.
170  */
171 #ifndef L2C_DEF_NUM_BLE_BUF_SHARED
172 #define L2C_DEF_NUM_BLE_BUF_SHARED 1
173 #endif
174 
175 /* Used by BTM when it sends HCI commands to the controller. */
176 #ifndef BTM_CMD_BUF_SIZE
177 #define BTM_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
178 #endif
179 
180 #ifndef OBX_LRG_DATA_BUF_SIZE
181 #define OBX_LRG_DATA_BUF_SIZE (8080 + 26)
182 #endif
183 
184 /* BNEP data and protocol messages. */
185 #ifndef BNEP_BUF_SIZE
186 #define BNEP_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
187 #endif
188 
189 /* AVDTP buffer size for protocol messages */
190 #ifndef AVDT_CMD_BUF_SIZE
191 #define AVDT_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
192 #endif
193 
194 #ifndef PAN_BUF_SIZE
195 #define PAN_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
196 #endif
197 
198 /* Maximum number of buffers to allocate for PAN */
199 #ifndef PAN_BUF_MAX
200 #define PAN_BUF_MAX 100
201 #endif
202 
203 /* AVCTP buffer size for protocol messages */
204 #ifndef AVCT_CMD_BUF_SIZE
205 #define AVCT_CMD_BUF_SIZE 288
206 #endif
207 
208 /* AVRCP buffer size for protocol messages */
209 #ifndef AVRC_CMD_BUF_SIZE
210 #define AVRC_CMD_BUF_SIZE 288
211 #endif
212 
213 /* AVRCP Metadata buffer size for protocol messages */
214 #ifndef AVRC_META_CMD_BUF_SIZE
215 #define AVRC_META_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
216 #endif
217 
218 #ifndef BTA_HL_LRG_DATA_BUF_SIZE
219 #define BTA_HL_LRG_DATA_BUF_SIZE (10240 + 24)
220 #endif
221 
222 /* GATT Data sending buffer size */
223 #ifndef GATT_DATA_BUF_SIZE
224 #define GATT_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
225 #endif
226 
227 /******************************************************************************
228  *
229  * BTM
230  *
231  *****************************************************************************/
232 
233 /* Cancel Inquiry on incoming SSP */
234 #ifndef BTM_NO_SSP_ON_INQUIRY
235 #define BTM_NO_SSP_ON_INQUIRY FALSE
236 #endif
237 
238 #ifndef DISABLE_WBS
239 #define DISABLE_WBS FALSE
240 #endif
241 
242 /*  This is used to work around a controller bug that doesn't like Disconnect
243  *  issued while there is a role switch in progress
244 */
245 #ifndef BTM_DISC_DURING_RS
246 #define BTM_DISC_DURING_RS TRUE
247 #endif
248 
249 /**************************
250  * Initial SCO TX credit
251  ************************/
252 /* The size of buffer used for TX SCO data packets. The size should be divisible
253  * by BTM_MSBC_CODE_SIZE(240) */
254 #ifndef BTM_SCO_DATA_SIZE_MAX
255 #define BTM_SCO_DATA_SIZE_MAX 240
256 #endif
257 
258 /* The size in bytes of the BTM inquiry database. */
259 #ifndef BTM_INQ_DB_SIZE
260 #define BTM_INQ_DB_SIZE 40
261 #endif
262 
263 /* Sets the Page_Scan_Window:  the length of time that the device is performing
264  * a page scan. */
265 #ifndef BTM_DEFAULT_CONN_WINDOW
266 #define BTM_DEFAULT_CONN_WINDOW 0x0012
267 #endif
268 
269 /* Sets the Page_Scan_Activity:  the interval between the start of two
270  * consecutive page scans. */
271 #ifndef BTM_DEFAULT_CONN_INTERVAL
272 #define BTM_DEFAULT_CONN_INTERVAL 0x0400
273 #endif
274 #define BTM_PAGE_SCAN_INTERVAL_PROPERTY "bluetooth.btm.pagescan_interval"
275 
276 /* When automatic inquiry scan is enabled, this sets the inquiry scan window. */
277 #ifndef BTM_DEFAULT_DISC_WINDOW
278 #define BTM_DEFAULT_DISC_WINDOW 0x0012
279 #endif
280 
281 /* When automatic inquiry scan is enabled, this sets the inquiry scan interval.
282  */
283 #ifndef BTM_DEFAULT_DISC_INTERVAL
284 #define BTM_DEFAULT_DISC_INTERVAL 0x0800
285 #endif
286 
287 /* The number of SCO links. */
288 #ifndef BTM_MAX_SCO_LINKS
289 #define BTM_MAX_SCO_LINKS 6
290 #endif
291 
292 /* The number of security records for peer devices. */
293 #ifndef BTM_SEC_MAX_DEVICE_RECORDS
294 #define BTM_SEC_MAX_DEVICE_RECORDS 100
295 #endif
296 
297 /* The number of security records for services. */
298 #ifndef BTM_SEC_MAX_SERVICE_RECORDS
299 #define BTM_SEC_MAX_SERVICE_RECORDS 32
300 #endif
301 
302 /* If True, force a retrieval of remote device name for each bond in case it's
303  * changed */
304 #ifndef BTM_SEC_FORCE_RNR_FOR_DBOND
305 #define BTM_SEC_FORCE_RNR_FOR_DBOND FALSE
306 #endif
307 
308 /* Maximum device name length used in btm database. */
309 #ifndef BTM_MAX_REM_BD_NAME_LEN
310 #define BTM_MAX_REM_BD_NAME_LEN 248
311 #endif
312 
313 /* Maximum local device name length stored btm database */
314 #ifndef BTM_MAX_LOC_BD_NAME_LEN
315 #define BTM_MAX_LOC_BD_NAME_LEN 248
316 #endif
317 
318 /* Maximum service name stored with security authorization (0 if not needed) */
319 #ifndef BTM_SEC_SERVICE_NAME_LEN
320 #define BTM_SEC_SERVICE_NAME_LEN BT_MAX_SERVICE_NAME_LEN
321 #endif
322 
323 /* Maximum length of the service name. */
324 #ifndef BT_MAX_SERVICE_NAME_LEN
325 #define BT_MAX_SERVICE_NAME_LEN 21
326 #endif
327 
328 /* The maximum number of clients that can register with the power manager. */
329 #ifndef BTM_MAX_PM_RECORDS
330 #define BTM_MAX_PM_RECORDS 2
331 #endif
332 
333 /* If the user does not respond to security process requests within this many
334  * seconds, a negative response would be sent automatically.
335  * 30 is LMP response timeout value */
336 #ifndef BTM_SEC_TIMEOUT_VALUE
337 #define BTM_SEC_TIMEOUT_VALUE 35
338 #endif
339 
340 /* Maximum number of callbacks that can be registered using
341  * BTM_RegisterForVSEvents */
342 #ifndef BTM_MAX_VSE_CALLBACKS
343 #define BTM_MAX_VSE_CALLBACKS 3
344 #endif
345 
346 /******************************************
347  *    Lisbon Features
348  ******************************************/
349 /* This is set to TRUE if the FEC is required for EIR packet. */
350 #ifndef BTM_EIR_DEFAULT_FEC_REQUIRED
351 #define BTM_EIR_DEFAULT_FEC_REQUIRED TRUE
352 #endif
353 
354 /* The IO capability of the local device (for Simple Pairing) */
355 #ifndef BTM_LOCAL_IO_CAPS
356 #define BTM_LOCAL_IO_CAPS BTM_IO_CAP_IO
357 #endif
358 
359 #ifndef BTM_LOCAL_IO_CAPS_BLE
360 #define BTM_LOCAL_IO_CAPS_BLE BTM_IO_CAP_KBDISP
361 #endif
362 
363 /* TRUE to include Sniff Subrating */
364 #ifndef BTM_SSR_INCLUDED
365 #define BTM_SSR_INCLUDED TRUE
366 #endif
367 
368 /*************************
369  * End of Lisbon Features
370  *************************/
371 
372 /* 4.1/4.2 secure connections feature */
373 #ifndef SC_MODE_INCLUDED
374 #define SC_MODE_INCLUDED TRUE
375 #endif
376 
377 /* Used for conformance testing ONLY */
378 #ifndef BTM_BLE_CONFORMANCE_TESTING
379 #define BTM_BLE_CONFORMANCE_TESTING FALSE
380 #endif
381 
382 /******************************************************************************
383  *
384  * L2CAP
385  *
386  *****************************************************************************/
387 
388 /* The maximum number of simultaneous links that L2CAP can support. */
389 #ifndef MAX_L2CAP_LINKS
390 #define MAX_L2CAP_LINKS 16
391 #endif
392 
393 /* The maximum number of simultaneous channels that L2CAP can support. */
394 #ifndef MAX_L2CAP_CHANNELS
395 #define MAX_L2CAP_CHANNELS 64
396 #endif
397 
398 /* The maximum number of simultaneous applications that can register with L2CAP.
399  */
400 #ifndef MAX_L2CAP_CLIENTS
401 #define MAX_L2CAP_CLIENTS 15
402 #endif
403 
404 /* The number of seconds of link inactivity before a link is disconnected. */
405 #ifndef L2CAP_LINK_INACTIVITY_TOUT
406 #define L2CAP_LINK_INACTIVITY_TOUT 4
407 #endif
408 
409 /* The number of seconds of link inactivity after bonding before a link is
410  * disconnected. */
411 #ifndef L2CAP_BONDING_TIMEOUT
412 #define L2CAP_BONDING_TIMEOUT 3
413 #endif
414 
415 /* The time from the HCI connection complete to disconnect if no channel is
416  * established. */
417 #ifndef L2CAP_LINK_STARTUP_TOUT
418 #define L2CAP_LINK_STARTUP_TOUT 60
419 #endif
420 
421 /* The L2CAP MTU; must be in accord with the HCI ACL buffer size. */
422 #ifndef L2CAP_MTU_SIZE
423 #define L2CAP_MTU_SIZE 1691
424 #endif
425 
426 /*
427  * The L2CAP MPS over Bluetooth; must be in accord with the FCR tx buffer size
428  * and ACL down buffer size.
429  */
430 #ifndef L2CAP_MPS_OVER_BR_EDR
431 #define L2CAP_MPS_OVER_BR_EDR 1010
432 #endif
433 
434 /* If host flow control enabled, this is the number of buffers the controller
435  * can have unacknowledged. */
436 #ifndef L2CAP_HOST_FC_ACL_BUFS
437 #define L2CAP_HOST_FC_ACL_BUFS 20
438 #endif
439 
440 /* This is set to enable L2CAP to  take the ACL link out of park mode when ACL
441  * data is to be sent. */
442 #ifndef L2CAP_WAKE_PARKED_LINK
443 #define L2CAP_WAKE_PARKED_LINK TRUE
444 #endif
445 
446 /* Minimum number of ACL credit for high priority link */
447 #ifndef L2CAP_HIGH_PRI_MIN_XMIT_QUOTA
448 #define L2CAP_HIGH_PRI_MIN_XMIT_QUOTA 5
449 #endif
450 
451 /* used for monitoring HCI ACL credit management */
452 #ifndef L2CAP_HCI_FLOW_CONTROL_DEBUG
453 #define L2CAP_HCI_FLOW_CONTROL_DEBUG TRUE
454 #endif
455 
456 /* Used for features using fixed channels; set to zero if no fixed channels
457  * supported (BLE, etc.) */
458 /* Excluding L2CAP signaling channel and UCD */
459 #ifndef L2CAP_NUM_FIXED_CHNLS
460 #define L2CAP_NUM_FIXED_CHNLS 32
461 #endif
462 
463 /* First fixed channel supported */
464 #ifndef L2CAP_FIRST_FIXED_CHNL
465 #define L2CAP_FIRST_FIXED_CHNL 4
466 #endif
467 
468 #ifndef L2CAP_LAST_FIXED_CHNL
469 #define L2CAP_LAST_FIXED_CHNL \
470   (L2CAP_FIRST_FIXED_CHNL + L2CAP_NUM_FIXED_CHNLS - 1)
471 #endif
472 
473 /* Round Robin service channels in link */
474 #ifndef L2CAP_ROUND_ROBIN_CHANNEL_SERVICE
475 #define L2CAP_ROUND_ROBIN_CHANNEL_SERVICE TRUE
476 #endif
477 
478 /* Used for conformance testing ONLY:  When TRUE lets scriptwrapper overwrite
479  * info response */
480 #ifndef L2CAP_CONFORMANCE_TESTING
481 #define L2CAP_CONFORMANCE_TESTING FALSE
482 #endif
483 
484 /*
485  * Max bytes per connection to buffer locally before dropping the
486  * connection if local client does not receive it  - default is 1MB
487  */
488 #ifndef L2CAP_MAX_RX_BUFFER
489 #define L2CAP_MAX_RX_BUFFER 0x100000
490 #endif
491 
492 /******************************************************************************
493  *
494  * BLE
495  *
496  *****************************************************************************/
497 
498 #ifndef LOCAL_BLE_CONTROLLER_ID
499 #define LOCAL_BLE_CONTROLLER_ID 1
500 #endif
501 
502 /*
503  * Toggles support for vendor specific extensions such as RPA offloading,
504  * feature discovery, multi-adv etc.
505  */
506 #ifndef BLE_VND_INCLUDED
507 #define BLE_VND_INCLUDED TRUE
508 #endif
509 
510 /* The maximum number of simultaneous applications that can register with LE
511  * L2CAP. */
512 #ifndef BLE_MAX_L2CAP_CLIENTS
513 #define BLE_MAX_L2CAP_CLIENTS 15
514 #endif
515 
516 /******************************************************************************
517  *
518  * ATT/GATT Protocol/Profile Settings
519  *
520  *****************************************************************************/
521 #ifndef GATT_MAX_SR_PROFILES
522 #define GATT_MAX_SR_PROFILES 32 /* max is 32 */
523 #endif
524 
525 #ifndef GATT_MAX_APPS
526 #define GATT_MAX_APPS 32 /* note: 2 apps used internally GATT and GAP */
527 #endif
528 
529 /* connection manager doesn't generate it's own IDs. Instead, all GATT clients
530  * use their gatt_if to identify against conection manager. When stack tries to
531  * create l2cap connection, it will use this fixed ID. */
532 #define CONN_MGR_ID_L2CAP (GATT_MAX_APPS + 10)
533 
534 #ifndef GATT_MAX_PHY_CHANNEL
535 #define GATT_MAX_PHY_CHANNEL 7
536 #endif
537 
538 /* Used for conformance testing ONLY */
539 #ifndef GATT_CONFORMANCE_TESTING
540 #define GATT_CONFORMANCE_TESTING FALSE
541 #endif
542 
543 /* Used only for GATT Multiple Variable Length Notifications PTS tests */
544 #ifndef GATT_UPPER_TESTER_MULT_VARIABLE_LENGTH_NOTIF
545 #define GATT_UPPER_TESTER_MULT_VARIABLE_LENGTH_NOTIF FALSE
546 #endif
547 
548 /* Used only for GATT Multiple Variable Length READ PTS tests */
549 #ifndef GATT_UPPER_TESTER_MULT_VARIABLE_LENGTH_READ
550 #define GATT_UPPER_TESTER_MULT_VARIABLE_LENGTH_READ FALSE
551 #endif
552 
553 /******************************************************************************
554  *
555  * CSIP
556  *
557  *****************************************************************************/
558 
559 /* Used to trigger invalid behaviour of CSIP test case PTS */
560 #ifndef CSIP_UPPER_TESTER_FORCE_TO_SEND_LOCK
561 #define CSIP_UPPER_TESTER_FORCE_TO_SEND_LOCK FALSE
562 #endif
563 
564 /******************************************************************************
565  *
566  * SMP
567  *
568  *****************************************************************************/
569 #ifndef SMP_DEBUG
570 #define SMP_DEBUG FALSE
571 #endif
572 
573 #ifndef SMP_DEFAULT_AUTH_REQ
574 #define SMP_DEFAULT_AUTH_REQ SMP_AUTH_NB_ENC_ONLY
575 #endif
576 
577 #ifndef SMP_MAX_ENC_KEY_SIZE
578 #define SMP_MAX_ENC_KEY_SIZE 16
579 #endif
580 
581 /* minimum link timeout after SMP pairing is done, leave room for key exchange
582    and racing condition for the following service connection.
583    Prefer greater than 0 second, and no less than default inactivity link idle
584    timer(L2CAP_LINK_INACTIVITY_TOUT) in l2cap) */
585 #ifndef SMP_LINK_TOUT_MIN
586 #if (L2CAP_LINK_INACTIVITY_TOUT > 0)
587 #define SMP_LINK_TOUT_MIN L2CAP_LINK_INACTIVITY_TOUT
588 #else
589 #define SMP_LINK_TOUT_MIN 2
590 #endif
591 #endif
592 /******************************************************************************
593  *
594  * SDP
595  *
596  *****************************************************************************/
597 
598 /* The maximum number of SDP records the server can support. */
599 #ifndef SDP_MAX_RECORDS
600 #define SDP_MAX_RECORDS 30
601 #endif
602 
603 /* The maximum number of attributes in each record. */
604 #ifndef SDP_MAX_REC_ATTR
605 #define SDP_MAX_REC_ATTR 25
606 #endif
607 
608 #ifndef SDP_MAX_PAD_LEN
609 #define SDP_MAX_PAD_LEN 600
610 #endif
611 
612 /* The maximum length, in bytes, of an attribute. */
613 #ifndef SDP_MAX_ATTR_LEN
614 #define SDP_MAX_ATTR_LEN 400
615 #endif
616 
617 /* The maximum number of attribute filters supported by SDP databases. */
618 #ifndef SDP_MAX_ATTR_FILTERS
619 #define SDP_MAX_ATTR_FILTERS 15
620 #endif
621 
622 /* The maximum number of UUID filters supported by SDP databases. */
623 #ifndef SDP_MAX_UUID_FILTERS
624 #define SDP_MAX_UUID_FILTERS 3
625 #endif
626 
627 /* The maximum number of record handles retrieved in a search. */
628 #ifndef SDP_MAX_DISC_SERVER_RECS
629 #define SDP_MAX_DISC_SERVER_RECS 21
630 #endif
631 
632 /* The size of a scratchpad buffer, in bytes, for storing the response to an
633  * attribute request. */
634 #ifndef SDP_MAX_LIST_BYTE_COUNT
635 #define SDP_MAX_LIST_BYTE_COUNT 4096
636 #endif
637 
638 /* The maximum number of parameters in an SDP protocol element. */
639 #ifndef SDP_MAX_PROTOCOL_PARAMS
640 #define SDP_MAX_PROTOCOL_PARAMS 2
641 #endif
642 
643 /* The maximum number of simultaneous client and server connections. */
644 #ifndef SDP_MAX_CONNECTIONS
645 #define SDP_MAX_CONNECTIONS 4
646 #endif
647 
648 /* The MTU size for the L2CAP configuration. */
649 #ifndef SDP_MTU_SIZE
650 #define SDP_MTU_SIZE 1024
651 #endif
652 
653 /* The name for security authorization. */
654 #ifndef SDP_SERVICE_NAME
655 #define SDP_SERVICE_NAME "Service Discovery"
656 #endif
657 
658 /******************************************************************************
659  *
660  * RFCOMM
661  *
662  *****************************************************************************/
663 
664 /* The maximum number of ports supported. */
665 #ifndef MAX_RFC_PORTS
666 #define MAX_RFC_PORTS 30
667 #endif
668 
669 /* The maximum simultaneous links to different devices. */
670 #ifndef MAX_BD_CONNECTIONS
671 #define MAX_BD_CONNECTIONS 16
672 #endif
673 
674 /* The port receive queue low watermark level, in bytes. */
675 #ifndef PORT_RX_LOW_WM
676 #define PORT_RX_LOW_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
677 #endif
678 
679 /* The port receive queue high watermark level, in bytes. */
680 #ifndef PORT_RX_HIGH_WM
681 #define PORT_RX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
682 #endif
683 
684 /* The port receive queue critical watermark level, in bytes. */
685 #ifndef PORT_RX_CRITICAL_WM
686 #define PORT_RX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
687 #endif
688 
689 /* The port receive queue low watermark level, in number of buffers. */
690 #ifndef PORT_RX_BUF_LOW_WM
691 #define PORT_RX_BUF_LOW_WM 4
692 #endif
693 
694 /* The port receive queue high watermark level, in number of buffers. */
695 #ifndef PORT_RX_BUF_HIGH_WM
696 #define PORT_RX_BUF_HIGH_WM 10
697 #endif
698 
699 /* The port receive queue critical watermark level, in number of buffers. */
700 #ifndef PORT_RX_BUF_CRITICAL_WM
701 #define PORT_RX_BUF_CRITICAL_WM 15
702 #endif
703 
704 /* The port transmit queue high watermark level, in bytes. */
705 #ifndef PORT_TX_HIGH_WM
706 #define PORT_TX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
707 #endif
708 
709 /* The port transmit queue critical watermark level, in bytes. */
710 #ifndef PORT_TX_CRITICAL_WM
711 #define PORT_TX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
712 #endif
713 
714 /* The port transmit queue high watermark level, in number of buffers. */
715 #ifndef PORT_TX_BUF_HIGH_WM
716 #define PORT_TX_BUF_HIGH_WM 10
717 #endif
718 
719 /* The port transmit queue high watermark level, in number of buffers. */
720 #ifndef PORT_TX_BUF_CRITICAL_WM
721 #define PORT_TX_BUF_CRITICAL_WM 15
722 #endif
723 
724 /* The RFCOMM multiplexer preferred flow control mechanism. */
725 #ifndef PORT_FC_DEFAULT
726 #define PORT_FC_DEFAULT PORT_FC_CREDIT
727 #endif
728 
729 /******************************************************************************
730  *
731  * BNEP
732  *
733  *****************************************************************************/
734 
735 #ifndef BNEP_INCLUDED
736 #define BNEP_INCLUDED TRUE
737 #endif
738 
739 /* BNEP status API call is used mainly to get the L2CAP handle */
740 #ifndef BNEP_SUPPORTS_STATUS_API
741 #define BNEP_SUPPORTS_STATUS_API TRUE
742 #endif
743 
744 /* Maximum number of protocol filters supported. */
745 #ifndef BNEP_MAX_PROT_FILTERS
746 #define BNEP_MAX_PROT_FILTERS 5
747 #endif
748 
749 /* Maximum number of multicast filters supported. */
750 #ifndef BNEP_MAX_MULTI_FILTERS
751 #define BNEP_MAX_MULTI_FILTERS 5
752 #endif
753 
754 /* Preferred MTU size. */
755 #ifndef BNEP_MTU_SIZE
756 #define BNEP_MTU_SIZE L2CAP_MTU_SIZE
757 #endif
758 
759 /* Maximum number of buffers allowed in transmit data queue. */
760 #ifndef BNEP_MAX_XMITQ_DEPTH
761 #define BNEP_MAX_XMITQ_DEPTH 20
762 #endif
763 
764 /* Maximum number BNEP of connections supported. */
765 #ifndef BNEP_MAX_CONNECTIONS
766 #define BNEP_MAX_CONNECTIONS 7
767 #endif
768 
769 /******************************************************************************
770  *
771  * AVDTP
772  *
773  *****************************************************************************/
774 
775 /* Number of simultaneous links to different peer devices. */
776 #ifndef AVDT_NUM_LINKS
777 #define AVDT_NUM_LINKS 6
778 #endif
779 
780 /* Number of simultaneous stream endpoints. */
781 #ifndef AVDT_NUM_SEPS
782 #define AVDT_NUM_SEPS 12
783 #endif
784 
785 /* Number of transport channels setup by AVDT for all media streams */
786 #ifndef AVDT_NUM_TC_TBL
787 #define AVDT_NUM_TC_TBL (AVDT_NUM_SEPS + AVDT_NUM_LINKS)
788 #endif
789 
790 /* Maximum size in bytes of the content protection information element. */
791 #ifndef AVDT_PROTECT_SIZE
792 #define AVDT_PROTECT_SIZE 90
793 #endif
794 
795 /* Default sink delay value in ms. */
796 #ifndef AVDT_SINK_DELAY_MS
797 #define AVDT_SINK_DELAY_MS 300
798 #endif
799 
800 /******************************************************************************
801  *
802  * PAN
803  *
804  *****************************************************************************/
805 
806 #ifndef PAN_INCLUDED
807 #define PAN_INCLUDED TRUE
808 #endif
809 
810 #ifndef PANU_DISABLED
811 #define PANU_DISABLED FALSE
812 #endif
813 
814 /* This will enable the PANU role */
815 #ifndef PAN_SUPPORTS_ROLE_PANU
816 #define PAN_SUPPORTS_ROLE_PANU TRUE
817 #endif
818 
819 /* This will enable the NAP role */
820 #ifndef PAN_SUPPORTS_ROLE_NAP
821 #define PAN_SUPPORTS_ROLE_NAP TRUE
822 #endif
823 
824 /* This is just for debugging purposes */
825 #ifndef PAN_SUPPORTS_DEBUG_DUMP
826 #define PAN_SUPPORTS_DEBUG_DUMP TRUE
827 #endif
828 
829 /* Maximum number of PAN connections allowed */
830 #ifndef MAX_PAN_CONNS
831 #define MAX_PAN_CONNS 7
832 #endif
833 
834 /* Default service name for NAP role */
835 #ifndef PAN_NAP_DEFAULT_SERVICE_NAME
836 #define PAN_NAP_DEFAULT_SERVICE_NAME "Network Access Point Service"
837 #endif
838 
839 /* Default service name for PANU role */
840 #ifndef PAN_PANU_DEFAULT_SERVICE_NAME
841 #define PAN_PANU_DEFAULT_SERVICE_NAME "PAN User Service"
842 #endif
843 
844 /* Default description for NAP role service */
845 #ifndef PAN_NAP_DEFAULT_DESCRIPTION
846 #define PAN_NAP_DEFAULT_DESCRIPTION "NAP"
847 #endif
848 
849 /* Default description for PANU role service */
850 #ifndef PAN_PANU_DEFAULT_DESCRIPTION
851 #define PAN_PANU_DEFAULT_DESCRIPTION "PANU"
852 #endif
853 
854 /******************************************************************************
855  *
856  * GAP
857  *
858  *****************************************************************************/
859 
860 #ifndef GAP_INCLUDED
861 #define GAP_INCLUDED TRUE
862 #endif
863 
864 /* The maximum number of simultaneous GAP L2CAP connections. */
865 #ifndef GAP_MAX_CONNECTIONS
866 #define GAP_MAX_CONNECTIONS 30
867 #endif
868 
869 /* keep the raw data received from SDP server in database. */
870 #ifndef SDP_RAW_DATA_INCLUDED
871 #define SDP_RAW_DATA_INCLUDED TRUE
872 #endif
873 
874 /* Inquiry duration in 1.28 second units. */
875 #ifndef SDP_DEBUG
876 #define SDP_DEBUG TRUE
877 #endif
878 
879 /******************************************************************************
880  *
881  * HID
882  *
883  *****************************************************************************/
884 
885 /* HID Device Role Included */
886 #ifndef HID_DEV_INCLUDED
887 #define HID_DEV_INCLUDED TRUE
888 #endif
889 
890 #ifndef HID_CONTROL_BUF_SIZE
891 #define HID_CONTROL_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
892 #endif
893 
894 #ifndef HID_INTERRUPT_BUF_SIZE
895 #define HID_INTERRUPT_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
896 #endif
897 
898 #ifndef HID_DEV_MTU_SIZE
899 #define HID_DEV_MTU_SIZE 512
900 #endif
901 
902 /*************************************************************************
903  * Definitions for Both HID-Host & Device
904 */
905 #ifndef HID_MAX_SVC_NAME_LEN
906 #define HID_MAX_SVC_NAME_LEN 32
907 #endif
908 
909 #ifndef HID_MAX_SVC_DESCR_LEN
910 #define HID_MAX_SVC_DESCR_LEN 32
911 #endif
912 
913 #ifndef HID_MAX_PROV_NAME_LEN
914 #define HID_MAX_PROV_NAME_LEN 32
915 #endif
916 
917 /*************************************************************************
918  * Definitions for HID-Host
919 */
920 #ifndef HID_HOST_INCLUDED
921 #define HID_HOST_INCLUDED TRUE
922 #endif
923 
924 #ifndef HID_HOST_MAX_DEVICES
925 #define HID_HOST_MAX_DEVICES 7
926 #endif
927 
928 #ifndef HID_HOST_MTU
929 #define HID_HOST_MTU 640
930 #endif
931 
932 #ifndef HID_HOST_MAX_CONN_RETRY
933 #define HID_HOST_MAX_CONN_RETRY 1
934 #endif
935 
936 #ifndef HID_HOST_REPAGE_WIN
937 #define HID_HOST_REPAGE_WIN 2
938 #endif
939 
940 /******************************************************************************
941  *
942  * AVCTP
943  *
944  *****************************************************************************/
945 
946 /* Number of simultaneous ACL links to different peer devices. */
947 #ifndef AVCT_NUM_LINKS
948 #define AVCT_NUM_LINKS 6
949 #endif
950 
951 /* Number of simultaneous AVCTP connections. */
952 #ifndef AVCT_NUM_CONN
953 #define AVCT_NUM_CONN 14  // 2 * MaxDevices + 2
954 #endif
955 
956 /******************************************************************************
957  *
958  * AVRCP
959  *
960  *****************************************************************************/
961 
962 #ifndef DUMP_PCM_DATA
963 #define DUMP_PCM_DATA FALSE
964 #endif
965 
966 /******************************************************************************
967  *
968  * BTA
969  *
970  *****************************************************************************/
971 /* BTA EIR canned UUID list (default is dynamic) */
972 #ifndef BTA_EIR_CANNED_UUID_LIST
973 #define BTA_EIR_CANNED_UUID_LIST FALSE
974 #endif
975 
976 /* Number of supported customer UUID in EIR */
977 #ifndef BTA_EIR_SERVER_NUM_CUSTOM_UUID
978 #define BTA_EIR_SERVER_NUM_CUSTOM_UUID 8
979 #endif
980 
981 /* CHLD override */
982 #ifndef BTA_AG_CHLD_VAL_ECC
983 #define BTA_AG_CHLD_VAL_ECC "(0,1,1x,2,2x,3)"
984 #endif
985 
986 #ifndef BTA_AG_CHLD_VAL
987 #define BTA_AG_CHLD_VAL "(0,1,2,3)"
988 #endif
989 
990 /* Set the CIND to match HFP 1.5 */
991 #ifndef BTA_AG_CIND_INFO
992 #define BTA_AG_CIND_INFO                                                       \
993   "(\"call\",(0,1)),(\"callsetup\",(0-3)),(\"service\",(0-1)),(\"signal\",(0-" \
994   "5)),(\"roam\",(0,1)),(\"battchg\",(0-5)),(\"callheld\",(0-2))"
995 #endif
996 
997 /******************************************************************************
998  *
999  * Tracing:  Include trace header file here.
1000  *
1001  *****************************************************************************/
1002 
1003 /* Enable/disable BTSnoop memory logging */
1004 #ifndef BTSNOOP_MEM
1005 #define BTSNOOP_MEM TRUE
1006 #endif
1007 
1008 #include "bt_trace.h"
1009 
1010 #endif /* BT_TARGET_H */
1011