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