Commit graph

75184 commits

Author SHA1 Message Date
Emil Gydesen d2dfc3c475 Bluetooth: Audio: Add addition ISO chan state check before disconnect
Add state check for BT_ISO_STATE_CONNECTING before disconnecting
the CIS, else we could end up in a race condition where we
did not disconnect the connecting CIS, and then still have
a CIS afterwards.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:26:25 +01:00
Emil Gydesen 984ce52ddb Bluetooth: ISO: Fix state checks for bt_iso_chan_disconnect
The behavior of bt_iso_chan_disconnect depends on the
state of the ISO channel.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:26:25 +01:00
Emil Gydesen c67c7728a6 Bluetooth: Audio: Unicast client check ISO state before disconnect
Add a check to see if the ISO is connected before we attempt to
disconnect it. In the case where a stream was not in the streaming
state and was released, the CIS is unlikely to be connected.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:26:25 +01:00
Emil Gydesen fdc26eee78 Bluetooth: Audio: MCS reject long read if value changed
Add support for reject long read if a long value is
changed during the read.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:25:42 +01:00
Emil Gydesen 281d0a3fc8 Bluetooth: Audio: Add media player icon URL changed callback
Add support for notifying MCS a player icon URL change.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:25:42 +01:00
Emil Gydesen 4d595014ab Bluetooth: Audio: Add media player name changed callback
Add support for notifying about a player name change.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:25:42 +01:00
Emil Gydesen 89e907cb3d Bluetooth: Audio: Truncate MCS notifications per conn
When notifying a long (string) value in MCS, each
connection's MTU is taken into account when
(potentially) truncating the notification.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:25:42 +01:00
Emil Gydesen 788abf6811 Bluetooth: Audio: Fix truncation of MCS string notifications
The truncation of the MCS string notifications was incorrect.
As per the MCS specification, the MCS shall send ATT_MTU - 3
if the value cannot fit in the notification.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:25:42 +01:00
Sam Hurst 2d510fef8d usb_c: Notify DPM of Unsupported message reception
Notify the Device Policy Manager when an unsupported
message is received.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-02-20 11:24:07 +01:00
Magdalena Kasenberg 69a6ead783 bluetooth: tester: Add PACS test handling
Add support for testing Published Audio Capabilities Service server
with PTS.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-02-20 11:19:42 +01:00
Robert Lubos 8b678e49be net: ipv4: Fix net_ipv4_is_ll_addr function
net_ipv4_is_ll_addr() did not use a proper subnet mask to filter first
two bytes, therefore it could lead to incorrect results. This commit
fixes it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-02-20 11:19:14 +01:00
Robert Lubos 243af28a2f net: ipv4: Implement fallback to LL address
According to RFC3927, hosts with only IPv4 LL address should still be
able to send packets to destination w/o IPv4 LL address:

   A host with an IPv4 Link-Local address may send to a destination
   which does not have an IPv4 Link-Local address.  If the host is not
   multi-homed, the procedure is simple and unambiguous: Using ARP and
   forwarding directly to on-link destinations is the default route

This behaviour however was not possible with Zephyr, which only allowed
to use IPv4 LL source address for IPv4 LL destinations.

Fix this, by introducing a final fallback (only if IPv4 autoconf is
enabled), to select IPv4 LL address as a source address if no other
address is available.

Additionally, modify the ARP routine a bit if IPv4 LL address is in use.
There's no really point to forward the packet to gateway if IPv4 LL
address is used, as such addresses are not routable. Instead, try to
find the peer in local network in such case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-02-20 11:19:14 +01:00
Nick Ward 9c4d73d4cf logging: log_ctrl: remove vestige strdup prototypes
The associated functions don't exist.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-02-20 11:16:31 +01:00
Marcin Niestroj 9c8b4be073 boards: arm: support XIAO BLE Sense
This is a variant of XIAO BLE with additional features:
 * LSM6DS3TR-C 6D IMU (3D accelerometer and 3D gyroscope),
 * PDM microphone.

Since LSM6DS3TR-C is almost the same as LSM6DSL (the former has slightly
higher current consumption than the latter, but the register map looks
exactly the same), add devicetree node with "st,lsm6dsl" compatible.

LSM6DS3TR-C is powered directly by P1.08 pin and I2C pull-ups are also
connected to this IO pin. Add a fixed regulator, which will be always on
for this board, in order be able able to use this IMU out of the box.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2023-02-20 11:15:31 +01:00
Marcin Niestroj dade079345 boards: arm: xiao_ble: use spi2 instead of spi0
There are 3 SPI interfaces (spi[0-2]) while only 2 I2C
interfaces (i2c[0-1]). Configure spi2 instead of spi0, so that i2c0 (which
conflicts with spi0) can be used for IMU (on XIAO BLE SENSE board variant).

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2023-02-20 11:15:31 +01:00
Andriy Gelman 1e2111c9e5 samples: die_temp_polling: Add xmc45_relax_kit overlay
Adds overlay for the xmc45_relax_kit.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-02-20 11:14:15 +01:00
Andriy Gelman 0079cabb49 drivers: sensor: Add infineon xmc4xxx die temperature sensor
Adds die temperature driver for infineon xmc4xxx SoCs.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-02-20 11:14:15 +01:00
Adrian Bonislawski 1243fa7f2d drivers: counter: align ace rtc get_value with api
This will align ace rtc get_value parameter with counter api
and fix build warning

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-02-20 11:13:45 +01:00
Adrian Bonislawski c1b216d3bf drivers: counter: return status in ace rtc counter
This will align return value with counter API and fix build warning

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-02-20 11:13:45 +01:00
Adrian Bonislawski 9952576945 drivers: counter: fix ace counters build errors
This will fix includes and allow to successfully build ace counters

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-02-20 11:13:45 +01:00
Marco Argiolas 92a739e4b4 logging: shell command "disable" fails for "backend" subcommand
A fix to accept valid shell commands of the form `log backend
 shell_rtt_backend disable`, i.e. to affect all modules when no modules are
 specified.

Signed-off-by: Marco Argiolas <marco.argiolas@ftpsolutions.com.au>
2023-02-20 11:13:15 +01:00
Andreas Chmielewski 3ef08df10e tests: net: lwm2m: cover dtls releated code path
As long the code path differs in case DTLS is used, we need tests for
this.

Signed-off-by: Andreas Chmielewski <andreas.chmielewski@grandcentrix.net>
2023-02-20 11:12:29 +01:00
Chris Friedt 2eb53f4bd7 tests: net: socketpair: skip nonblocking tests on posix arch
The `fcntl()` call (`zsock_fcntl()`) does not seem to work
properly (specifically with `CONFIG_ARCH_POSIX`). This will
be resolved in subsequent work harmonizing the networking
subsystem and POSIX library.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-02-20 11:04:07 +01:00
Chris Friedt 494faf3e2c tests: net: socketpair: coverage for all C libraries
Previously, the test was only run for configurations that used
the Newlib C library. However, socketpair runs equally well
under the minimal libc, and picolibc, as well as the native
libc.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-02-20 11:04:07 +01:00
Chris Friedt b9fe11c7f2 tests: net: socketpair: use do not alias read and write
* do not define `read`, `write`, as different symbols
* use `recv`, and `send` as defined by
  `CONFIG_NET_SOCKETS_POSIX_NAMES`
* do not specify `(2)` as manual-page sections are
  somewhat irrelevant

Note: we use `CONFIG_NET_SOCKETS_POSIX_NAMES` here, and
`CONFIG_POSIX_API` in `samples/` to show that the socketpair
API is available in both configurations.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-02-20 11:04:07 +01:00
Chris Friedt c73b8ed4f3 tests: net: socketpair: put common includes in one header
This serves to increase SNR in the test sources (i.e. to
make test sources easier to read).

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-02-20 11:04:07 +01:00
Chris Friedt 750299534e tests: net: socketpair: rename files to be less redundant
Wow, this testsuite was really celebrating some redundancy
before.

While that is sometimes a good thing, it's also sometimes
better to be more concise.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-02-20 11:04:07 +01:00
Chris Friedt ee2656d83f tests: net: socketpair: remove test_socketpair_ prefix
The `test_socketpair_` prefix was leftover from the old ztest
framework.

It is also redundant, so remove it.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-02-20 11:04:07 +01:00
Chris Friedt bb465bd78c tests: net: socketpair: remove unused extern declarations
The declarations of extern test functions were leftover from
the old ztest framework.

They are unnecessary now.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-02-20 11:04:07 +01:00
Nicolas Pitre 3c440af975 riscv: pmp: provision for implementations with partial PMP support
Looks like some implementors decided not to implement the full set of
PMP range matching modes. Let's rearrange the code so that any of those
modes can be disabled.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-02-20 10:57:11 +01:00
Nicolas Pitre ea34acb62c riscv: stack PMP: fix CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT=y case
Let's honor CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT even for kernel
stacks. This saves one global PMP slot when creating the guard area for
the IRQ stack, and some hw implementations might require that anyway.

With this changes, arch_mem_domain_max_partitions_get() becomes much
more reliable and tests/kernel/mem_protect is more likely to pass even
with the stack guard enabled.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-02-20 10:57:11 +01:00
Alexander Chudov 1fcce98d13 bluetooth: normative 16-bit UUIDs for GATT added
Bluetooth SIG published at
https://www.bluetooth.com/specifications/assigned-numbers/ the Assigned
Numbers Document that contains normative list of 16-bit UUID.
Missing 16-bit UUIDs for GATT Services, GATT Descriptors and GATT
Characteristics added to uuid.h according to the revision 2023-02-13
of the document.

Signed-off-by: Alexander Chudov <chudov@gmail.com>
2023-02-20 10:56:06 +01:00
Jamie McCrae 8b27889c7f doc: release: 3.4: Add working release notes file
Adds a base working release notes file for the Zephyr 3.4 release.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-02-20 10:54:36 +01:00
Dominik Ermel a33186a8f9 drivers: flash: spi_nor: Return EINVAL when erase out of range
Fixes spi_nor_erase to return -EINVAL instead of -ENODEV
when erase requested is out of flash range.
This makes the SPI NOR return the same error as all other errors.

Fixes #54897

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-02-20 10:54:00 +01:00
Antoni Pokusinski f8b9f2fa70 boards: riscv: litex_vexriscv: doc: add SDI-MIPI support
Add documentation for the SDI-MIPI Video Converter board.

Signed-off-by: Antoni Pokusinski <apokusinski@internships.antmicro.com>
2023-02-20 10:53:43 +01:00
Daniel Leung 9776cb1a39 samples: zbus: runtime_obs_registration: fix running on QEMU
() This makes the stack for both consumer and producer threads
   larger to avoid stack corruption and overflow.

() Limit to 1 CPU to preserve ordering of output for twister.

() Remove the platform_exclude as they are passing now.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-02-20 10:53:25 +01:00
Robert Lubos 16a0e314ea drivers: net: Move Ethernet device definition for SLIP to ethernet
Currently, if CONFIG_SLIP_TAP is enabled (default for QEMU), and no
other Ethernet driver is enabled, the following warning is printed by
CMake:
    No SOURCES given to Zephyr library: drivers__ethernet

This happens because SLIP_TAP enabled Ethernet L2, but has no actual
sources in drivers/ethernet. This commit fixes this, by moving the
actual definition of the SLIP TAP Ethernet interface into a separate
file, within drivers/ethernet. Technically, in that configuration SLIP
defines a Ethernet device, implementing Ethernet API, so such a change
is justifiable, and prevents unwanted warning from being generated.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-02-20 10:52:20 +01:00
Saku Rautio (Ext) 7c00ecbbbf Samples: Philosophers: Revert stack size change
In commit 31e0d86484, the stack size
was unjustifiably changed from a base of *768*
(plus a configurable extra stack size) to *2048*.
This change broke our sample tests for one of our products, which has
less available memory for the threads' stacks.

The stack size is dropped to *1024* to align with the stack sizes
specified in the other samples, which were changed in commit
31e0d86484.

Signed-off-by: Saku Rautio (Ext) <saku.rautio@nordicsemi.no>
2023-02-20 10:49:38 +01:00
Andy Sinclair 5f63fff9c2 sys: linear_range: fix return value when window is outside range
linear_range_get_win_index does not behave correctly when the
window of values is above the linear range.  It reports
-ERANGE (partial intersection) instead of -EINVAL.

Extra conditions added for edge cases and tests cases updated.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-02-20 10:43:26 +01:00
Vinayak Kariappa Chettimada 3c0c9aca40 Bluetooth: Controller: Replace WFE use with k_cpu_atomic_idle()
Replace the use of WFE with Zephyr kernel supplied
k_cpu_atomic_idle() interface.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-02-20 10:34:27 +01:00
Vinayak Kariappa Chettimada b46b833a7b Bluetooth: Controller: Reuse cpu_sleep interface
Reuse cpu_sleep() interface consistently in Controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-02-20 10:34:27 +01:00
Vinayak Kariappa Chettimada 67fa62fe22 Bluetooth: Controller: Add a DSB in sleep interface
Add a DSB before doing WFE in cpu_sleep(), to ensure the
memory transactions are complete.

Add a note clarifying a dependency for the existing solution
(dependency is satisfied by ARCH code but is good to state
clearly).

Relates to commit f1264b7e47 ("drivers: entropy: nrf5: add
docs and a DSB in get_entropy_isr").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-02-20 10:34:27 +01:00
Anas Nashif 5770bdeb1a twister: better handling of error reporting
Stop counting errors as failures and report them as is. This fixes
issues with counting when retrying failures and errors.
We have been adding errors to failures and then double count them when
displaying information on the screen instead of keep an accurate count
in the counter class.

This is now fixed and we do report errors seperately, ie. build errors.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-20 10:20:14 +01:00
Krzysztof Kopyściński f31b3f03ad Tests: Bluetooth: Tester: improve stability by Flow Control and UARTE
Some tests may be unstable because of missing data from BTP frames.
Enabling Flow Control fixes the issue, but seems to work reliably
only along with UARTE.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2023-02-20 09:55:09 +01:00
Troels Nilsson c57095740f Tests: Bluetooth: Update EDTT and add new test cases
Updates EDTT to newest version and adds the new test cases

Update _controller_tests_inner.sh to support using packet inspection
and the new low-level device feature in EDTT

Build configs for the BSim test apps updated to support extended
advertising

Signed-off-by: Troels Nilsson <trnn@demant.com>
2023-02-20 09:54:54 +01:00
Krzysztof Chruscinski 67a6fe9312 arch: riscv: Add ARG_UNUSED to the unused argument
When compiler is more strict it triggers a warning that
'swap' argument is not used in arch_isr_direct_footer().
Adding ARG_UNUSED.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-02-20 09:54:01 +01:00
Jonathan Rico 3a9c825bab Net: Bluetooth: add enough room to user data
We need to make sure the user_data of the network buffer has enough room to
store the L2CAP metadata.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-02-20 09:53:51 +01:00
Jonathan Rico 2c00dd5fec Bluetooth: host: check net bufs have enough room in user_data
Since we accept buffers from external sources in L2CAP, we need to make
sure that we have enough room in user data to store the metadata necessary
for fragmentation over the HCI link.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-02-20 09:53:51 +01:00
Krishna T b136676772 net: lib: zperf: Add support to disable Nagle's algorithm
This helps in benchmarking smaller packets, esp. as this is the default
behaviour of iperf.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-02-20 09:53:43 +01:00
Théo Battrel bb5525a304 Bluetooth: Host: Update parameters doc of crypto.h
In file `include/zephyr/bluetooth/crypto.h` update the documentation for
the parameters related to the Additional Authentificated Data `aad` and
`aad_len` of functions `bt_ccm_decrypt` and `bt_ccm_encrypt`. It was using
the term `Additional input data`, it has been replaced by the term used in
the RFC linked in the functions description, `Additional authenticated
data`.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-02-20 09:53:35 +01:00