1 /******************************************************************************
3 * Copyright (c) 2014 The Android Open Source Project
4 * Copyright 1999-2016 Broadcom Corporation
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:
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 ******************************************************************************/
27 #if !defined(HAS_BDROID_BUILDCFG) && !defined(HAS_NO_BDROID_BUILDCFG)
29 "An Android.mk file did not include bdroid_CFLAGS and possibly not bdroid_C_INCLUDES"
32 #ifdef HAS_BDROID_BUILDCFG
33 #include "bdroid_buildcfg.h"
36 #include "bt_types.h" /* This must be defined AFTER buildcfg.h */
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)
45 #ifndef BTUI_OPS_FORMATS
46 #define BTUI_OPS_FORMATS (BTA_OP_VCARD21_MASK | BTA_OP_ANY_MASK)
49 #ifndef BTA_RFC_MTU_SIZE
50 #define BTA_RFC_MTU_SIZE \
51 (L2CAP_MTU_SIZE - L2CAP_MIN_OFFSET - RFCOMM_DATA_OVERHEAD)
54 #ifndef BTA_PAN_INCLUDED
55 #define BTA_PAN_INCLUDED TRUE
58 #ifndef BTA_HD_INCLUDED
59 #define BTA_HD_INCLUDED TRUE
62 #ifndef BTA_HH_INCLUDED
63 #define BTA_HH_INCLUDED TRUE
67 #define BTA_HH_ROLE BTA_MASTER_ROLE_PREF
70 #ifndef BTA_HH_LE_INCLUDED
71 #define BTA_HH_LE_INCLUDED TRUE
74 #ifndef BTA_AR_INCLUDED
75 #define BTA_AR_INCLUDED TRUE
78 #ifndef BTA_AV_SINK_INCLUDED
79 #define BTA_AV_SINK_INCLUDED FALSE
82 #ifndef BTA_DISABLE_DELAY
83 #define BTA_DISABLE_DELAY 200 /* in milliseconds */
87 #define AVDT_VERSION 0x0103
90 #ifndef BTA_AG_AT_MAX_LEN
91 #define BTA_AG_AT_MAX_LEN 512
94 #ifndef BTA_AG_SCO_PKT_TYPES
95 #define BTA_AG_SCO_PKT_TYPES \
96 (BTM_SCO_LINK_ONLY_MASK | ESCO_PKT_TYPES_MASK_EV3 | \
97 ESCO_PKT_TYPES_MASK_NO_3_EV3 | ESCO_PKT_TYPES_MASK_NO_2_EV5 | \
98 ESCO_PKT_TYPES_MASK_NO_3_EV5)
101 #ifndef BTA_AV_RET_TOUT
102 #define BTA_AV_RET_TOUT 15
105 /* TRUE to use SCMS-T content protection */
106 #ifndef BTA_AV_CO_CP_SCMS_T
107 #define BTA_AV_CO_CP_SCMS_T FALSE
110 #ifndef BTA_DM_SDP_DB_SIZE
111 #define BTA_DM_SDP_DB_SIZE 8000
115 #define HL_INCLUDED TRUE
118 #ifndef AG_VOICE_SETTINGS
119 #define AG_VOICE_SETTINGS HCI_DEFAULT_VOICE_SETTINGS
122 #ifndef BTIF_DM_OOB_TEST
123 #define BTIF_DM_OOB_TEST TRUE
126 // How long to wait before activating sniff mode after entering the
127 // idle state for server FT/RFCOMM, OPS connections
128 #ifndef BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS
129 #define BTA_FTS_OPS_IDLE_TO_SNIFF_DELAY_MS 7000
132 // How long to wait before activating sniff mode after entering the
133 // idle state for client FT/RFCOMM connections
134 #ifndef BTA_FTC_IDLE_TO_SNIFF_DELAY_MS
135 #define BTA_FTC_IDLE_TO_SNIFF_DELAY_MS 5000
138 //------------------End added from bdroid_buildcfg.h---------------------
140 /******************************************************************************
144 *****************************************************************************/
146 #ifndef BT_DEFAULT_BUFFER_SIZE
147 #define BT_DEFAULT_BUFFER_SIZE (4096 + 16)
150 #ifndef BT_SMALL_BUFFER_SIZE
151 #define BT_SMALL_BUFFER_SIZE 660
154 /* Receives HCI events from the lower-layer. */
155 #ifndef HCI_CMD_BUF_SIZE
156 #define HCI_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
159 /* Sends SDP data packets. */
160 #ifndef SDP_DATA_BUF_SIZE
161 #define SDP_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
164 /* Sends RFCOMM command packets. */
165 #ifndef RFCOMM_CMD_BUF_SIZE
166 #define RFCOMM_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
169 /* Sends RFCOMM data packets. */
170 #ifndef RFCOMM_DATA_BUF_SIZE
171 #define RFCOMM_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
174 /* Sends L2CAP packets to the peer and HCI messages to the controller. */
175 #ifndef L2CAP_CMD_BUF_SIZE
176 #define L2CAP_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
179 #ifndef L2CAP_USER_TX_BUF_SIZE
180 #define L2CAP_USER_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
183 #ifndef L2CAP_USER_RX_BUF_SIZE
184 #define L2CAP_USER_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
187 /* Sends L2CAP segmented packets in ERTM mode */
188 #ifndef L2CAP_FCR_TX_BUF_SIZE
189 #define L2CAP_FCR_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
192 /* Receives L2CAP segmented packets in ERTM mode */
193 #ifndef L2CAP_FCR_RX_BUF_SIZE
194 #define L2CAP_FCR_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
197 #ifndef L2CAP_FCR_ERTM_BUF_SIZE
198 #define L2CAP_FCR_ERTM_BUF_SIZE (10240 + 24)
201 /* Number of ACL buffers to assign to LE */
203 * TODO: Do we need this?
204 * It was used when the HCI buffers were shared with BR/EDR.
206 #ifndef L2C_DEF_NUM_BLE_BUF_SHARED
207 #define L2C_DEF_NUM_BLE_BUF_SHARED 1
210 /* Used by BTM when it sends HCI commands to the controller. */
211 #ifndef BTM_CMD_BUF_SIZE
212 #define BTM_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
215 #ifndef OBX_LRG_DATA_BUF_SIZE
216 #define OBX_LRG_DATA_BUF_SIZE (8080 + 26)
219 /* Used to send data to L2CAP. */
220 #ifndef GAP_DATA_BUF_SIZE
221 #define GAP_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
224 /* BNEP data and protocol messages. */
225 #ifndef BNEP_BUF_SIZE
226 #define BNEP_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
229 /* AVDTP buffer size for protocol messages */
230 #ifndef AVDT_CMD_BUF_SIZE
231 #define AVDT_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
235 #define PAN_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
238 /* Maximum number of buffers to allocate for PAN */
240 #define PAN_BUF_MAX 100
243 /* AVCTP buffer size for protocol messages */
244 #ifndef AVCT_CMD_BUF_SIZE
245 #define AVCT_CMD_BUF_SIZE 288
248 /* AVRCP buffer size for protocol messages */
249 #ifndef AVRC_CMD_BUF_SIZE
250 #define AVRC_CMD_BUF_SIZE 288
253 /* AVRCP Metadata buffer size for protocol messages */
254 #ifndef AVRC_META_CMD_BUF_SIZE
255 #define AVRC_META_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE
258 #ifndef BTA_HL_LRG_DATA_BUF_SIZE
259 #define BTA_HL_LRG_DATA_BUF_SIZE (10240 + 24)
262 /* GATT Data sending buffer size */
263 #ifndef GATT_DATA_BUF_SIZE
264 #define GATT_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
267 /******************************************************************************
271 *****************************************************************************/
273 /* Cancel Inquiry on incoming SSP */
274 #ifndef BTM_NO_SSP_ON_INQUIRY
275 #define BTM_NO_SSP_ON_INQUIRY FALSE
279 #define DISABLE_WBS FALSE
282 /* This is used to work around a controller bug that doesn't like Disconnect
283 * issued while there is a role switch in progress
285 #ifndef BTM_DISC_DURING_RS
286 #define BTM_DISC_DURING_RS TRUE
289 /**************************
290 * Initial SCO TX credit
291 ************************/
292 /* max TX SCO data packet size */
293 #ifndef BTM_SCO_DATA_SIZE_MAX
294 #define BTM_SCO_DATA_SIZE_MAX 240
297 /* The size in bytes of the BTM inquiry database. */
298 #ifndef BTM_INQ_DB_SIZE
299 #define BTM_INQ_DB_SIZE 40
302 /* The default scan mode */
303 #ifndef BTM_DEFAULT_SCAN_TYPE
304 #define BTM_DEFAULT_SCAN_TYPE BTM_SCAN_TYPE_INTERLACED
307 /* Should connections to unknown devices be allowed when not discoverable? */
308 #ifndef BTM_ALLOW_CONN_IF_NONDISCOVER
309 #define BTM_ALLOW_CONN_IF_NONDISCOVER TRUE
312 /* Sets the Page_Scan_Window: the length of time that the device is performing
314 #ifndef BTM_DEFAULT_CONN_WINDOW
315 #define BTM_DEFAULT_CONN_WINDOW 0x0012
318 /* Sets the Page_Scan_Activity: the interval between the start of two
319 * consecutive page scans. */
320 #ifndef BTM_DEFAULT_CONN_INTERVAL
321 #define BTM_DEFAULT_CONN_INTERVAL 0x0800
324 /* When automatic inquiry scan is enabled, this sets the inquiry scan window. */
325 #ifndef BTM_DEFAULT_DISC_WINDOW
326 #define BTM_DEFAULT_DISC_WINDOW 0x0012
329 /* When automatic inquiry scan is enabled, this sets the inquiry scan interval.
331 #ifndef BTM_DEFAULT_DISC_INTERVAL
332 #define BTM_DEFAULT_DISC_INTERVAL 0x0800
335 /* Default class of device
336 * {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS}
338 * SERVICE_CLASS:0x5A (Bit17 -Networking,Bit19 - Capturing,Bit20 -Object
339 * Transfer,Bit22 -Telephony)
340 * MAJOR_CLASS:0x02 - PHONE
341 * MINOR_CLASS:0x0C - SMART_PHONE
349 /* The number of SCO links. */
350 #ifndef BTM_MAX_SCO_LINKS
351 #define BTM_MAX_SCO_LINKS 6
354 /* The number of security records for peer devices. */
355 #ifndef BTM_SEC_MAX_DEVICE_RECORDS
356 #define BTM_SEC_MAX_DEVICE_RECORDS 100
359 /* The number of security records for services. */
360 #ifndef BTM_SEC_MAX_SERVICE_RECORDS
361 #define BTM_SEC_MAX_SERVICE_RECORDS 32
364 /* If True, force a retrieval of remote device name for each bond in case it's
366 #ifndef BTM_SEC_FORCE_RNR_FOR_DBOND
367 #define BTM_SEC_FORCE_RNR_FOR_DBOND FALSE
370 /* Maximum device name length used in btm database. */
371 #ifndef BTM_MAX_REM_BD_NAME_LEN
372 #define BTM_MAX_REM_BD_NAME_LEN 248
375 /* Maximum local device name length stored btm database */
376 #ifndef BTM_MAX_LOC_BD_NAME_LEN
377 #define BTM_MAX_LOC_BD_NAME_LEN 248
380 /* Fixed Default String. When this is defined as null string, the device's
381 * product model name is used as the default local name.
383 #ifndef BTM_DEF_LOCAL_NAME
384 #define BTM_DEF_LOCAL_NAME ""
387 /* Maximum service name stored with security authorization (0 if not needed) */
388 #ifndef BTM_SEC_SERVICE_NAME_LEN
389 #define BTM_SEC_SERVICE_NAME_LEN BT_MAX_SERVICE_NAME_LEN
392 /* Maximum length of the service name. */
393 #ifndef BT_MAX_SERVICE_NAME_LEN
394 #define BT_MAX_SERVICE_NAME_LEN 21
397 /* The maximum number of clients that can register with the power manager. */
398 #ifndef BTM_MAX_PM_RECORDS
399 #define BTM_MAX_PM_RECORDS 2
402 /* This is set to show debug trace messages for the power manager. */
404 #define BTM_PM_DEBUG FALSE
407 /* If the user does not respond to security process requests within this many
408 * seconds, a negative response would be sent automatically.
409 * 30 is LMP response timeout value */
410 #ifndef BTM_SEC_TIMEOUT_VALUE
411 #define BTM_SEC_TIMEOUT_VALUE 35
414 /* Maximum number of callbacks that can be registered using
415 * BTM_RegisterForVSEvents */
416 #ifndef BTM_MAX_VSE_CALLBACKS
417 #define BTM_MAX_VSE_CALLBACKS 3
420 /******************************************
422 ******************************************/
423 /* This is set to TRUE if the FEC is required for EIR packet. */
424 #ifndef BTM_EIR_DEFAULT_FEC_REQUIRED
425 #define BTM_EIR_DEFAULT_FEC_REQUIRED TRUE
428 /* The IO capability of the local device (for Simple Pairing) */
429 #ifndef BTM_LOCAL_IO_CAPS
430 #define BTM_LOCAL_IO_CAPS BTM_IO_CAP_IO
433 #ifndef BTM_LOCAL_IO_CAPS_BLE
434 #define BTM_LOCAL_IO_CAPS_BLE BTM_IO_CAP_KBDISP
437 /* The default MITM Protection Requirement (for Simple Pairing)
438 * Possible values are BTM_AUTH_SP_YES or BTM_AUTH_SP_NO */
439 #ifndef BTM_DEFAULT_AUTH_REQ
440 #define BTM_DEFAULT_AUTH_REQ BTM_AUTH_SP_NO
443 /* The default MITM Protection Requirement for dedicated bonding using Simple
445 * Possible values are BTM_AUTH_AP_YES or BTM_AUTH_AP_NO */
446 #ifndef BTM_DEFAULT_DD_AUTH_REQ
447 #define BTM_DEFAULT_DD_AUTH_REQ BTM_AUTH_AP_YES
450 /* TRUE to include Sniff Subrating */
451 #ifndef BTM_SSR_INCLUDED
452 #define BTM_SSR_INCLUDED TRUE
455 /*************************
456 * End of Lisbon Features
457 *************************/
459 /* 4.1/4.2 secure connections feature */
460 #ifndef SC_MODE_INCLUDED
461 #define SC_MODE_INCLUDED TRUE
464 /* Used for conformance testing ONLY */
465 #ifndef BTM_BLE_CONFORMANCE_TESTING
466 #define BTM_BLE_CONFORMANCE_TESTING FALSE
469 /******************************************************************************
473 *****************************************************************************/
475 /* The maximum number of simultaneous links that L2CAP can support. */
476 #ifndef MAX_ACL_CONNECTIONS
477 #define MAX_L2CAP_LINKS 13
479 #define MAX_L2CAP_LINKS MAX_ACL_CONNECTIONS
482 /* The maximum number of simultaneous channels that L2CAP can support. */
483 #ifndef MAX_L2CAP_CHANNELS
484 #define MAX_L2CAP_CHANNELS 32
487 /* The maximum number of simultaneous applications that can register with L2CAP.
489 #ifndef MAX_L2CAP_CLIENTS
490 #define MAX_L2CAP_CLIENTS 15
493 /* The number of seconds of link inactivity before a link is disconnected. */
494 #ifndef L2CAP_LINK_INACTIVITY_TOUT
495 #define L2CAP_LINK_INACTIVITY_TOUT 4
498 /* The number of seconds of link inactivity after bonding before a link is
500 #ifndef L2CAP_BONDING_TIMEOUT
501 #define L2CAP_BONDING_TIMEOUT 3
504 /* The time from the HCI connection complete to disconnect if no channel is
506 #ifndef L2CAP_LINK_STARTUP_TOUT
507 #define L2CAP_LINK_STARTUP_TOUT 60
510 /* The L2CAP MTU; must be in accord with the HCI ACL buffer size. */
511 #ifndef L2CAP_MTU_SIZE
512 #define L2CAP_MTU_SIZE 1691
516 * The L2CAP MPS over Bluetooth; must be in accord with the FCR tx buffer size
517 * and ACL down buffer size.
519 #ifndef L2CAP_MPS_OVER_BR_EDR
520 #define L2CAP_MPS_OVER_BR_EDR 1010
523 /* If host flow control enabled, this is the number of buffers the controller
524 * can have unacknowledged. */
525 #ifndef L2CAP_HOST_FC_ACL_BUFS
526 #define L2CAP_HOST_FC_ACL_BUFS 20
529 /* This is set to enable L2CAP to take the ACL link out of park mode when ACL
530 * data is to be sent. */
531 #ifndef L2CAP_WAKE_PARKED_LINK
532 #define L2CAP_WAKE_PARKED_LINK TRUE
535 /* Whether link wants to be the master or the slave. */
536 #ifndef L2CAP_DESIRED_LINK_ROLE
537 #define L2CAP_DESIRED_LINK_ROLE HCI_ROLE_SLAVE
540 /* Include Non-Flushable Packet Boundary Flag feature of Lisbon */
541 #ifndef L2CAP_NON_FLUSHABLE_PB_INCLUDED
542 #define L2CAP_NON_FLUSHABLE_PB_INCLUDED TRUE
545 /* Minimum number of ACL credit for high priority link */
546 #ifndef L2CAP_HIGH_PRI_MIN_XMIT_QUOTA
547 #define L2CAP_HIGH_PRI_MIN_XMIT_QUOTA 5
550 /* used for monitoring HCI ACL credit management */
551 #ifndef L2CAP_HCI_FLOW_CONTROL_DEBUG
552 #define L2CAP_HCI_FLOW_CONTROL_DEBUG TRUE
555 /* Used for features using fixed channels; set to zero if no fixed channels
556 * supported (BLE, etc.) */
557 /* Excluding L2CAP signaling channel and UCD */
558 #ifndef L2CAP_NUM_FIXED_CHNLS
559 #define L2CAP_NUM_FIXED_CHNLS 32
562 /* First fixed channel supported */
563 #ifndef L2CAP_FIRST_FIXED_CHNL
564 #define L2CAP_FIRST_FIXED_CHNL 4
567 #ifndef L2CAP_LAST_FIXED_CHNL
568 #define L2CAP_LAST_FIXED_CHNL \
569 (L2CAP_FIRST_FIXED_CHNL + L2CAP_NUM_FIXED_CHNLS - 1)
572 /* Round Robin service channels in link */
573 #ifndef L2CAP_ROUND_ROBIN_CHANNEL_SERVICE
574 #define L2CAP_ROUND_ROBIN_CHANNEL_SERVICE TRUE
577 /* used for monitoring eL2CAP data flow */
578 #ifndef L2CAP_ERTM_STATS
579 #define L2CAP_ERTM_STATS FALSE
582 /* Used for conformance testing ONLY: When TRUE lets scriptwrapper overwrite
584 #ifndef L2CAP_CONFORMANCE_TESTING
585 #define L2CAP_CONFORMANCE_TESTING FALSE
589 * Max bytes per connection to buffer locally before dropping the
590 * connection if local client does not receive it - default is 1MB
592 #ifndef L2CAP_MAX_RX_BUFFER
593 #define L2CAP_MAX_RX_BUFFER 0x100000
596 /******************************************************************************
600 *****************************************************************************/
602 #ifndef LOCAL_BLE_CONTROLLER_ID
603 #define LOCAL_BLE_CONTROLLER_ID 1
607 * Toggles support for general LE privacy features such as remote address
608 * resolution, local address rotation etc.
610 #ifndef BLE_PRIVACY_SPT
611 #define BLE_PRIVACY_SPT TRUE
615 * Enables or disables support for local privacy (ex. address rotation)
617 #ifndef BLE_LOCAL_PRIVACY_ENABLED
618 #define BLE_LOCAL_PRIVACY_ENABLED TRUE
622 * Toggles support for vendor specific extensions such as RPA offloading,
623 * feature discovery, multi-adv etc.
625 #ifndef BLE_VND_INCLUDED
626 #define BLE_VND_INCLUDED FALSE
629 /* The maximum number of simultaneous applications that can register with LE
631 #ifndef BLE_MAX_L2CAP_CLIENTS
632 #define BLE_MAX_L2CAP_CLIENTS 15
635 /******************************************************************************
637 * ATT/GATT Protocol/Profile Settings
639 *****************************************************************************/
640 #ifndef BLE_LLT_INCLUDED
641 #define BLE_LLT_INCLUDED TRUE
644 #ifndef BLE_DELAY_REQUEST_ENC
645 /* This flag is to work around IPHONE problem, We need to wait for iPhone ready
646 before send encryption request to iPhone */
647 #define BLE_DELAY_REQUEST_ENC FALSE
650 #ifndef GATT_MAX_SR_PROFILES
651 #define GATT_MAX_SR_PROFILES 32 /* max is 32 */
654 #ifndef GATT_MAX_APPS
655 #define GATT_MAX_APPS 32 /* note: 2 apps used internally GATT and GAP */
658 /* connection manager doesn't generate it's own IDs. Instead, all GATT clients
659 * use their gatt_if to identify against conection manager. When stack tries to
660 * create l2cap connection, it will use this fixed ID. */
661 #define CONN_MGR_ID_L2CAP (GATT_MAX_APPS + 10)
663 #ifndef GATT_MAX_PHY_CHANNEL
664 #define GATT_MAX_PHY_CHANNEL 7
667 /* Used for conformance testing ONLY */
668 #ifndef GATT_CONFORMANCE_TESTING
669 #define GATT_CONFORMANCE_TESTING FALSE
672 /******************************************************************************
676 *****************************************************************************/
678 #define SMP_DEBUG FALSE
681 #ifndef SMP_DEFAULT_AUTH_REQ
682 #define SMP_DEFAULT_AUTH_REQ SMP_AUTH_NB_ENC_ONLY
685 #ifndef SMP_MAX_ENC_KEY_SIZE
686 #define SMP_MAX_ENC_KEY_SIZE 16
689 /* minimum link timeout after SMP pairing is done, leave room for key exchange
690 and racing condition for the following service connection.
691 Prefer greater than 0 second, and no less than default inactivity link idle
692 timer(L2CAP_LINK_INACTIVITY_TOUT) in l2cap) */
693 #ifndef SMP_LINK_TOUT_MIN
694 #if (L2CAP_LINK_INACTIVITY_TOUT > 0)
695 #define SMP_LINK_TOUT_MIN L2CAP_LINK_INACTIVITY_TOUT
697 #define SMP_LINK_TOUT_MIN 2
700 /******************************************************************************
704 *****************************************************************************/
706 /* This is set to enable SDP server functionality. */
707 #ifndef SDP_SERVER_ENABLED
708 #define SDP_SERVER_ENABLED TRUE
711 /* The maximum number of SDP records the server can support. */
712 #ifndef SDP_MAX_RECORDS
713 #define SDP_MAX_RECORDS 30
716 /* The maximum number of attributes in each record. */
717 #ifndef SDP_MAX_REC_ATTR
718 #define SDP_MAX_REC_ATTR 25
721 #ifndef SDP_MAX_PAD_LEN
722 #define SDP_MAX_PAD_LEN 600
725 /* The maximum length, in bytes, of an attribute. */
726 #ifndef SDP_MAX_ATTR_LEN
727 #define SDP_MAX_ATTR_LEN 400
730 /* The maximum number of attribute filters supported by SDP databases. */
731 #ifndef SDP_MAX_ATTR_FILTERS
732 #define SDP_MAX_ATTR_FILTERS 15
735 /* The maximum number of UUID filters supported by SDP databases. */
736 #ifndef SDP_MAX_UUID_FILTERS
737 #define SDP_MAX_UUID_FILTERS 3
740 /* The maximum number of record handles retrieved in a search. */
741 #ifndef SDP_MAX_DISC_SERVER_RECS
742 #define SDP_MAX_DISC_SERVER_RECS 21
745 /* The size of a scratchpad buffer, in bytes, for storing the response to an
746 * attribute request. */
747 #ifndef SDP_MAX_LIST_BYTE_COUNT
748 #define SDP_MAX_LIST_BYTE_COUNT 4096
751 /* The maximum number of parameters in an SDP protocol element. */
752 #ifndef SDP_MAX_PROTOCOL_PARAMS
753 #define SDP_MAX_PROTOCOL_PARAMS 2
756 /* The maximum number of simultaneous client and server connections. */
757 #ifndef SDP_MAX_CONNECTIONS
758 #define SDP_MAX_CONNECTIONS 4
761 /* The MTU size for the L2CAP configuration. */
763 #define SDP_MTU_SIZE 1024
766 /* The flush timeout for the L2CAP configuration. */
768 #define SDP_FLUSH_TO 0xFFFF
771 /* The name for security authorization. */
772 #ifndef SDP_SERVICE_NAME
773 #define SDP_SERVICE_NAME "Service Discovery"
776 /* The security level for BTM. */
777 #ifndef SDP_SECURITY_LEVEL
778 #define SDP_SECURITY_LEVEL BTM_SEC_NONE
781 /******************************************************************************
785 *****************************************************************************/
787 /* The maximum number of ports supported. */
788 #ifndef MAX_RFC_PORTS
789 #define MAX_RFC_PORTS 30
792 /* The maximum simultaneous links to different devices. */
793 #ifndef MAX_ACL_CONNECTIONS
794 #define MAX_BD_CONNECTIONS 7
796 #define MAX_BD_CONNECTIONS MAX_ACL_CONNECTIONS
799 /* The port receive queue low watermark level, in bytes. */
800 #ifndef PORT_RX_LOW_WM
801 #define PORT_RX_LOW_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_LOW_WM)
804 /* The port receive queue high watermark level, in bytes. */
805 #ifndef PORT_RX_HIGH_WM
806 #define PORT_RX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_HIGH_WM)
809 /* The port receive queue critical watermark level, in bytes. */
810 #ifndef PORT_RX_CRITICAL_WM
811 #define PORT_RX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_RX_BUF_CRITICAL_WM)
814 /* The port receive queue low watermark level, in number of buffers. */
815 #ifndef PORT_RX_BUF_LOW_WM
816 #define PORT_RX_BUF_LOW_WM 4
819 /* The port receive queue high watermark level, in number of buffers. */
820 #ifndef PORT_RX_BUF_HIGH_WM
821 #define PORT_RX_BUF_HIGH_WM 10
824 /* The port receive queue critical watermark level, in number of buffers. */
825 #ifndef PORT_RX_BUF_CRITICAL_WM
826 #define PORT_RX_BUF_CRITICAL_WM 15
829 /* The port transmit queue high watermark level, in bytes. */
830 #ifndef PORT_TX_HIGH_WM
831 #define PORT_TX_HIGH_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_HIGH_WM)
834 /* The port transmit queue critical watermark level, in bytes. */
835 #ifndef PORT_TX_CRITICAL_WM
836 #define PORT_TX_CRITICAL_WM (BTA_RFC_MTU_SIZE * PORT_TX_BUF_CRITICAL_WM)
839 /* The port transmit queue high watermark level, in number of buffers. */
840 #ifndef PORT_TX_BUF_HIGH_WM
841 #define PORT_TX_BUF_HIGH_WM 10
844 /* The port transmit queue high watermark level, in number of buffers. */
845 #ifndef PORT_TX_BUF_CRITICAL_WM
846 #define PORT_TX_BUF_CRITICAL_WM 15
849 /* The RFCOMM multiplexer preferred flow control mechanism. */
850 #ifndef PORT_FC_DEFAULT
851 #define PORT_FC_DEFAULT PORT_FC_CREDIT
854 /******************************************************************************
858 *****************************************************************************/
861 * Buffer size to reassemble the SDU.
862 * It will allow buffers to be used that are larger than the L2CAP_MAX_MTU.
864 #ifndef OBX_USER_RX_BUF_SIZE
865 #define OBX_USER_RX_BUF_SIZE OBX_LRG_DATA_BUF_SIZE
869 * Buffer size to hold the SDU.
870 * It will allow buffers to be used that are larger than the L2CAP_MAX_MTU.
872 #ifndef OBX_USER_TX_BUF_SIZE
873 #define OBX_USER_TX_BUF_SIZE OBX_LRG_DATA_BUF_SIZE
876 /* Buffer size used to hold MPS segments during SDU reassembly. */
877 #ifndef OBX_FCR_RX_BUF_SIZE
878 #define OBX_FCR_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
882 * Buffer size used to hold MPS segments used in (re)transmissions.
883 * The size of each buffer must be able to hold the maximum MPS segment size
884 * passed in L2CA_SetFCROptions plus BT_HDR (8) + HCI preamble (4) +
885 * L2CAP_MIN_OFFSET (11 - as of BT 2.1 + EDR Spec).
887 #ifndef OBX_FCR_TX_BUF_SIZE
888 #define OBX_FCR_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
892 * Size of the transmission window when using enhanced retransmission mode.
893 * Not used in basic and streaming modes. Range: 1 - 63
895 #ifndef OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR
896 #define OBX_FCR_OPT_TX_WINDOW_SIZE_BR_EDR 20
900 * Number of transmission attempts for a single I-Frame before taking
901 * Down the connection. Used In ERTM mode only. Value is Ignored in basic and
904 * 0 - infinite retransmissions
905 * 1 - single transmission
907 #ifndef OBX_FCR_OPT_MAX_TX_B4_DISCNT
908 #define OBX_FCR_OPT_MAX_TX_B4_DISCNT 20
912 * Retransmission Timeout
913 * Range: Minimum 2000 (2 secs) on BR/EDR when supporting PBF.
915 #ifndef OBX_FCR_OPT_RETX_TOUT
916 #define OBX_FCR_OPT_RETX_TOUT 2000
921 * Range: Minimum 12000 (12 secs) on BR/EDR when supporting PBF.
923 #ifndef OBX_FCR_OPT_MONITOR_TOUT
924 #define OBX_FCR_OPT_MONITOR_TOUT 12000
928 * Maximum PDU payload size.
929 * Suggestion: The maximum amount of data that will fit into a 3-DH5 packet.
932 #ifndef OBX_FCR_OPT_MAX_PDU_SIZE
933 #define OBX_FCR_OPT_MAX_PDU_SIZE L2CAP_MPS_OVER_BR_EDR
936 /******************************************************************************
940 *****************************************************************************/
942 #ifndef BNEP_INCLUDED
943 #define BNEP_INCLUDED TRUE
946 /* BNEP status API call is used mainly to get the L2CAP handle */
947 #ifndef BNEP_SUPPORTS_STATUS_API
948 #define BNEP_SUPPORTS_STATUS_API TRUE
952 * When BNEP connection changes roles after the connection is established
953 * we will do an authentication check again on the new role
955 #ifndef BNEP_DO_AUTH_FOR_ROLE_SWITCH
956 #define BNEP_DO_AUTH_FOR_ROLE_SWITCH TRUE
959 /* Maximum number of protocol filters supported. */
960 #ifndef BNEP_MAX_PROT_FILTERS
961 #define BNEP_MAX_PROT_FILTERS 5
964 /* Maximum number of multicast filters supported. */
965 #ifndef BNEP_MAX_MULTI_FILTERS
966 #define BNEP_MAX_MULTI_FILTERS 5
969 /* Minimum MTU size. */
970 #ifndef BNEP_MIN_MTU_SIZE
971 #define BNEP_MIN_MTU_SIZE L2CAP_MTU_SIZE
974 /* Preferred MTU size. */
975 #ifndef BNEP_MTU_SIZE
976 #define BNEP_MTU_SIZE BNEP_MIN_MTU_SIZE
979 /* Maximum number of buffers allowed in transmit data queue. */
980 #ifndef BNEP_MAX_XMITQ_DEPTH
981 #define BNEP_MAX_XMITQ_DEPTH 20
984 /* Maximum number BNEP of connections supported. */
985 #ifndef BNEP_MAX_CONNECTIONS
986 #define BNEP_MAX_CONNECTIONS 7
989 /******************************************************************************
993 *****************************************************************************/
995 /* Number of simultaneous links to different peer devices. */
996 #ifndef AVDT_NUM_LINKS
997 #define AVDT_NUM_LINKS 6
1000 /* Number of simultaneous stream endpoints. */
1001 #ifndef AVDT_NUM_SEPS
1002 #define AVDT_NUM_SEPS 6
1005 /* Number of transport channels setup by AVDT for all media streams */
1006 #ifndef AVDT_NUM_TC_TBL
1007 #define AVDT_NUM_TC_TBL (AVDT_NUM_SEPS + AVDT_NUM_LINKS)
1010 /* Maximum size in bytes of the content protection information element. */
1011 #ifndef AVDT_PROTECT_SIZE
1012 #define AVDT_PROTECT_SIZE 90
1015 /******************************************************************************
1019 *****************************************************************************/
1021 #ifndef PAN_INCLUDED
1022 #define PAN_INCLUDED TRUE
1025 #ifndef PAN_NAP_DISABLED
1026 #define PAN_NAP_DISABLED FALSE
1029 #ifndef PANU_DISABLED
1030 #define PANU_DISABLED FALSE
1033 /* This will enable the PANU role */
1034 #ifndef PAN_SUPPORTS_ROLE_PANU
1035 #define PAN_SUPPORTS_ROLE_PANU TRUE
1038 /* This will enable the GN role */
1039 #ifndef PAN_SUPPORTS_ROLE_GN
1040 #define PAN_SUPPORTS_ROLE_GN TRUE
1043 /* This will enable the NAP role */
1044 #ifndef PAN_SUPPORTS_ROLE_NAP
1045 #define PAN_SUPPORTS_ROLE_NAP TRUE
1048 /* This is just for debugging purposes */
1049 #ifndef PAN_SUPPORTS_DEBUG_DUMP
1050 #define PAN_SUPPORTS_DEBUG_DUMP TRUE
1053 /* Maximum number of PAN connections allowed */
1054 #ifndef MAX_PAN_CONNS
1055 #define MAX_PAN_CONNS 7
1058 /* Default service name for NAP role */
1059 #ifndef PAN_NAP_DEFAULT_SERVICE_NAME
1060 #define PAN_NAP_DEFAULT_SERVICE_NAME "Network Access Point Service"
1063 /* Default service name for GN role */
1064 #ifndef PAN_GN_DEFAULT_SERVICE_NAME
1065 #define PAN_GN_DEFAULT_SERVICE_NAME "Group Network Service"
1068 /* Default service name for PANU role */
1069 #ifndef PAN_PANU_DEFAULT_SERVICE_NAME
1070 #define PAN_PANU_DEFAULT_SERVICE_NAME "PAN User Service"
1073 /* Default description for NAP role service */
1074 #ifndef PAN_NAP_DEFAULT_DESCRIPTION
1075 #define PAN_NAP_DEFAULT_DESCRIPTION "NAP"
1078 /* Default description for GN role service */
1079 #ifndef PAN_GN_DEFAULT_DESCRIPTION
1080 #define PAN_GN_DEFAULT_DESCRIPTION "GN"
1083 /* Default description for PANU role service */
1084 #ifndef PAN_PANU_DEFAULT_DESCRIPTION
1085 #define PAN_PANU_DEFAULT_DESCRIPTION "PANU"
1088 /* Default Security level for PANU role. */
1089 #ifndef PAN_PANU_SECURITY_LEVEL
1090 #define PAN_PANU_SECURITY_LEVEL 0
1093 /* Default Security level for GN role. */
1094 #ifndef PAN_GN_SECURITY_LEVEL
1095 #define PAN_GN_SECURITY_LEVEL 0
1098 /* Default Security level for NAP role. */
1099 #ifndef PAN_NAP_SECURITY_LEVEL
1100 #define PAN_NAP_SECURITY_LEVEL 0
1103 /******************************************************************************
1107 *****************************************************************************/
1109 #ifndef GAP_INCLUDED
1110 #define GAP_INCLUDED TRUE
1113 /* The maximum number of simultaneous GAP L2CAP connections. */
1114 #ifndef GAP_MAX_CONNECTIONS
1115 #define GAP_MAX_CONNECTIONS 30
1118 /* keep the raw data received from SDP server in database. */
1119 #ifndef SDP_RAW_DATA_INCLUDED
1120 #define SDP_RAW_DATA_INCLUDED TRUE
1123 /* Inquiry duration in 1.28 second units. */
1125 #define SDP_DEBUG TRUE
1128 /******************************************************************************
1132 *****************************************************************************/
1134 /* HID Device Role Included */
1135 #ifndef HID_DEV_INCLUDED
1136 #define HID_DEV_INCLUDED TRUE
1139 #ifndef HID_CONTROL_BUF_SIZE
1140 #define HID_CONTROL_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
1143 #ifndef HID_INTERRUPT_BUF_SIZE
1144 #define HID_INTERRUPT_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
1147 #ifndef HID_DEV_MTU_SIZE
1148 #define HID_DEV_MTU_SIZE 64
1151 #ifndef HID_DEV_FLUSH_TO
1152 #define HID_DEV_FLUSH_TO 0xffff
1155 /*************************************************************************
1156 * Definitions for Both HID-Host & Device
1158 #ifndef HID_MAX_SVC_NAME_LEN
1159 #define HID_MAX_SVC_NAME_LEN 32
1162 #ifndef HID_MAX_SVC_DESCR_LEN
1163 #define HID_MAX_SVC_DESCR_LEN 32
1166 #ifndef HID_MAX_PROV_NAME_LEN
1167 #define HID_MAX_PROV_NAME_LEN 32
1170 /*************************************************************************
1171 * Definitions for HID-Host
1173 #ifndef HID_HOST_INCLUDED
1174 #define HID_HOST_INCLUDED TRUE
1177 #ifndef HID_HOST_MAX_DEVICES
1178 #define HID_HOST_MAX_DEVICES 7
1181 #ifndef HID_HOST_MTU
1182 #define HID_HOST_MTU 640
1185 #ifndef HID_HOST_FLUSH_TO
1186 #define HID_HOST_FLUSH_TO 0xffff
1189 #ifndef HID_HOST_MAX_CONN_RETRY
1190 #define HID_HOST_MAX_CONN_RETRY 1
1193 #ifndef HID_HOST_REPAGE_WIN
1194 #define HID_HOST_REPAGE_WIN 2
1197 /******************************************************************************
1201 *****************************************************************************/
1203 /* Number of simultaneous ACL links to different peer devices. */
1204 #ifndef AVCT_NUM_LINKS
1205 #define AVCT_NUM_LINKS 6
1208 /* Number of simultaneous AVCTP connections. */
1209 #ifndef AVCT_NUM_CONN
1210 #define AVCT_NUM_CONN 14 // 2 * MaxDevices + 2
1213 /******************************************************************************
1217 *****************************************************************************/
1219 #ifndef AVRC_ADV_CTRL_INCLUDED
1220 #define AVRC_ADV_CTRL_INCLUDED TRUE
1223 #ifndef DUMP_PCM_DATA
1224 #define DUMP_PCM_DATA FALSE
1227 /******************************************************************************
1231 *****************************************************************************/
1232 /* BTA EIR canned UUID list (default is dynamic) */
1233 #ifndef BTA_EIR_CANNED_UUID_LIST
1234 #define BTA_EIR_CANNED_UUID_LIST FALSE
1237 /* Number of supported customer UUID in EIR */
1238 #ifndef BTA_EIR_SERVER_NUM_CUSTOM_UUID
1239 #define BTA_EIR_SERVER_NUM_CUSTOM_UUID 8
1243 #ifndef BTA_AG_CHLD_VAL_ECC
1244 #define BTA_AG_CHLD_VAL_ECC "(0,1,1x,2,2x,3)"
1247 #ifndef BTA_AG_CHLD_VAL
1248 #define BTA_AG_CHLD_VAL "(0,1,2,3)"
1251 /* Set the CIND to match HFP 1.5 */
1252 #ifndef BTA_AG_CIND_INFO
1253 #define BTA_AG_CIND_INFO \
1254 "(\"call\",(0,1)),(\"callsetup\",(0-3)),(\"service\",(0-1)),(\"signal\",(0-" \
1255 "5)),(\"roam\",(0,1)),(\"battchg\",(0-5)),(\"callheld\",(0-2))"
1258 #ifndef BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY
1259 #define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY TRUE
1262 /******************************************************************************
1264 * Tracing: Include trace header file here.
1266 *****************************************************************************/
1268 /* Enable/disable BTSnoop memory logging */
1270 #define BTSNOOP_MEM TRUE
1273 #include "bt_trace.h"
1275 #endif /* BT_TARGET_H */