Linux Audio

Check our new training course

Embedded Linux Audio

Check our new training course
with Creative Commons CC-BY-SA
lecture materials

Bootlin logo

Elixir Cross Referencer

Loading...
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# Kconfig - Bluetooth LE stack configuration options

#
# Copyright (c) 2015-2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

menuconfig BLUETOOTH
	bool "Bluetooth support"
	default n
	select NANO_TIMEOUTS
	select NET_BUF
	select BLUETOOTH_LE if !BLUETOOTH_STACK_NBLE
	help
	  This option enables Bluetooth support.

if BLUETOOTH

choice
	prompt "Bluetooth Stack Selection"
	default BLUETOOTH_STACK_HCI
	help
	  Select the Bluetooth stack to compile.

config BLUETOOTH_STACK_HCI
	bool "HCI Stack"
	help
	  Select the Bluetooth stack to use with HCI drivers.

config BLUETOOTH_STACK_NBLE
	bool "Nordic BLE Stack"
	help
	  Select the Bluetooth stack to use with Nordic BLE drivers.

endchoice

comment "HCI Stack Configurations"
	depends on BLUETOOTH_STACK_HCI

config BLUETOOTH_LE
	bool "Bluetooth Low Energy (LE) support"
	default n
	select TINYCRYPT
	select TINYCRYPT_AES if BLUETOOTH_SMP
	select TINYCRYPT_AES_CMAC if BLUETOOTH_SMP
	select TINYCRYPT_SHA256
	select TINYCRYPT_SHA256_HMAC
	select TINYCRYPT_SHA256_HMAC_PRNG
	depends on BLUETOOTH_STACK_HCI
	help
	  This option enables Bluetooth Low Energy (LE) support.
	  Currently it is mandatory whenever Bluetooth support
	  (CONFIG_BLUETOOTH) is enabled.

if BLUETOOTH_LE
config BLUETOOTH_HCI_CMD_COUNT
	int "Number of HCI command buffers"
	default 2
	range 2 64
	help
	  Number of buffers available for HCI commands.

config BLUETOOTH_MAX_CMD_LEN
	int "Maximum supported HCI command length"
	default 64
	range 64 255
	help
	  Maximum length of each HCI command.

config BLUETOOTH_HCI_EVT_COUNT
	int "Number of HCI event buffers"
	default 8 if BLUETOOTH_CONN
	default 4 if !BLUETOOTH_CONN
	range 2 64
	help
	  Number of buffers available for HCI events. This number should
	  ideally be at least as large as the available outgoing buffers
	  to make sure we've got enough buffers to handle bursts of
	  Number of Completed Packets HCI events.

config BLUETOOTH_MAX_EVT_LEN
	int "Maximum supported HCI event length"
	default 68 if !BLUETOOTH_BREDR
	default 255 if BLUETOOTH_BREDR
	range 68 255
	help
	  Maximum size of each HCI event buffer. E.g. one big event
	  for LE is the Command Complete for Read Local Supported
	  Commands. It is a 3 byte Command Complete header + 65 byte
	  return parameters = 68 bytes in total.

config BLUETOOTH_RX_STACK_SIZE
	int "Size of the receiving fiber stack"
	default 1024
	range 1024 65536
	help
	  Size of the receiving fiber stack. This is the context from
	  which all event callbacks to the application occur. The
	  default value is sufficient for basic operation, but if the
	  application needs to do advanced things in its callbacks that
	  require extra stack space, this value can be increased to
	  accomodate for that.

config	BLUETOOTH_PERIPHERAL
	bool "Peripheral Role support"
	default n
	select BLUETOOTH_CONN
	help
	  Select this for LE Peripheral role support.

config BLUETOOTH_CENTRAL
	bool "Central Role support"
	default n
	select BLUETOOTH_CONN
	help
	  Select this for LE Central role support.

config BLUETOOTH_CONN
	bool
	select NANO_WORKQUEUE
	select SYSTEM_WORKQUEUE
	default n

if BLUETOOTH_CONN
config BLUETOOTH_ACL_IN_COUNT
	int "Number of incoming ACL data buffers"
	default 5
	range 2 64
	help
	  Number of buffers available for incoming ACL data.

config BLUETOOTH_L2CAP_IN_MTU
	int "Maximum supported L2CAP MTU for incoming data"
	default 65 if BLUETOOTH_SMP
	default 23 if !BLUETOOTH_SMP
	range 65 1300 if BLUETOOTH_SMP
	range 23 1300 if !BLUETOOTH_SMP
	help
	  Maximum size of each incoming L2CAP PDU.

config BLUETOOTH_ATT_MTU
	int "Attribute Protocol (ATT) channel MTU"
	default 50 if BLUETOOTH_SMP # BLUETOOTH_L2CAP_IN_MTU is big enough
				    # for two complete ACL packets
	default 23 if !BLUETOOTH_SMP
	range 23 BLUETOOTH_L2CAP_IN_MTU
	help
	  The MTU for the ATT channel. The minimum and default is 23,
	  whereas the maximum is limited by CONFIG_BLUETOOTH_L2CAP_IN_MTU.

config BLUETOOTH_ATT_PREPARE_COUNT
	int "Number of ATT prepare write buffers"
	default 0
	range 0 64
	help
	  Number of buffers available for ATT prepare write, setting
	  this to 0 disables GATT long/reliable writes.

config BLUETOOTH_SMP
	bool "Security Manager Protocol support"
	default n
	help
	  This option enables support for the Security Manager Protocol
	  (SMP), making it possible to pair devices over LE.

if BLUETOOTH_SMP
config BLUETOOTH_PRIVACY
	bool "Privacy Feature"
	default n
	help
	  Enable local Privacy Feature support. This makes it possible
	  to use Resolvable Private Addresses (RPAs).

config BLUETOOTH_RPA_TIMEOUT
	int "Resolvable Private Address timeout"
	depends on BLUETOOTH_PRIVACY
	default 900
	range 1 65535
	help
	  This option defines how often resolvable private address is rotated.
	  Value is provided in seconds and defaults to 900 seconds (15 minutes).

config BLUETOOTH_SIGNING
	bool "Data signing support"
	default n
	help
	  This option enables data signing which is used for transferring
	  authenticated data in an unencrypted connection.

config BLUETOOTH_SMP_SC_ONLY
	bool "Secure Connections Only Mode"
	default n
	help
	  This option enables support for Secure Connection Only Mode. In this
	  mode device shall only use Security Mode 1 Level 4 with exception
	  for services that only require Security Mode 1 Level 1 (no security).
	  Security Mode 1 Level 4 stands for authenticated LE Secure Connections
	  pairing with encryption. Enabling this option disables legacy pairing.

config	BLUETOOTH_USE_DEBUG_KEYS
	bool "Enable Security Manager Debug Mode"
	default n
	depends on BLUETOOTH_TINYCRYPT_ECC
	help
	  This option places Security Manager in a Debug Mode. In this mode
	  predefined Diffie-Hellman private/public key pair is used as described
	  in Core Specification Vol. 3, Part H, 2.3.5.6.1. This option should
	  only be enabled for debugging and should never be used in production.
	  If this option is enabled anyone is able to decipher encrypted air
	  traffic.

endif # BLUETOOTH_SMP

config BLUETOOTH_L2CAP_DYNAMIC_CHANNEL
	bool "L2CAP Dynamic Channel support"
	default n
	help
	  This option enables support for LE Connection oriented Channels,
	  allowing the creation of dynamic L2CAP Channels.

config BLUETOOTH_GATT_DYNAMIC_DB
	bool "GATT dynamic database support"
	default n
	help
	  This option enables GATT services to be added dynamically to database.

config BLUETOOTH_GATT_CLIENT
	bool "GATT client support"
	default n
	help
	  This option enables support for the GATT Client role.

config	BLUETOOTH_MAX_CONN
	int "Maximum number of simultaneous connections"
	default 1
	range 1 16
	help
	  Maximum number of simultaneous Bluetooth connections
	  supported. The minimum (and default) number is 1.

config	BLUETOOTH_MAX_PAIRED
	int "Maximum number of paired devices"
	default 1
	range 1 32
	help
	  Maximum number of paired Bluetooth devices. The minimum (and
	  default) number is 1.

endif # BLUETOOTH_CONN

config BLUETOOTH_TINYCRYPT_ECC
	bool "Use TinyCrypt library for ECDH"
	default n
	select TINYCRYPT_ECC_DH
	depends on MICROKERNEL
	help
	  If this option is set TinyCrypt library is used for emulating the
	  ECDH HCI commands and events needed by e.g. LE Secure Connections.
	  If not set controller crypto is used for ECDH and if
	  controller doesn't support required HCI commands LE Secure
	  Connections support will be disabled.

endif # BLUETOOTH_LE

config BLUETOOTH_DEBUG
	bool
	default n

choice
	prompt "Bluetooth debug type"
	depends on BLUETOOTH
	default BLUETOOTH_DEBUG_NONE

config BLUETOOTH_DEBUG_NONE
	bool "No debug log"
	help
	  Select this to disable all Bluetooth debug logs.

config	BLUETOOTH_DEBUG_LOG
	bool "Normal printf-style to console"
	select BLUETOOTH_DEBUG
	select STDOUT_CONSOLE
	select SYS_LOG
	help
	  This option enables Bluetooth debug going to standard
	  serial console.

config BLUETOOTH_DEBUG_MONITOR
	bool "Monitor protocol over UART"
	depends on BLUETOOTH_STACK_HCI
	select BLUETOOTH_DEBUG
	select CONSOLE_HAS_DRIVER
	help
	  Use a custom logging protocol over the console UART
	  instead of plain-text output. Requires a special application
	  on the host side that can decode this protocol. Currently
	  the 'btmon' tool from BlueZ is capable of doing this.

	  If the target board has two or more external UARTs it is
	  possible to keep using UART_CONSOLE together with this option,
	  however if there is only a single external UART then
	  UART_CONSOLE needs to be disabled (in which case printk/printf
	  will get encoded into the monitor protocol).

endchoice

config BLUETOOTH_DEBUG_COLOR
	bool "Use colored logs"
	depends on BLUETOOTH_DEBUG_LOG
	select SYS_LOG_SHOW_COLOR
	default y
	help
	  Use color in the logs. This requires an ANSI capable terminal.

config BLUETOOTH_MONITOR_ON_DEV_NAME
	string "Device Name of Bluetooth monitor logging UART"
	depends on BLUETOOTH_DEBUG_MONITOR
	default "UART_0"
	help
	 This option specifies the name of UART device to be used
	 for the Bluetooth monitor logging.

if BLUETOOTH_DEBUG
config	BLUETOOTH_DEBUG_HCI_CORE
	bool "Bluetooth HCI core debug"
	depends on BLUETOOTH_STACK_HCI
	default n
	help
	  This option enables debug support for Bluetooth HCI
	  core.

config	BLUETOOTH_DEBUG_CONN
	bool "Bluetooth connection debug"
	depends on BLUETOOTH_CONN
	default n
	help
	  This option enables debug support for Bluetooth
	  connection handling.

config	BLUETOOTH_DEBUG_KEYS
	bool "Bluetooth security keys debug"
	depends on BLUETOOTH_STACK_HCI
	depends on BLUETOOTH_SMP
	default n
	help
	  This option enables debug support for the handling of
	  Bluetooth security keys.

config	BLUETOOTH_DEBUG_L2CAP
	bool "Bluetooth L2CAP debug"
	depends on BLUETOOTH_CONN
	default n
	help
	  This option enables debug support for the Bluetooth
	  L2ACP layer.

config	BLUETOOTH_DEBUG_SMP
	bool "Bluetooth Security Manager Protocol (SMP) debug"
	depends on BLUETOOTH_STACK_HCI
	depends on BLUETOOTH_SMP
	default n
	help
	  This option enables debug support for the Bluetooth
	  Security Manager Protocol (SMP).

config	BLUETOOTH_SMP_SELFTEST
	bool "Bluetooth SMP self tests executed on init"
	depends on BLUETOOTH_DEBUG_SMP
	default n
	help
	  This option enables SMP self-tests executed on startup
	  to verify security and crypto functions.

config	BLUETOOTH_DEBUG_ATT
	bool "Bluetooth Attribute Protocol (ATT) debug"
	depends on BLUETOOTH_CONN
	default n
	help
	  This option enables debug support for the Bluetooth
	  Attribute Protocol (ATT).

config	BLUETOOTH_DEBUG_GATT
	bool "Bluetooth Generic Attribute Profile (GATT) debug"
	depends on BLUETOOTH_CONN
	default n
	help
	  This option enables debug support for the Bluetooth
	  Generic Attribute Profile (GATT).

endif # BLUETOOTH_DEBUG

config BLUETOOTH_BREDR
	bool "Bluetooth BR/EDR support [EXPERIMENTAL]"
	default n
	depends on BLUETOOTH_STACK_HCI
	select BLUETOOTH_CONN
	select BLUETOOTH_L2CAP_DYNAMIC_CHANNEL
	help
	  This option enables Bluetooth BR/EDR support"

endif # BLUETOOTH