1# Bluetooth LE stack configuration options
2
3# Copyright (c) 2016-2020 Nordic Semiconductor ASA
4# Copyright (c) 2015-2016 Intel Corporation
5# SPDX-License-Identifier: Apache-2.0
6
7config BT_LONG_WQ
8	bool "Dedicated workqueue for long-running tasks."
9	default y if BT_GATT_CACHING
10	help
11	  Adds an API for a workqueue dedicated to long-running tasks.
12
13if BT_LONG_WQ
14config BT_LONG_WQ_STACK_SIZE
15	# Hidden: Long workqueue stack size. Should be derived from system
16	# requirements.
17	int
18	default 1300 if BT_GATT_CACHING
19	default 1140 if BT_TINYCRYPT_ECC
20	default 1024
21
22config BT_LONG_WQ_PRIO
23	int "Long workqueue priority. Should be pre-emptible."
24	default 10
25	range 0 NUM_PREEMPT_PRIORITIES
26
27config BT_LONG_WQ_INIT_PRIO
28	int "Long workqueue init priority"
29	default 50
30	help
31	  Init priority level to setup the long workqueue.
32
33endif # BT_LONG_WQ
34
35config BT_HCI_HOST
36	# Hidden option to make the conditions more intuitive
37	bool
38	default y
39	depends on !BT_HCI_RAW
40	select POLL
41
42
43config BT_HCI_TX_STACK_SIZE
44	# NOTE: This value is derived from other symbols and should only be
45	# changed if required by architecture
46	int
47	prompt "HCI Tx thread stack size" if BT_HCI_TX_STACK_SIZE_WITH_PROMPT
48	default 512 if BT_H4
49	default 512 if BT_H5
50	default 416 if BT_SPI
51	default 1280 if BT_CTLR && BT_LL_SW_SPLIT && (NO_OPTIMIZATIONS || BT_ISO_BROADCAST)
52	default 1024 if BT_CTLR && BT_LL_SW_SPLIT && BT_CENTRAL
53	default 768 if BT_CTLR && BT_LL_SW_SPLIT
54	default 512 if BT_USERCHAN
55	default 640 if BT_STM32_IPM
56	# Even if no driver is selected the following default is still
57	# needed e.g. for unit tests. This default will also server as
58	# the worst-case stack size if an out-of-tree controller is used.
59	default 1024
60	help
61	  Stack size needed for executing bt_send with specified driver.
62	  NOTE: This is an advanced setting and should not be changed unless
63	  absolutely necessary.  To change this you must first select
64	  BT_HCI_TX_STACK_SIZE_WITH_PROMPT.
65
66config BT_HCI_TX_STACK_SIZE_WITH_PROMPT
67	bool "Override HCI Tx thread stack size"
68
69config BT_HCI_TX_PRIO
70	# Hidden option for Co-Operative Tx thread priority
71	int
72	default 7
73
74choice BT_RECV_CONTEXT
75	prompt "BT RX Thread Selection"
76	default BT_RECV_WORKQ_SYS if SOC_SERIES_NRF51X
77	default BT_RECV_WORKQ_BT
78	help
79	  Selects in which context incoming low priority HCI packets are processed.
80	  The host defines some events as high priority to avoid race conditions and deadlocks.
81	  High priority events are always processed in the context of the caller of bt_recv()
82	  or bt_recv_prio(). The choice will influence RAM usage and how fast incoming HCI
83	  packets are processed.
84
85config BT_RECV_WORKQ_SYS
86	bool "Process low priority HCI packets in the system work queue"
87	help
88	  When this option is selected, the host will process incoming low priority HCI packets
89	  in the system work queue. The HCI driver shall not call bt_recv_prio().
90	  High priority HCI packets will processed in the context of the caller of bt_recv().
91	  The application needs to ensure the system workqueue stack size (SYSTEM_WORKQUEUE_STACK_SIZE)
92	  is large enough, refer to BT_RX_STACK_SIZE for the recommended minimum.
93	  Note: When this option is used, other users of the system work queue will influence the
94	  latency of incoming Bluetooth events.
95
96config BT_RECV_WORKQ_BT
97	bool "Process low priority HCI packets in the bluetooth-specific work queue"
98	help
99	  When this option is selected, the host will process incoming low priority HCI packets
100	  in the bluetooth-specific work queue. The HCI driver shall not call bt_recv_prio().
101	  High priority HCI packets will processed in the context of the caller of bt_recv().
102	  The application needs to ensure the bluetooth-specific work queue size is large enough,
103	  refer to BT_RX_STACK_SIZE for the recommended minimum.
104endchoice
105
106config BT_RX_STACK_SIZE
107	int "Size of the receiving thread stack"
108	default 768 if BT_HCI_RAW
109	default 3092 if BT_MESH_GATT_CLIENT
110	default 2600 if BT_MESH
111	default 2048 if BT_AUDIO
112	default 2200 if BT_SETTINGS
113	default 1200
114	help
115	  Size of the receiving thread stack. This is the context from
116	  which all event callbacks to the application occur. The
117	  default value is sufficient for basic operation, but if the
118	  application needs to do advanced things in its callbacks that
119	  require extra stack space, this value can be increased to
120	  accommodate for that.
121
122config BT_RX_PRIO
123	# Hidden option for Co-Operative Rx thread priority
124	int
125	default 8
126
127config BT_DRIVER_RX_HIGH_PRIO
128	# Hidden option for Co-Operative HCI driver RX thread priority
129	int
130	default 6
131
132menu "Bluetooth Host"
133
134if BT_HCI_HOST
135
136rsource "../mesh/Kconfig"
137rsource "../audio/Kconfig"
138
139config BT_HOST_CRYPTO
140	bool "Use crypto functionality implemented in the Bluetooth host"
141	default y if !BT_CTLR_CRYPTO
142	select TINYCRYPT if !BT_USE_PSA_API
143	select TINYCRYPT_AES if !BT_USE_PSA_API
144	select PSA_WANT_KEY_TYPE_AES if BT_USE_PSA_API
145	help
146	  The option adds the AES encryption support using TinyCrypt
147	  library if this is not provided by the controller implementation.
148
149config BT_HOST_CRYPTO_PRNG
150	bool "Use Tinycrypt library for random number generation"
151	default y
152	select TINYCRYPT_SHA256 if !BT_USE_PSA_API
153	select TINYCRYPT_SHA256_HMAC if !BT_USE_PSA_API
154	select TINYCRYPT_SHA256_HMAC_PRNG if !BT_USE_PSA_API
155	depends on BT_HOST_CRYPTO
156	help
157	  When selected, will use tinycrypt library for random number generation.
158	  This will consume additional ram, but may speed up the generation of random
159	  numbers.
160
161	  Otherwise, random numbers will be generated through multiple HCI calls,
162	  which will not consume additional resources, but may take a long time,
163	  depending on the length of the random data.
164	  This method is generally recommended within 16 bytes.
165
166config BT_SETTINGS
167	bool "Store Bluetooth state and configuration persistently"
168	depends on SETTINGS
169	select MPU_ALLOW_FLASH_WRITE if ARM_MPU
170	help
171	  When selected, the Bluetooth stack will take care of storing
172	  (and restoring) the Bluetooth state (e.g. pairing keys) and
173	  configuration persistently in flash.
174
175	  When this option has been enabled, it's important that the
176	  application makes a call to settings_load() after having done
177	  all necessary initialization (e.g. calling bt_enable). The
178	  reason settings_load() is handled externally to the stack, is
179	  that there may be other subsystems using the settings API, in
180	  which case it's more efficient to load all settings in one go,
181	  instead of each subsystem doing it independently.
182
183	  Warning: The Bluetooth host expects a settings backend that loads
184	  settings items in handle order.
185
186if BT_SETTINGS
187config BT_SETTINGS_CCC_LAZY_LOADING
188	bool "Load CCC values from settings when peer connects"
189	depends on BT_CONN
190	default y
191	help
192	  Load Client Configuration Characteristic setting right after a bonded
193	  device connects.
194	  Disabling this option will increase memory usage as CCC values for all
195	  bonded devices will be loaded when calling settings_load.
196
197config BT_SETTINGS_DELAYED_STORE
198	# Enables delayed non-volatile storage mechanism
199	bool
200	help
201	  Triggers the storage of the CF and CCC right after a write.
202	  This is done in the workqueue context, in order to not block the BT RX
203	  thread for too long.
204
205config BT_SETTINGS_DELAYED_STORE_MS
206	int
207	default 1000
208	help
209	  (Advanced) Governs the timeout after which the settings write will
210	  take effect.
211
212config BT_SETTINGS_CCC_STORE_ON_WRITE
213	bool "Store CCC value immediately after it has been written"
214	depends on BT_CONN
215	select BT_SETTINGS_DELAYED_STORE
216	default y
217	help
218	  Store Client Configuration Characteristic value right after it has
219	  been updated. If the option is disabled, the CCC is only stored on
220	  disconnection.
221
222config BT_SETTINGS_CF_STORE_ON_WRITE
223	bool "Store CF value immediately after it has been written"
224	depends on BT_CONN && BT_GATT_CACHING
225	select BT_SETTINGS_DELAYED_STORE
226	default y
227	help
228	  Store Client Supported Features value right after it has been updated.
229	  If the option is disabled, the CF is only stored on disconnection.
230
231config BT_SETTINGS_USE_PRINTK
232	bool "Use snprintk to encode Bluetooth settings key strings"
233	depends on SETTINGS && PRINTK
234	default y
235	help
236	  When selected, Bluetooth settings will use snprintk to encode
237	  key strings.
238	  When not selected, Bluetooth settings will use a faster builtin
239	  function to encode the key string. The drawback is that if
240	  printk is enabled then the program memory footprint will be larger.
241endif # BT_SETTINGS
242
243config BT_FILTER_ACCEPT_LIST
244	bool "Filter accept list support"
245	help
246	  This option enables the filter accept list API. This takes advantage of the
247	  filtering feature of a BLE controller.
248	  The filter accept list is a global list and the same list is used
249	  by both scanner and advertiser. The filter accept list cannot be modified while
250	  it is in use.
251
252	  An Advertiser can filter which peers can connect or request scan
253	  response data.
254	  A scanner can filter advertisers for which it will generate
255	  advertising reports.
256	  Connections can be established automatically for accepted peers.
257
258config BT_LIM_ADV_TIMEOUT
259	int "Timeout for limited advertising in 1s units"
260	default 30
261	range 1 180
262	depends on BT_BROADCASTER
263	help
264	  After this timeout is reached, advertisement with BT_LE_AD_LIMITED flag
265	  set shall be terminated. As per BT Core Spec 5.2, Vol 3, Part C,
266	  Appendix A (NORMATIVE): TIMERS AND CONSTANTS it's required to be no more
267	  than 180s.
268
269config BT_CONN_TX_USER_DATA_SIZE
270	int
271	default 32 if 64BIT
272	default 16
273	help
274	  Necessary user_data size for allowing packet fragmentation when
275	  sending over HCI. See `struct tx_meta` in conn.c.
276
277config BT_CONN_FRAG_COUNT
278	int
279	default BT_MAX_CONN if BT_CONN
280	default BT_ISO_MAX_CHAN if BT_ISO
281	help
282	  Internal kconfig that sets the maximum amount of simultaneous data
283	  packets in flight. It should be equal to the number of connections.
284
285if BT_CONN
286
287config BT_CONN_TX_MAX
288	int "Maximum number of pending TX buffers with a callback"
289	default BT_BUF_ACL_TX_COUNT
290	range BT_BUF_ACL_TX_COUNT $(UINT8_MAX)
291	help
292	  Maximum number of pending TX buffers that have an associated
293	  callback. Normally this can be left to the default value, which
294	  is equal to the number of TX buffers in the controller.
295
296config BT_CONN_PARAM_ANY
297	bool "Accept any values for connection parameters"
298	help
299	  Some controllers support additional connection parameter ranges
300	  beyond what is described in the specification. Enabling this option
301	  allows the application to set any value to all connection parameters.
302	  The Host will perform no limits nor consistency checks on any of the
303	  connection parameters (conn interval min and max, latency and timeout).
304	  However, the Host will still use numerical comparisons between the
305	  min and max connection intervals in order to verify whether the
306	  desired parameters have been established in the connection.
307
308config BT_USER_PHY_UPDATE
309	bool "User control of PHY Update Procedure"
310	depends on BT_PHY_UPDATE
311	help
312	  Enable application access to initiate the PHY Update Procedure.
313	  The application can also register a callback to be notified about PHY
314	  changes on the connection. The current PHY info is available in the
315	  connection info.
316
317config BT_AUTO_PHY_UPDATE
318	bool "Auto-initiate PHY Update Procedure"
319	depends on BT_PHY_UPDATE
320	default y if !BT_USER_PHY_UPDATE
321	help
322	  Initiate PHY Update Procedure on connection establishment.
323
324	  Disable this if you want the PHY Update Procedure feature supported
325	  but want to rely on the remote device to initiate the procedure at its
326	  discretion or want to initiate manually.
327
328config BT_USER_DATA_LEN_UPDATE
329	bool "User control of Data Length Update Procedure"
330	depends on BT_DATA_LEN_UPDATE
331	help
332	  Enable application access to initiate the Data Length Update
333	  Procedure. The application can also a register callback to be notified
334	  about Data Length changes on the connection. The current Data Length
335	  info is available in the connection info.
336
337config BT_AUTO_DATA_LEN_UPDATE
338	bool "Auto-initiate Data Length Update procedure"
339	depends on BT_DATA_LEN_UPDATE
340	default y if !BT_USER_DATA_LEN_UPDATE
341	help
342	  Initiate Data Length Update Procedure on connection establishment.
343
344	  Disable this if you want the Data Length Update Procedure feature
345	  supported but want to rely on the remote device to initiate the
346	  procedure at its discretion or want to initiate manually.
347
348config BT_REMOTE_INFO
349	bool "Application access to remote information"
350	help
351	  Enable application access to the remote information available in the
352	  stack. The remote information is retrieved once a connection has been
353	  established and the application will be notified when this information
354	  is available through the remote_info_available connection callback.
355
356config BT_SMP
357	bool "Security Manager Protocol support"
358	select BT_CRYPTO
359	select BT_RPA
360	select BT_ECC
361	help
362	  This option enables support for the Security Manager Protocol
363	  (SMP), making it possible to pair devices over LE.
364
365if BT_SMP
366
367config BT_SECURITY_ERR_TO_STR
368	bool "Print security error codes as strings [EXPERIMENTAL]"
369	select EXPERIMENTAL
370	help
371	  This configuration enables printing of security error
372	  codes represented as strings.
373	  See bt_security_err_to_str() for more details.
374
375config BT_SMP_ERR_TO_STR
376	bool "Print SMP error codes as strings [EXPERIMENTAL]"
377	select EXPERIMENTAL
378	help
379	  This configuration enables printing of SMP error
380	  codes represented as strings.
381	  See bt_smp_err_to_str() for more details.
382
383config BT_PASSKEY_KEYPRESS
384	bool "Passkey Keypress Notification support [EXPERIMENTAL]"
385	select EXPERIMENTAL
386	help
387	  Enable support for receiving and sending Keypress Notifications during
388	  Passkey Entry during pairing.
389
390config BT_PRIVACY
391	bool "Device privacy"
392	help
393	  Enable privacy for the local device. This makes the device use Resolvable
394	  Private Addresses (RPAs) by default.
395
396	  Note:
397	  Establishing connections as a directed advertiser, or to a directed
398	  advertiser is only possible if the controller also supports privacy.
399
400config BT_PRIVACY_RANDOMIZE_IR
401	bool "Randomize identity root for fallback identities"
402	depends on BT_PRIVACY
403	select BT_SETTINGS
404	help
405	  Enabling this option will cause the Host to ignore controller-provided
406	  identity roots (IR). The Host will instead use bt_rand to generate
407	  identity resolving keys (IRK) and store them in the settings subsystem.
408
409	  Setting this config may come with a performance penalty to boot time,
410	  as the hardware RNG may need time to generate entropy and will block
411	  Bluetooth initialization.
412
413	  This option increases privacy, as explained in the following text.
414
415	  The IR determines the IRK of the identity. The IRK is used to both
416	  generate and resolve (recognize) the private addresses of an identity.
417	  The IRK is a shared secret, distributed to peers bonded to that
418	  identity.
419
420	  An attacker that has stolen or once bonded and retained the IRK can
421	  forever resolve addresses from that IRK, even if that bond has been
422	  deleted locally.
423
424	  Deleting an identity should ideally delete the IRK as well and thereby
425	  restore anonymity from previously bonded peers. But unless this config
426	  is set, this does not always happen.
427
428	  In particular, a factory reset function that wipes the data in the
429	  settings subsystem may not affect the controller-provided IRs. If
430	  those IRs are reused, this device can be tracked across factory resets.
431
432	  For optimal privacy, a new IRK (i.e., identity) should be used per
433	  bond. However, this naturally limits advertisements from that identity
434	  to be recognizable by only that one bonded device.
435
436	  A description of the exact effect of this setting follows.
437
438	  If the application has not setup an identity before calling
439	  settings_load()/settings_load_subtree("bt") after bt_enable(), the
440	  Host will automatically try to load saved identities from the settings
441	  subsystem, and if there are none, set up the default identity
442	  (BT_ID_DEFAULT).
443
444	  If the controller has a public address (HCI_Read_BD_ADDR), that becomes
445	  the address of the default identity. The Host will by default try to
446	  obtain the IR for that identity from the controller (by Zephyr HCI
447	  Read_Key_Hierarchy_Roots). Setting this config randomizes the IR
448	  instead.
449
450	  If the controller does not have a public address, the Host will try
451	  to source the default identity from the static address information
452	  from controller (Zephyr HCI Read_Static_Addresses). This results in an
453	  identity for each entry in Read_Static_Addresses. Setting this config
454	  randomizes the IRs during this process.
455
456config BT_RPA_TIMEOUT
457	int "Resolvable Private Address timeout"
458	depends on BT_PRIVACY
459	default 900
460	range 1 $(UINT16_MAX)
461	help
462	  This option defines how often resolvable private address is rotated.
463	  Value is provided in seconds and defaults to 900 seconds (15 minutes).
464
465config BT_RPA_TIMEOUT_DYNAMIC
466	bool "Support setting the Resolvable Private Address timeout at runtime"
467	depends on BT_PRIVACY
468	help
469	  This option allows the user to override the default value of
470	  the Resolvable Private Address timeout using dedicated APIs.
471
472config BT_RPA_SHARING
473	bool "Share the Resolvable Private Address between advertising sets"
474	depends on BT_PRIVACY && BT_EXT_ADV
475	help
476	  This option configures the advertising sets linked with the same
477	  Bluetooth identity to use the same Resolvable Private Address in
478	  a given rotation period. After the RPA timeout, the new RPA is
479	  generated and shared between the advertising sets in the subsequent
480	  rotation period. When this option is disabled, the generated RPAs
481	  of the advertising sets differ from each other in a given rotation
482	  period.
483
484config BT_SIGNING
485	bool "Data signing support"
486	help
487	  This option enables data signing which is used for transferring
488	  authenticated data in an unencrypted connection.
489
490config BT_SMP_APP_PAIRING_ACCEPT
491	bool "Accept or reject pairing initiative"
492	help
493	  When receiving pairing request or pairing response query the
494	  application whether to accept to proceed with pairing or not. This is
495	  for pairing over SMP and does not affect SSP, which will continue
496	  pairing without querying the application.
497	  The application can return an error code, which is translated into
498	  a SMP return value if the pairing is not allowed.
499
500config BT_SMP_SC_PAIR_ONLY
501	bool "Disable legacy pairing"
502	help
503	  This option disables LE legacy pairing and forces LE secure connection
504	  pairing. All Security Mode 1 levels can be used with legacy pairing
505	  disabled, but pairing with devices that do not support secure
506	  connections pairing will not be supported.
507	  To force a higher security level use "Secure Connections Only Mode"
508
509config BT_SMP_SC_ONLY
510	bool "Secure Connections Only Mode"
511	select BT_SMP_SC_PAIR_ONLY
512	help
513	  This option enables support for Secure Connection Only Mode. In this
514	  mode device shall only use Security Mode 1 Level 4 with exception
515	  for services that only require Security Mode 1 Level 1 (no security).
516	  Security Mode 1 Level 4 stands for authenticated LE Secure Connections
517	  pairing with encryption. Enabling this option disables legacy pairing.
518
519config BT_SMP_OOB_LEGACY_PAIR_ONLY
520	bool "Force Out Of Band Legacy pairing"
521	depends on !(BT_SMP_SC_PAIR_ONLY || BT_SMP_SC_ONLY)
522	help
523	  This option disables Legacy and LE SC pairing and forces legacy OOB.
524
525config BT_SMP_DISABLE_LEGACY_JW_PASSKEY
526	bool "Forbid usage of insecure legacy pairing methods"
527	depends on !(BT_SMP_SC_PAIR_ONLY || BT_SMP_SC_ONLY || \
528		     BT_SMP_OOB_LEGACY_PAIR_ONLY)
529	help
530	  This option disables Just Works and Passkey legacy pairing methods to
531	  increase security.
532
533config BT_SMP_ALLOW_UNAUTH_OVERWRITE
534	bool "Allow unauthenticated pairing for paired device"
535	help
536	  This option allows all unauthenticated pairing attempts made by the
537	  peer where an unauthenticated bond already exists.
538	  This would enable cases where an attacker could copy the peer device
539	  address to connect and start an unauthenticated pairing procedure
540	  to replace the existing bond. When this option is disabled in order
541	  to create a new bond the old bond has to be explicitly deleted with
542	  bt_unpair.
543
544config BT_ID_UNPAIR_MATCHING_BONDS
545	bool "Delete bond with same peer with other local identity when bonding"
546	help
547	  When a bond is about to complete, find any other bond with the same
548	  peer address (or IRK) and `bt_unpair` that bond before the event
549	  `pairing_complete`.
550
551	  Important: If this option is not enabled, the current implementation
552	  will automatically fail the bonding. See "RL limitation" below.
553
554	  Important: If this option is not enabled, as Peripheral, it may be too
555	  late to abort the bonding. The pairing is failed locally, but it may
556	  still be reported as successful on the Central. When this situation
557	  occurs, the Zephyr Peripheral will immediately disconnect. See "SMP
558	  limitation" below.
559
560	  [RL limitation]:
561	  The Host implementers have considered it unlikely that applications
562	  would ever want to have multiple bonds with the same peer. The
563	  implementers prioritize the simplicity of the implementation over this
564	  capability.
565
566	  The Resolve List on a Controller is not able to accommodate multiple
567	  local addresses/IRKs for a single remote address. This would prevent
568	  the Host from setting up a one-to-one correspondence between the Host
569	  bond database and the Controller Resolve List. The implementation
570	  relies on that capability when using the Resolve List. For performance
571	  reasons, there is the wish to not fallback to Host Address Resolution
572	  in this case.
573
574	  [SMP Limitation]:
575	  The Paring Failed command of the Security Manager Protocol cannot be
576	  sent outside of a Pairing Process. A Pairing Process ends when the
577	  last Transport Specific Key to be distributed is acknowledged at
578	  link-layer. The Host does not have control over this acknowledgment,
579	  and the order of distribution is fixed by the specification.
580
581config BT_ID_ALLOW_UNAUTH_OVERWRITE
582	bool "Allow unauthenticated pairing with same peer with other local identity"
583	depends on !BT_SMP_ALLOW_UNAUTH_OVERWRITE
584	help
585	  This option allows unauthenticated pairing attempts made by the
586	  peer where an unauthenticated bond already exists on other local
587	  identity. This configuration still blocks unauthenticated pairing
588	  attempts on the same local identity. To allow the pairing procedure
589	  unconditionally, please see the BT_SMP_ALLOW_UNAUTH_OVERWRITE
590	  configuration.
591
592config BT_SMP_USB_HCI_CTLR_WORKAROUND
593	bool "Workaround for USB HCI controller out-of-order events"
594	depends on BT_TESTING
595	help
596	  This option enables support for USB HCI controllers that sometimes
597	  send out-of-order HCI events and ACL Data due to using different USB
598	  endpoints.
599	  Enabling this option will make the central role not require the
600	  encryption-change event to be received before accepting key-distribution
601	  data.
602	  It opens up for a potential vulnerability as the central cannot detect
603	  if the keys are distributed over an encrypted link.
604
605config BT_FIXED_PASSKEY
606	bool "Use a fixed passkey for pairing"
607	help
608	  With this option enabled, the application will be able to call the
609	  bt_passkey_set() API to set a fixed passkey. If set, the
610	  pairing_confirm() callback will be called for all incoming pairings.
611
612config BT_USE_DEBUG_KEYS
613	bool "Security Manager Debug Mode"
614	help
615	  This option places Security Manager in a Debug Mode. In this mode
616	  predefined Diffie-Hellman private/public key pair is used as described
617	  in Core Specification Vol. 3, Part H, 2.3.5.6.1.
618
619	  WARNING: This option enables anyone to decrypt on-air traffic.
620	  Use of this feature in production is strongly discouraged.
621
622config BT_BONDABLE
623	bool "Bondable Mode"
624	default y
625	help
626	  This option enables support for Bondable Mode. In this mode,
627	  Bonding flag in AuthReq of SMP Pairing Request/Response will be set
628	  indicating the support for this mode.
629
630config BT_BONDING_REQUIRED
631	bool "Always require bonding"
632	depends on BT_BONDABLE
633	help
634	  When this option is enabled remote devices are required to always
635	  set the bondable flag in their pairing request. Any other kind of
636	  requests will be rejected.
637
638config BT_BONDABLE_PER_CONNECTION
639	bool "Set/clear the bonding flag per-connection [EXPERIMENTAL]"
640	select EXPERIMENTAL
641	help
642	  Enable support for the bt_conn_set_bondable API function that is
643	  used to set/clear the bonding flag on a per-connection basis.
644
645config BT_STORE_DEBUG_KEYS
646	bool "Store Debug Mode bonds"
647	help
648	  This option enables support for storing bonds where either of devices
649	  is using the predefined Diffie-Hellman private/public key pair as
650	  described in the Core Specification Vol 3, Part H, 2.3.5.6.1.
651
652	  WARNING: This option potentially enables anyone to decrypt on-air
653	  traffic.
654	  Use of this feature in production is strongly discouraged.
655
656config BT_SMP_ENFORCE_MITM
657	bool "Enforce MITM protection"
658	default y
659	help
660	  With this option enabled, the Security Manager will set MITM option in
661	  the Authentication Requirements Flags whenever local IO Capabilities
662	  allow the generated key to be authenticated.
663
664config BT_OOB_DATA_FIXED
665	bool "Use a fixed random number for LESC OOB pairing"
666	depends on BT_TESTING
667	help
668	  With this option enabled, the application will be able to perform LESC
669	  pairing with OOB data that consists of fixed random number and confirm
670	  value.
671
672	  WARNING: This option stores a hardcoded Out-of-Band value in the image.
673	  Use of this feature in production is strongly discouraged.
674
675config BT_KEYS_OVERWRITE_OLDEST
676	bool "Overwrite the oldest key if key storage is full"
677	help
678	  If a pairing attempt occurs and the key storage is full then the
679	  oldest key from the set of not currently in use keys will be selected
680	  and overwritten by the pairing device.
681
682config BT_KEYS_SAVE_AGING_COUNTER_ON_PAIRING
683	bool "Store aging counter every time a successful paring occurs"
684	depends on BT_SETTINGS && BT_KEYS_OVERWRITE_OLDEST
685	help
686	  With this option enabled, aging counter will be stored in settings every
687	  time a successful pairing occurs. This increases flash wear out but offers
688	  a more correct finding of the oldest unused pairing info.
689
690config BT_SMP_MIN_ENC_KEY_SIZE
691	int
692	prompt "Minimum encryption key size accepted in octets" if !BT_SMP_SC_ONLY
693	range 7 16
694	default 16 if BT_SMP_SC_ONLY
695	default 7
696	help
697	  This option sets the minimum encryption key size accepted during pairing.
698
699endif # BT_SMP
700
701rsource "Kconfig.l2cap"
702rsource "Kconfig.gatt"
703rsource "../services/Kconfig"
704
705config BT_MAX_PAIRED
706	int "Maximum number of paired devices"
707	default 0 if !BT_SMP
708	default 1
709	range 0 128
710	help
711	  Maximum number of paired Bluetooth devices. The minimum (and
712	  default) number is 1.
713
714config BT_CREATE_CONN_TIMEOUT
715	int "Timeout for pending LE Create Connection command in seconds"
716	default 3
717	range 1 655
718
719config BT_CONN_PARAM_UPDATE_TIMEOUT
720	int "Peripheral connection parameter update timeout in milliseconds"
721	default 5000
722	range 0 $(UINT16_MAX)
723	help
724	  The value is a timeout used by peripheral device to wait until it
725	  starts the first connection parameters update procedure after a
726	  connection has been established.
727	  The connection parameters requested will be the parameters set by the
728	  application, or the peripheral preferred connection parameters if
729	  configured.
730	  The default value is set to 5 seconds, to comply with the Bluetooth
731	  Core specification: Core 4.2 Vol 3, Part C, 9.3.12.2:
732	  "The Peripheral device should not perform a Connection Parameter
733	  Update procedure within 5 seconds after establishing a connection."
734
735config BT_CONN_PARAM_RETRY_COUNT
736	int "Peripheral connection parameter update retry attempts"
737	default 3
738	range 0 $(UINT8_MAX)
739	help
740	  This value corresponds to number of times to retry connection
741	  parameter update to attain the preferred value set in GATT
742	  characteristics in the Peripheral.
743
744config BT_CONN_PARAM_RETRY_TIMEOUT
745	int "Peripheral connection parameter update retry timeout in milliseconds"
746	default 5000
747	range 0 $(UINT16_MAX)
748	help
749	  The value is a timeout used by peripheral device to wait until retry
750	  to attempt requesting again the preferred connection parameters.
751
752endif # BT_CONN
753
754if BT_OBSERVER
755config BT_BACKGROUND_SCAN_INTERVAL
756	int "Scan interval used for background scanning in 0.625 ms units"
757	default 2048
758	range 4 16384
759config BT_BACKGROUND_SCAN_WINDOW
760	int "Scan window used for background scanning in 0.625 ms units"
761	default 18
762	range 4 16384
763
764config BT_EXT_SCAN_BUF_SIZE
765	int "Maximum advertisement report size"
766	depends on BT_EXT_ADV
767	range 1 1650
768	default 229
769	help
770	  Maximum size of an advertisement report in octets. If the advertisement
771	  provided by the controller is larger than this buffer size,
772	  the remaining data will be discarded.
773
774endif # BT_OBSERVER
775
776config BT_SCAN_WITH_IDENTITY
777	bool "Perform active scanning using local identity address"
778	depends on !BT_PRIVACY && (BT_CENTRAL || BT_OBSERVER)
779	help
780	  Enable this if you want to perform active scanning using the local
781	  identity address as the scanner address. By default the stack will
782	  always use a non-resolvable private address (NRPA) in order to avoid
783	  disclosing local identity information. By not scanning with the
784	  identity address the scanner will receive directed advertise reports
785	  for the local identity. If this use case is required, then enable
786	  this option.
787
788config BT_SCAN_AND_INITIATE_IN_PARALLEL
789	bool "Allow concurrent scanning and initiating"
790	depends on (BT_CENTRAL && BT_OBSERVER)
791	select BT_EXT_ADV if BT_BROADCASTER
792	select BT_SCAN_WITH_IDENTITY if !BT_PRIVACY
793	help
794	  Allow concurrent scanning and initiating.
795	  This will allow the application to initiate a connection
796	  to a peer device without stopping the scanner.
797	  If privacy is disabled, the scanner will use its identity
798	  address.
799	  This feature is only available when extended advertising
800	  HCI commands are used to prevent degraded performance
801	  when the advertiser is used.
802	  Scanning with a timeout is not supported when this
803	  feature is enabled.
804
805config BT_DEVICE_NAME_DYNAMIC
806	bool "Allow to set Bluetooth device name on runtime"
807	help
808	  Enabling this option allows for runtime configuration of Bluetooth
809	  device name.
810
811config BT_DEVICE_NAME_MAX
812	int "Maximum size in bytes for device name"
813	depends on BT_DEVICE_NAME_DYNAMIC
814	default 28
815	range 2 248
816	help
817	  Bluetooth device name storage size. Storage can be up to 248 bytes
818	  long (excluding NULL termination).
819
820config BT_DEVICE_NAME
821	string "Bluetooth device name"
822	default "Zephyr"
823	help
824	  Bluetooth device name. Name can be up to 248 bytes long (excluding
825	  NULL termination). Can be empty string.
826
827config BT_DEVICE_APPEARANCE_DYNAMIC
828	bool "Runtime Bluetooth Appearance changing"
829	help
830	  Enables use of bt_set_appearance.
831	  If CONFIG_BT_SETTINGS is set, the appearance is persistently stored.
832
833config BT_DEVICE_APPEARANCE_GATT_WRITABLE
834	bool "Allow authenticated peers to set GAP Appearance"
835	depends on BT_DEVICE_APPEARANCE_DYNAMIC
836
837config BT_DEVICE_APPEARANCE
838	int "Bluetooth device appearance"
839	range 0 $(UINT16_MAX)
840	default 0
841	help
842	  Bluetooth device appearance. For the list of possible values please
843	  consult the following link:
844	  https://www.bluetooth.com/specifications/assigned-numbers
845
846config BT_ID_MAX
847	int "Maximum number of local identities"
848	range 1 1 if BT_SCAN_AND_INITIATE_IN_PARALLEL
849	range 1 250
850	default 1
851	help
852	  Maximum number of supported local identity addresses. For most
853	  products this is safe to leave as the default value (1).
854
855config BT_DF
856	bool "Direction Finding support [EXPERIMENTAL]"
857	depends on !BT_CTLR || BT_CTLR_DF_SUPPORT
858	select EXPERIMENTAL
859	help
860	  Enable support for Bluetooth 5.1 Direction Finding.
861	  It will allow to: get information about antennae, configure
862	  Constant Tone Extension, transmit CTE and sample incoming CTE.
863
864if BT_DF
865
866config BT_DF_CONNECTIONLESS_CTE_RX
867	bool "Support for receive of CTE in connectionless mode"
868	depends on !BT_CTLR || BT_CTLR_DF_CTE_RX_SUPPORT
869	help
870	  Enable support for reception and sampling of Constant Tone Extension
871	  in connectionless mode.
872
873config BT_DF_CONNECTIONLESS_CTE_TX
874	bool "Support for transmission of CTE in connectionless mode"
875	depends on !BT_CTLR || BT_CTLR_DF_CTE_TX_SUPPORT
876	help
877	  Enable support for transmission of Constant Tone Extension in
878	  connectionless mode.
879
880config BT_DF_CONNECTION_CTE_RX
881	bool "Support for receive of CTE in connection mode"
882	depends on !BT_CTLR || BT_CTLR_DF_CTE_RX_SUPPORT
883	help
884	  Enable support for reception and sampling of Constant Tone Extension
885	  in connection mode.
886
887config BT_DF_CONNECTION_CTE_TX
888	bool "Support for transmission of CTE in connection mode"
889	depends on !BT_CTLR || BT_CTLR_DF_CTE_TX_SUPPORT
890	help
891	  Enable support for transmission of Constant Tone Extension in
892	  connection mode.
893
894config BT_DF_CONNECTION_CTE_REQ
895	bool "Support for CTE request procedure in connection mode"
896	depends on BT_DF_CONNECTION_CTE_RX
897	help
898	  Enable support for request of Constant Tone Extension in connection
899	  mode.
900
901config BT_DF_CONNECTION_CTE_RSP
902	bool "Support for CTE request procedure in connection mode"
903	depends on BT_DF_CONNECTION_CTE_TX
904	help
905	  Enable support for request of Constant Tone Extension in connection
906	  mode.
907
908config BT_DF_CTE_RX_AOA
909	bool "Antenna switching during CTE reception (AoA) feature"
910	depends on BT_DF_CONNECTIONLESS_CTE_RX || BT_DF_CONNECTION_CTE_RX
911	default y
912	help
913	  Enable support for antenna switching during CTE reception.
914	  Also known as Angle of Arrival mode.
915
916config BT_DF_CTE_TX_AOD
917	bool "Antenna switching during CTE transmission (AoD) feature"
918	depends on BT_DF_CONNECTIONLESS_CTE_TX || BT_DF_CONNECTION_CTE_TX
919	default y
920	help
921	  Enable support for antenna switching during CTE transmission.
922	  Also known as Angle of Departure mode.
923
924config BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES
925	bool "Use 16 bits signed integer IQ samples in connectionless IQ reports"
926	depends on BT_DF_CONNECTIONLESS_CTE_RX && BT_HCI_VS
927	help
928	  Direction Finging connectionless IQ reports provide a set of IQ samples collected during
929	  sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed
930	  integer, see Vol 4, Part E section 7.7.65.21. This option enables a vendor specific Host
931	  extension to handle connectionless IQ reports with samples that are in 16 bit signed
932	  integer format.
933
934config BT_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES
935	bool "Use 16 bits signed integer IQ samples in connection IQ reports"
936	depends on BT_DF_CONNECTION_CTE_RX && BT_HCI_VS
937	help
938	  Direction Finging connection IQ reports provide a set of IQ samples collected during
939	  sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed
940	  integer, see Vol 4, Part E sections 7.7.65.22. This option enables a vendor specific Host
941	  extension to handle connection IQ report with samples that are in 16 bit signed integer
942	  format.
943
944endif # BT_DF
945endif # BT_HCI_HOST
946
947config BT_ECC
948	bool "ECDH key generation support"
949	default y if BT_SMP && !BT_SMP_OOB_LEGACY_PAIR_ONLY
950	help
951	  This option adds support for ECDH HCI commands.
952
953config BT_TINYCRYPT_ECC
954	bool "Emulate ECDH in the Host using TinyCrypt library"
955	select TINYCRYPT
956	select TINYCRYPT_ECC_DH
957	select BT_LONG_WQ
958	depends on BT_ECC && (BT_HCI_RAW || BT_HCI_HOST)
959	default y if BT_CTLR && !BT_CTLR_ECDH
960	help
961	  If this option is set TinyCrypt library is used for emulating the
962	  ECDH HCI commands and events needed by e.g. LE Secure Connections.
963	  In builds including the BLE Host, if not set the controller crypto is
964	  used for ECDH and if the controller doesn't support the required HCI
965	  commands the LE Secure Connections support will be disabled.
966	  In builds including the HCI Raw interface and the BLE Controller, this
967	  option injects support for the 2 HCI commands required for LE Secure
968	  Connections so that Hosts can make use of those. The option defaults
969	  to enabled for a combined build with Zephyr's own controller, since it
970	  does not have any special ECC support itself (at least not currently).
971
972config BT_HOST_CCM
973	bool "Host side AES-CCM module"
974	help
975	  Enables the software based AES-CCM engine in the host. Will use the
976	  controller's AES encryption functions if available, or BT_HOST_CRYPTO
977	  otherwise.
978
979config BT_PER_ADV_SYNC_BUF_SIZE
980	int "Maximum periodic advertising report size"
981	depends on BT_PER_ADV_SYNC
982	range 0 1650
983	default 0
984	help
985	  Maximum size of a fragmented periodic advertising report. If the periodic
986	  advertising report provided by the controller is fragmented and larger
987	  than this buffer size, then the data will be discarded.
988	  Unfragmented reports are forwarded as they are received.
989
990config BT_DEBUG_ISO_DATA
991	bool "ISO channel data debug"
992	depends on BT_ISO_LOG_LEVEL_DBG
993	help
994	  Use this option to enable ISO channels data debug logs for the
995	  Bluetooth Audio functionality. This will enable debug logs for all
996	  ISO data received and sent.
997
998config BT_SMP_SELFTEST
999	bool "Bluetooth SMP self tests executed on init"
1000	depends on BT_SMP_LOG_LEVEL_DBG
1001	help
1002	  This option enables SMP self-tests executed on startup
1003	  to verify security and crypto functions.
1004
1005config BT_SMP_FORCE_BREDR
1006	bool "Force Bluetooth SMP over BR/EDR"
1007	depends on BT_SMP_LOG_LEVEL_DBG
1008	help
1009	  This option enables SMP over BR/EDR even if controller is not
1010	  supporting BR/EDR Secure Connections. This option is solely for
1011	  testing and should never be enabled on production devices.
1012
1013config BT_LOG_SNIFFER_INFO
1014	bool "Bluetooth log information for sniffer"
1015	help
1016	  This option enables the Bluetooth stack to log information such as
1017	  DH private key and LTK keys, which can be used by sniffers to decrypt
1018	  the connection without the use of Debug keys.
1019
1020	  WARNING: This option prints out private security keys such as
1021	  the Long Term Key.
1022	  Use of this feature in production is strongly discouraged
1023
1024config BT_TESTING
1025	bool "Bluetooth Testing"
1026	help
1027	  This option enables custom Bluetooth testing interface.
1028	  Shall only be used for testing purposes.
1029
1030config BT_CONN_DISABLE_SECURITY
1031	bool "Disable security"
1032	depends on BT_TESTING
1033	help
1034	  This option disables security checks for incoming requests enabling
1035	  to test accessing GATT attributes and L2CAP channels that would
1036	  otherwise require encryption/authentication in order to be accessed.
1037
1038	  WARNING: This option enables anyone to snoop on-air traffic.
1039	  Use of this feature in production is strongly discouraged.
1040
1041rsource "./classic/Kconfig"
1042
1043config BT_HCI_VS_EVT_USER
1044	bool "User Vendor-Specific event handling"
1045	help
1046	  Enable registering a callback for delegating to the user the handling of
1047	  VS events that are not known to the stack
1048
1049endmenu
1050