Commit graph

21541 commits

Author SHA1 Message Date
Emil Gydesen
05c67528e9 Bluetooth: conn: Move the ACL create functions to ACL group
Move the central role functions to create BT connections to
the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
a7b1ab4d3e Bluetooth: conn: Move bt_conn_le_conn_update to ACL group
Move the bt_conn_le_conn_update function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
11d7fd3afd Bluetooth: conn: Move bt_conn_create netbuf functions to ACL group
Moves the bt_conn_create_frag_timeout and
bt_conn_create_pdu_timeout to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
12ce4b8ba9 Bluetooth: conn: Move bt_conn_auth_* functions to ACL group
Move the bt_conn_auth_* functions to the newly create
ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
2cb6f3cf3e Bluetooth: conn: Start connected-only grouping
Start a group of functions guarded by CONFIG_BT_CONN
that are for connected-only functions. This is a
preparation step for allowing compilation and usage of
conn.c for ISO broadcast-only builds.

Moving all connected-only functionality into a single
group will also allow a possible move of all those
functions into an connected (ACL) only file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Krzysztof Chruscinski
0b79661cff logging: log_backend_swo: Add support for logging v2
Added support for logging v2 backend API for SWO backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-23 16:06:37 -04:00
Agata Ponitka
a279ff3958 Bluetooth: Mesh: Fix Health Client Model
Assigning a value to the msg_timeout parameter.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
22aafd422c Bluetooth: Mesh: Add missing Configuration Client API
Add missing API:
- Delete all group addresses in a SIG model's subscription list
- Update a network key
- Update an application key
- Get/Set Node Identity parameters
- Set virtual addtess for a SIG model
- Get/Set Key Refresh Procedures

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
e962cbb9fd Bluetooth: Mesh: Fix Configuration Client API
Hardcoded invalid Company ID was used instead of the parameter passed to
the API.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Vinayak Kariappa Chettimada
2c606239e2 Bluetooth: Controller: Make adva and tgta check function file static
The functions to check advertising and target address in a
PDU are used only inside the same file, hence make them file
static functions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-22 17:35:22 +02:00
Vinayak Kariappa Chettimada
33c06e6992 Bluetooth: Controller: Move assignments close to locality of reference
Minor refactor to move assignment statements close to their
locality of reference.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-22 17:35:22 +02:00
Vinayak Kariappa Chettimada
dee5b53b73 Bluetooth: Controller: Add target address check to extended scanning
Add target address check to extended scanning implementation
to detect invalid target address present in primary and
auxiliary channel PDU. Implementation is reuse of the check
used in the initiator after refactoring to pass parameter to
differentiate, its use for primary or auxiliary channel, and
for scanning or initiating.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-22 17:35:22 +02:00
Bud Wandinger
7a2b248b98 Bluetooth: Mesh: Added support for application access to mesh messages
Added bt_mesh_msg_send() which can be used by the application to
directly send model layer messages without local instantiation of
related models. Also added bt_mesh_msg_cb_set() which allows the
application to recieve mesh model layer messages without local
instantiation of related models.

Added bt_mesh_has_addr() which returns a bool. For unicast addresses,
this returns whether or not bt_mesh_elem_find() was successfull. If the
above mentioned bt_mesh_msg_cb_set() has been used by the application to
set a message callback, this returns true so that the stack attempts to
push every model message up to the application via the callback. If no
callback has been set, group addresses are searched to see if the stack
should pass the message up the stack to an instantiated model.

These changes allow applications that do not or can not instantiate
models to interface with models in a mesh network. This is applicable to
applications which act as a Bluetooth mesh gateway, sniffer, debugger,
network monitoring, non-mesh relay/extender, etc.

In app_keys.c friend.c net.c bt_mesh_elem_find() is used only to
determine the existance of an address. The full return value of
bt_mesh_elem_find() is unecessary and so was replaced by the above
mentioned bt_mesh_has_addr() function in these instances.

Simplified bt_mesh_elem_find() by removing the search through group
address. Since the above mentioned bt_mesh_has_addr() function handles
instances where group addresses must be searched, it was no longer
necessary to preform this search in this function.

Signed-off-by: Bud Wandinger <bud@budkoembedded.ca>
2021-07-22 06:23:56 -04:00
Lingao Meng
6e7939bc77 net: Fix missing __ASSERT_ON micro
Fix missing `__ASSERT_ON` cause build error
when not defined.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-07-22 06:21:55 -04:00
Manivannan Sadhasivam
573d70bdbf lorawan: Fix setting APP_KEY using MacMibSetRequest
For setting the APP_KEY, "mib_req.Param.AppKey" field should be used.
Fix it!

Fixes: #36540

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2021-07-22 06:11:41 -04:00
William Fish
6b67a568c9 Bluetooth: Mesh: Provisioning Start Fix
Resolves provisioning start process

Signed-off-by: William Fish <william.fish@manulytica.com>
2021-07-22 11:20:23 +03:00
Nicolas Pitre
b6855b23b9 net: bridge: Ethernet bridge shell utility
This provides a command line interface to query and modify
bridge instances, similar to Linux's brctl utility.
It can be used to inspect an application's bridge usage,
or manage a bridge of its own in a generic way.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-07-21 18:20:01 -04:00
Nicolas Pitre
89482f0119 net: ethernet: bridging support
This adds the ability to create Ethernet bridges for connecting
separate Ethernet segments together to appear as a single
Ethernet network.

This mimics the Linux functionality of the same name.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-07-21 18:20:01 -04:00
Flavio Ceolin
65e4add74e soc: cc13x2: Use residency policy
cc13x2_cc26x2 had its own power policy that was implementing the same
logic available in the default residency policy. Also, this policy was
unnecessarily setting up a timeout to wakeup the system. This is not
necessary, the power subsystem takes care of this.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-07-21 17:54:40 +03:00
Vinayak Kariappa Chettimada
636fbcd081 Bluetooth: Increase maximum allowed identity range to 64
Increase the maximum allowed identity range to 64.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00
Johan Hedberg
9aedfa676b Bluetooth: L2CAP: Fix CIDs in disconnect request
The destination and source CIDs were mixed up in the L2CAP
Disconnect request.

Fixes #36665

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2021-07-21 10:23:10 +03:00
Lingao Meng
40365babaa Bluetooth: Modify kconfig to use related path
Because we use the extended kconfig, we have already
supported relative paths, and it is clearer to use
relative paths in the bluetooth submodules.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-07-20 20:02:34 -04:00
Marcin Niestroj
24a4b0d852 lorawan: add name to the region choice in kconfig
Adding name allows to modify default choice by other modules or
applications.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-20 19:59:35 -04:00
Marcin Niestroj
70bd03799c logging: fs: allow maximum file size to be 1GB
So far the maximum configurable file size was limited to 16KB (2^14).
This might be enough for small partitions on internal flash. For
external QSPI memories however, this is certainly too restrictive.

Change maximum configurable file size to be 1GB, which is 2^30. Such
value will prevent signed integers overflow on 32-bit platforms, while
giving user full flexibility on how big log files should be.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-20 19:57:50 -04:00
Johann Fischer
244f69d1df usb: audio: prevent unaligned memory access
Prevent unaligned memory access.

Fixes #36873

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-07-20 16:56:26 +03:00
Vinayak Kariappa Chettimada
52db419e7a Bluetooth: Mesh: Update advertising duration calculation
Zephyr Bluetooth Low Energy Controller for mesh stack
uses pre-emptible continuous scanning, allowing advertising
events to be transmitted without delay when advertising is
enabled. No need to compensate with scan window duration.

Zephyr Bluetooth Low Energy Controller built for nRF51x
SoCs use CONFIG_BT_CTLR_LOW_LAT=y, and continuous scanning
cannot be pre-empted, hence, scanning will block advertising
events from being transmitted. Increase the advertising
duration by the amount of scan window duration to compensate
for the blocked advertising events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-20 13:35:49 +02:00
Vinayak Kariappa Chettimada
d84397f66d Bluetooth: Controller: Disable scan unreserved for LOW_LAT option
Disable use of BT_CTLR_SCAN_UNRESERVED with BT_CTLR_LOW_LAT.
nRF51x SoC needs to block any CPU use inside radio events,
hence use of radio without time reservation is required for
proper functioning of Controller in nRF51x.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-20 13:35:49 +02:00
Ioannis Papamanoglou
3415f71910 fs/nvs: prevent use after clear without init
Unset ready flag in nvs instance on clear.

Signed-off-by: Ioannis Papamanoglou <ioannis.papamanoglou@zonneplan.nl>
2021-07-20 13:34:45 +02:00
Robert Lubos
0722e1d896 net: lwm2m: Prevent notifications on non-readable resources
In case a non-readable resource gets updated (either by the server or
with an API), it makes no sense to send a notification in such case, as
no such resources are not included in notifications anyway.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-07-20 13:33:22 +02:00
Trond Einar Snekvik
abcbfed6c3 Bluetooth: Mesh: Provisioning PDU length defines
Adds length defines for all provisioning PDUs and uses them to split
prov_link.conf_inputs into separate fields.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-07-20 13:32:57 +02:00
Marcin Niestroj
eb0eb67481 logging: fs: fix leak of opened directories in check_log_file_exist()
Opened directory descriptor is leaked when returning 1. Fix that by
utilizing goto in function return path.

Fixes: 6b18e6992d ("subsys/loggin/log_backend_fs: added recovery after
  file lost")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-20 13:31:33 +02:00
Emil Gydesen
6ee70bd220 Bluetooth: Audio: Fix compile error if AICS is not enabled
Fix compile error if AICS is disable but AICS_CLIENT is
enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00
Emil Gydesen
e6d49645de Bluetooth: Audio: Guard MICS cli/srv structs
Add guards to the structs. This has two purposes:
1) Reduce size of only one of them are enabled
2) Fix a compile issue if only one of them were enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00
Emil Gydesen
dfc1fa39b6 Bluetooth: Audio: Guard VCS cli/srv structs
Add guards to the structs. This has two purposes:
1) Reduce size of only one of them are enabled
2) Fix a compile issue if only one of them were enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00
Emil Gydesen
d9213051bd Bluetooth: Audio: Fix MICS client without AICS compile error
Fix an error if MICS client was enabled without MICS AICS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00
Emil Gydesen
a9557531d3 Bluetooth: Audio: Fix compile error for VCS cli if no AICS/VOCS
If either AICS or VOCS clients were not enable, then the VCS
client could not be enabled as there was a compile error
in the function that registered callbacks.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00
Christopher Friedt
8e9d055d49 logging: use unsigned print format specifier
Even though it's highly unlikely that a component of time
would ever approach INT_MAX, use the unsigned specifier to mitigate
any unexpected behaviour.

Fixes #36814

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-07-19 20:04:03 -04:00
Emil Gydesen
61a3b1eb38 Bluetooth: uuid: Use BT_UUID_SIZE_ macros for bt_uuid_create
Use the UUID size macros instead of literal values in
bt_uuid_create.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 18:52:41 +02:00
Jedrzej Ciupis
25ebb42bd9 net: pkt: remove ieee802154_frame_retry flag
Flag that indicates if a given packet is being retransmitted has become
obsolete since more detailed flags were added. This commit removes the
flag and references to it altogether.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2021-07-19 18:15:56 +03:00
Vinayak Kariappa Chettimada
c1792c002d Bluetooth: Controller: Fix HCI reset assert initiating on coded PHY
Fix HCI Reset Command from asserting when there is pending
connection creation requested on coded PHY.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:19:25 +02:00
Vinayak Kariappa Chettimada
a5ac9c65f1 Bluetooth: Controller: Fix SID for legacy advertising reported
SID value for legacy advertising reported shall be 255.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:19:15 +02:00
Vinayak Kariappa Chettimada
8818c51cec Bluetooth: Controller: Use sizeof(uint8_t) for Tx Power field size
Use sizeof(uint8_t) for Tx Power field size instead of
auto-increment ++.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:19:00 +02:00
Vinayak Kariappa Chettimada
1922a0e982 Bluetooth: Controller: Add target address into common extended header
Add and retain in subsequent updates the target address
in the auxiliary PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:19:00 +02:00
Vinayak Kariappa Chettimada
6e0692fc4c Bluetooth: Controller: Fix legacy advertising PDU length initialization
Fix missing initialization of legacy advertising PDU length
when advertising sets are reused between extended and legacy
advertising modes.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:40 +02:00
Vinayak Kariappa Chettimada
e34ec9fc25 Bluetooth: Controller: Use BT_CTLR_BROADCAST_ISO Kconfig option
Use CONFIG_BT_CTLR_BROADCAST_ISO when CONFIG_BT_CTLR_ADV_ISO
or CONFIG_BT_CTLR_SYNC_ISO Kconfig option is supported.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Vinayak Kariappa Chettimada
ba6be70129 Bluetooth: Controller: Added comments for CSA #2 implementation
Added Bluetooth Specification references to the
implementation of Channel Selection algorithm #2 in the
Controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Vinayak Kariappa Chettimada
7b12723aad Bluetooth: Controller: Replace test vector inputs with auto variable
Replace hard coded channel map count and channel identifier
with an auto variables.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Vinayak Kariappa Chettimada
b329d198a7 Bluetooth: controller: Implement CSA #2 for SubEvents
Implement the functions required to calculate the SubEvent 1
and SubEvent n mapped channel indices.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Vinayak Kariappa Chettimada
3501148922 Bluetooth: Controller: Legacy vs Extended check for Periodic Adv HCI
Add the check for mixed use of Legacy vs Extended HCI
commands for Periodic Advertising related HCI commands.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 12:28:55 +02:00
Vinayak Kariappa Chettimada
591007206d Bluetooth: Controller: Fix directed advertising report
Fix extended advertising report to set the directed bit in
the event type when receiving directed non-connectable
advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 12:05:10 +02:00