1# Bluetooth configuration options
2
3# Copyright (c) 2016 Intel Corporation
4# Copyright (c) 2021 Nordic Semiconductor ASA
5# SPDX-License-Identifier: Apache-2.0
6
7menuconfig BT
8	bool "Bluetooth"
9	# Some BT threads use co-op priorities to implement critical sections,
10	# will need some refactoring to work on SMP systems.
11	depends on !SMP
12	select NET_BUF
13	help
14	  This option enables Bluetooth support.
15
16if BT
17
18choice BT_STACK_SELECTION
19	prompt "Bluetooth Stack Selection"
20	default BT_HCI
21	help
22	  Select the Bluetooth stack to compile.
23
24config BT_HCI
25	bool "HCI-based"
26	help
27	  HCI-based stack with optional host & controller parts and an
28	  HCI driver in between.
29
30config BT_CUSTOM
31	bool "Custom"
32	help
33	  Select a custom, non-HCI based stack. If you're not sure what
34	  this is, you probably want the HCI-based stack instead.
35
36endchoice
37
38# The Bluetooth subsystem requires the system workqueue to execute at
39# a cooperative priority.
40config SYSTEM_WORKQUEUE_PRIORITY
41	range -256 -1
42
43if BT_HCI
44
45config BT_HCI_RAW
46	bool "RAW HCI access"
47	help
48	  This option allows to access Bluetooth controller
49	  from the application with the RAW HCI protocol.
50
51config BT_HCI_RAW_H4
52	bool "RAW HCI H:4 transport"
53	help
54	  This option enables HCI RAW access to work over an H:4
55	  transport, note that it still need to be selected at runtime.
56
57config BT_HCI_RAW_H4_ENABLE
58	bool "RAW HCI H:4 transport enable"
59	depends on BT_HCI_RAW_H4
60	help
61	  This option enables use of H:4 transport for HCI RAW access at
62	  build time.
63
64config BT_HCI_RAW_CMD_EXT
65	bool "RAW HCI Command Extension"
66	help
67	  This option enables HCI RAW command extension so the driver can
68	  register it own command table extension.
69
70config BT_PERIPHERAL
71	bool "Peripheral Role support"
72	select BT_BROADCASTER
73	select BT_CONN
74	default y if BT_HCI_RAW
75	help
76	  Select this for LE Peripheral role support.
77
78config BT_CENTRAL
79	bool "Central Role support"
80	select BT_OBSERVER
81	select BT_CONN
82	default y if BT_HCI_RAW
83	help
84	  Select this for LE Central role support.
85
86config BT_BROADCASTER
87	bool "Broadcaster Role support"
88	default y if !BT_OBSERVER
89	help
90	  Select this for LE Broadcaster role support.
91
92config BT_OBSERVER
93	bool "Observer Role support"
94	help
95	  Select this for LE Observer role support.
96
97rsource "Kconfig.adv"
98
99config BT_CONN
100	bool
101
102config BT_MAX_CONN
103	int "Maximum number of simultaneous connections"
104	depends on BT_CONN
105	range 1 250
106	default 2 if BT_MESH_GATT_CLIENT
107	default 1
108	help
109	  Maximum number of simultaneous Bluetooth connections
110	  supported.
111
112config BT_CONN_TX
113	bool
114	default BT_CONN || BT_ISO_TX
115	help
116	  Hidden configuration that is true if ACL or broadcast ISO is enabled
117
118config BT_LE_LOCAL_MINIMUM_REQUIRED_FEATURE_PAGE
119	int
120	default 1 if BT_FRAME_SPACE_UPDATE
121	default 0
122	depends on BT_LE_EXTENDED_FEAT_SET
123	help
124	  Minimum required feature page that must be supported.
125
126config BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE
127	int "Maximum supported feature page"
128	default BT_LE_LOCAL_MINIMUM_REQUIRED_FEATURE_PAGE
129	range BT_LE_LOCAL_MINIMUM_REQUIRED_FEATURE_PAGE 10
130	depends on BT_LE_EXTENDED_FEAT_SET
131	help
132	  Maximum feature page that can be stored for local supported features.
133
134config BT_LE_EXTENDED_FEAT_SET
135	bool "LL Extended Feature Set"
136	depends on !HAS_BT_CTLR || BT_CTLR_EXTENDED_FEAT_SET_SUPPORT
137	help
138	  Enable support for the LL Extended Feature Set feature.
139
140if BT_CONN
141config BT_CONN_DYNAMIC_CALLBACKS
142	bool "Dynamic connection callbacks"
143	default y
144	help
145	  Enable support for dynamic connection callbacks. This links in
146	  bt_conn_cb_register(). Disabling this config is safe. It will make
147	  uses of this and associated APIs fail to link. Note: Static registration
148	  through BT_CONN_CB_DEFINE() is always available and does not depend on
149	  this config.
150
151config BT_HCI_ACL_FLOW_CONTROL
152	bool "Controller to Host ACL flow control support"
153	# Enable if building a Host-only build
154	default y if !HAS_BT_CTLR && !BT_STM32_IPM && !BT_ESP32  && !BT_STM32WBA
155	# Enable if building a Controller-only build
156	default y if BT_HCI_RAW
157	select POLL
158	help
159	  Enable support for throttling ACL buffers from the controller
160	  to the host. This is particularly useful when the host and
161	  controller are on separate cores since it ensures that we do
162	  not run out of incoming ACL buffers.
163
164config BT_REMOTE_VERSION
165	bool "Allow fetching of remote version"
166	# Enable if building a Controller-only build
167	default y if BT_HCI_RAW
168	help
169	  Enable this to get access to the remote version in the Controller and
170	  in the Host through bt_conn_get_remote_info(). The fields in question
171	  can then be found in the bt_conn_remote_info struct.
172
173config BT_PHY_UPDATE
174	bool "PHY Update"
175	default y
176	depends on !HAS_BT_CTLR || BT_CTLR_PHY_UPDATE_SUPPORT
177	help
178	  Enable support for Bluetooth 5.0 PHY Update Procedure.
179
180config BT_DATA_LEN_UPDATE
181	bool "Data Length Update"
182	default y if ((BT_BUF_ACL_TX_SIZE > 27) || (BT_BUF_ACL_RX_SIZE > 27))
183	depends on !HAS_BT_CTLR || BT_CTLR_DATA_LEN_UPDATE_SUPPORT
184	help
185	  Enable support for Bluetooth v4.2 LE Data Length Update procedure.
186
187config BT_PER_ADV_SYNC_TRANSFER_RECEIVER
188	bool "Periodic Advertising Sync Transfer receiver"
189	depends on BT_PER_ADV_SYNC && BT_CONN && (!HAS_BT_CTLR || BT_CTLR_SYNC_TRANSFER_RECEIVER_SUPPORT)
190
191config BT_PER_ADV_SYNC_TRANSFER_SENDER
192	bool "Periodic Advertising Sync Transfer sender"
193	depends on (BT_PER_ADV_SYNC || BT_PER_ADV) && BT_CONN && (!HAS_BT_CTLR || BT_CTLR_SYNC_TRANSFER_SENDER_SUPPORT)
194
195config BT_SCA_UPDATE
196	bool "Sleep Clock Accuracy Update"
197	default y if BT_ISO_PERIPHERAL || BT_ISO_CENTRAL
198	depends on !HAS_BT_CTLR || BT_CTLR_SCA_UPDATE_SUPPORT
199	help
200	  Enable support for Bluetooth 5.1 Sleep Clock Accuracy Update Procedure
201
202config BT_TRANSMIT_POWER_CONTROL
203	bool "LE Power Control"
204	depends on !HAS_BT_CTLR || BT_CTLR_LE_POWER_CONTROL_SUPPORT
205	help
206	  Enable support for LE Power Control Request feature that is defined in the
207	  Bluetooth Core specification, Version 5.4 | Vol 6, Part B, Section 4.6.31.
208
209config BT_PATH_LOSS_MONITORING
210	bool "LE Path Loss Monitoring"
211	depends on !HAS_BT_CTLR || BT_CTLR_LE_PATH_LOSS_MONITORING_SUPPORT
212	help
213	  Enable support for LE Path Loss Monitoring feature that is defined in the
214	  Bluetooth Core specification, Version 5.4 | Vol 6, Part B, Section 4.6.32.
215
216config BT_SUBRATING
217	bool "LE Connection Subrating"
218	depends on !HAS_BT_CTLR || BT_CTLR_SUBRATING_SUPPORT
219	help
220	  Enable support for LE Connection Subrating feature that is defined in the
221	  Bluetooth Core specification, Version 5.4 | Vol 6, Part B, Section 4.6.35.
222
223config BT_FRAME_SPACE_UPDATE
224	bool "Frame Space Update"
225	depends on (!HAS_BT_CTLR || BT_CTLR_FRAME_SPACE_UPDATE_SUPPORT) && BT_CONN && BT_LE_EXTENDED_FEAT_SET
226	help
227	  Enable support for Bluetooth 6.0 Frame Space Update feature.
228
229config BT_CHANNEL_SOUNDING
230	bool "Channel Sounding [EXPERIMENTAL]"
231	select EXPERIMENTAL
232	depends on !HAS_BT_CTLR || BT_CTLR_CHANNEL_SOUNDING_SUPPORT
233	help
234	  Enable support for Bluetooth 6.0 Channel Sounding feature.
235
236config BT_CHANNEL_SOUNDING_TEST
237	bool "Channel Sounding Test [EXPERIMENTAL]"
238	select EXPERIMENTAL
239	depends on BT_CHANNEL_SOUNDING
240	help
241	  Enable support for Channel Sounding test mode.
242
243config BT_CHANNEL_SOUNDING_REASSEMBLY_BUFFER_SIZE
244	int "Subevent result reassembly buffer size"
245	depends on BT_CHANNEL_SOUNDING
246	range 239 5600
247	default 5600
248	help
249	  When the results for a CS subevent cannot fit into a single HCI event,
250	  it will be split up into multiple events and consequently, reassembled into a
251	  full CS subevent. This config sets the size of the reassembly buffer.
252
253config BT_CHANNEL_SOUNDING_REASSEMBLY_BUFFER_CNT
254	int "Subevent result reassembly buffer count"
255	depends on BT_CHANNEL_SOUNDING
256	range 1 BT_MAX_CONN
257	default 1
258	help
259	  Controls the number of the reassembly buffers for CS subevent
260	  results. Each running CS procedure is allocated one buffer and the
261	  number of concurrent CS procedures is limited by this value.
262
263endif # BT_CONN
264
265config BT_ISO
266	bool
267
268config BT_ISO_TX
269	bool
270
271config BT_ISO_RX
272	bool
273
274#TODO : Split between client(central) and server(peripheral)
275config BT_ISO_UNICAST
276	bool
277	depends on BT_CONN
278	select BT_ISO
279	select BT_ISO_TX
280	select BT_ISO_RX
281	help
282	  This option enables support for Bluetooth Unicast
283	  Isochronous channels.
284
285config BT_ISO_PERIPHERAL
286	bool "Bluetooth Isochronous Channel Unicast Peripheral Support"
287	depends on !HAS_BT_CTLR || BT_CTLR_PERIPHERAL_ISO_SUPPORT
288	depends on BT_PERIPHERAL
289	select BT_ISO_UNICAST
290	help
291	  This option enables support for Bluetooth Unicast
292	  Isochronous channels for the peripheral role.
293
294config BT_ISO_CENTRAL
295	bool "Bluetooth Isochronous Channel Unicast Central Support"
296	depends on !HAS_BT_CTLR || BT_CTLR_CENTRAL_ISO_SUPPORT
297	depends on BT_CENTRAL
298	select BT_ISO_UNICAST
299	help
300	  This option enables support for Bluetooth Broadcast
301	  Isochronous channels for the central role.
302
303config BT_ISO_BROADCAST
304	bool
305	select BT_ISO
306	select BT_EXT_ADV
307
308config BT_ISO_BROADCASTER
309	bool "Bluetooth Isochronous Broadcaster Support"
310	depends on !HAS_BT_CTLR || BT_CTLR_ADV_ISO_SUPPORT
311	select BT_ISO_BROADCAST
312	select BT_ISO_TX
313	select BT_BROADCASTER
314	select BT_PER_ADV
315	help
316	  This option enables support for the Bluetooth Isochronous Broadcaster.
317
318config BT_ISO_SYNC_RECEIVER
319	bool "Bluetooth Isochronous Synchronized Receiver Support"
320	depends on !HAS_BT_CTLR || BT_CTLR_SYNC_ISO_SUPPORT
321	depends on BT_OBSERVER
322	select BT_ISO_BROADCAST
323	select BT_ISO_RX
324	select BT_PER_ADV_SYNC
325	help
326	  This option enables support for the Bluetooth Isochronous
327	  Synchronized Receiver.
328
329if BT_ISO
330
331config BT_ISO_MAX_CHAN
332	int "Maximum number of simultaneous ISO channels"
333	depends on BT_ISO
334	default BT_MAX_CONN if BT_CONN
335	default 1
336	range 1 64
337	help
338	  Maximum number of simultaneous Bluetooth isochronous channels
339	  supported.
340
341config BT_ISO_TX_BUF_COUNT
342	int "Number of Isochronous TX buffers"
343	default 1
344	range 1 $(UINT8_MAX)
345	help
346	  Number of buffers available for outgoing Isochronous channel SDUs.
347
348config BT_ISO_TX_MTU
349	int "Maximum supported MTU for Isochronous TX buffers"
350	range 1 4095
351	default 247
352	help
353	  Maximum MTU for Isochronous channels TX buffers.
354	  This is the actual data payload. It doesn't include the optional
355	  HCI ISO Data packet fields (e.g. `struct bt_hci_iso_sdu_ts_hdr`).
356	  Set this value to 247 to fit 247 bytes of data within a single
357	  HCI ISO Data packet with Data_Total_Length of 255, utilizing
358	  timestamps.
359
360config BT_ISO_RX_BUF_COUNT
361	int "Number of Isochronous RX buffers"
362	default 1
363	range 1 $(UINT8_MAX)
364	help
365	  Number of buffers available for incoming Isochronous channel SDUs.
366
367config BT_ISO_RX_MTU
368	int "Maximum supported MTU for Isochronous RX buffers"
369	default 251
370	range 23 4095
371	help
372	  Maximum MTU for Isochronous channels RX buffers.
373	  This is the actual data payload. It doesn't include the optional
374	  HCI ISO Data packet fields (e.g. `struct bt_hci_iso_sdu_ts_hdr`)
375
376config BT_ISO_TEST_PARAMS
377	bool "ISO test parameters support"
378	help
379	  Enabling advanced ISO parameters will allow the use of the ISO test
380	  parameters for creating a CIG or a BIG. These test parameters were
381	  intended for testing, but can be used to allow the host to set more
382	  settings that are otherwise usually controlled by the controller.
383
384if BT_ISO_UNICAST
385
386config BT_ISO_MAX_CIG
387	int "Maximum number of Connected Isochronous Groups (CIGs) to support"
388	default 1
389	help
390	  Maximum number of CIGs that are supported by the host. A CIG can be
391	  used for either transmitting or receiving.
392
393endif # BT_ISO_UNICAST
394
395if BT_ISO_BROADCAST
396
397config BT_ISO_MAX_BIG
398	int "Maximum number of Broadcast Isochronous Groups (BIGs) to support"
399	default 1
400	range 1 BT_EXT_ADV_MAX_ADV_SET
401	help
402	  Maximum number of BIGs that are supported by the host. A BIG can be
403	  used for either transmitting or receiving, but not at the same time.
404
405endif # BT_ISO_BROADCAST
406endif # BT_ISO
407
408rsource "common/Kconfig"
409rsource "host/Kconfig"
410rsource "controller/Kconfig"
411rsource "crypto/Kconfig"
412rsource "lib/Kconfig"
413rsource "Kconfig.logging"
414
415config BT_SHELL
416	bool "Bluetooth shell"
417	select SHELL
418	select BT_PRIVATE_SHELL
419	select BT_TICKER_NEXT_SLOT_GET if BT_LL_SW_SPLIT
420	help
421	  Activate shell module that provides Bluetooth commands to the
422	  console.
423
424endif # BT_HCI
425
426config BT_COMPANY_ID
427	hex "Company Id"
428	default 0x05F1
429	range 0x0000 0xFFFF
430	help
431	  Set the Bluetooth Company Identifier for this device. The Linux
432	  Foundation's Company Identifier (0x05F1) is the default value for
433	  this option although silicon vendors and hardware manufacturers
434	  can set their own. Note that the controller's Company Identifier is
435	  controlled by BT_CTLR_COMPANY_ID. The full list of Bluetooth
436	  Company Identifiers can be found here:
437	  https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
438
439endif # BT
440