OSDN Git Service

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