Remove BT_HCI_DATAPATH_ID_DISABLED define as 0xFF, which is
reserved for future value for Data_Path_Id parameter.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add helpers to allow providing a `struct gpio_dt_spec` directly
to `gpio_pin_is_input` and `gpio_pin_is_output` functions.
Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
When turned on, the existing i2c dump code is use to log every I2C
transaction at debug level.
This can be very useful for detecting problems with I2C peripherals.
Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
If an i2c message is for just one byte, instead of logging it with a
hexdump after logging the other message info, just added the one byte to
the same log message.
Since most i2c messages are one byte, this significantly reduces the
number of messages and lines needed to log i2c transactions, from three
line per message to just one. It's also a lot easier to read.
Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
Add an argument to i2c_dump_msgs() to log the data from reads too. And
then rename the function to i2c_dump_msgs_rw() so the API doesn't
change. If the dump is done after a transaction is processed, as
opposed to before, then the read data is valid and can be very useful.
Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
Common STM32_EXTI_LINE_NONE for declaration and setting
of wakeup EXTI line when configured.
Signed-off-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
The emulator structure currently initializes a bus-level API that is
used to communicated register accesses to the emulator from the parent
bus.
Add support for declaring a backend API for emulators. This provides
tests a common way to interact with emulators of the same device type.
Signed-off-by: Keith Short <keithshort@google.com>
Not all emulators correspond to a real driver. Notably some tests don't
require a real driver. Provide a macro that initializes a stub driver.
Signed-off-by: Keith Short <keithshort@google.com>
allow disabling reports (synchronise but don't generate sync reports)
and allows enabling sync reporting with filtering of duplicates.
the default option remains to establish sync, with sync reports,
but without duplicate filtering.
Signed-off-by: Raphael Treccani-Chinelli <raphael.treccani@nordicsemi.no>
Bluetooth does not need to be enabled to register services,
therefore the newly introduced automatic bluetooth SMP transport
registration system can be simplified by returning enabling of
bluetooth back to the application.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Add a note to the GATT subscription flags' docstring to indicate what flags
are used internally and are not part of the API.
We might want to move them in their own struct member, something like
`internal_flags` in a subsequent change.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Wait until encrypt change to trigger the re-subscription quirk.
Otherwise it could fail with insufficient security.
Also gate it behind a kconfig to make apparent its dependencies:
If `add_subscriptions()` is executed in the first place, that means that
the device was bonded and thus that it has to encrypt the link eventually.
`BT_GATT_AUTO_SEC_REQ` should take care of that.
Also add a new flag to `bt_gatt_subscribe_params` to not send the same CCC
write multiple times in some cases.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
The limiting factor is the output bitmask that says which elements have
been filled in by the parser. This patch changes the bitmask type from int
to int64_t.
Signed-off-by: Björn Stenberg <bjorn@haxx.se>
The following fixes were applied:
- Multicast Rx packets stats were not recorded due not parsing the
ethernet header. The function that tried to parse the ethernet header
was parsing the ethernet packet beyond the ethernet header.
- Added a new stats for unknown protocol which gets updated when the
ethernet layer encounters an unknown ethernet packet type.
Fixes#53994
Signed-off-by: Chamira Perera <chamira.perera@audinate.com>
llvm based toolchains need the same fix as exists for xcc that was
introduced with commit:
commit 5ef8db8ac9
Author: Daniel Leung <daniel.leung@intel.com>
Date: Wed Feb 3 14:23:51 2021 -0800
xcc: define __INT*_C() and __UINT*_C()
Since llvm based toolchains don't define these macros either.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
This provides a macro to disable stack protector for a function,
by specifying a function attribute. This is useful for boot
and early init code where we know for sure stack pointer and/or
stack content are being manipulated manually.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add a driver for the NXP MCUX Quadrature Decoder. The driver
is simple and only implements the phase a and phase b inputs. The
module has additional features which can be added in future PRs.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
We can leverage the FPU dirty state as an indicator for preemptively
reloading the FPU content when a thread that did use the FPU before
being scheduled out is scheduled back in. This avoids the FPU access
trap overhead when switching between multiple threads with heavy FPU
usage.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
FPU context switching is always performed on demand through the FPU
access exception handler. Actual task switching only grants or denies
FPU access depending on the current FPU owner.
Because RISC-V doesn't have a dedicated FPU access exception, we must
catch the Illegal Instruction exception and look for actual FP opcodes.
There is no longer a need to allocate FPU storage on the stack for every
exception making esf smaller and stack overflows less likely.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This reverts commit 5824ac90ecd8dd06d9ea117d345dbc6b069e5840.
The resulting revert takes into account changes to the predicate that
guards the use of `resp_addr`.
In the resulting revert, the predicate guarding the use of `resp_addr`
is differs from the naive revert because the intention of that predicate
is to know when `conn.c:bt_conn_le_create` decided to use the Host
resolver. And, the logic in `conn.c:bt_conn_le_create` has changed. The
changes to the logic in `conn.c` are in the following commits:
89780d715d5a09325ba9
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Change the http timeout mechanism to use poll instead of shutdown.
This should fix a problem where the shutdown will be called in a
different thread context which can lead to deadlocks on certain
driver implementations like offloaded modem drivers.
Fixes#53967
Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
Change the name of the custom macro defined for the stm32 devices
to fit the VND_PWM_xxx model
Keeping old deprecated macro, though.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Advertise Gigabit Ethernet if the PHY supports it. As with the
other speeds, it is assumed the PHY supports both duplex modes.
Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
The DMA API expects drivers in effect to maintain their own internal
state of channels. A channel that is already started may have dma_start
called on it again without effect. A channel that is already stopped may
have dma_stop called on it without effect.
In essence, start and stop are expected to act like events a DMA channels
finite state machine reacts to and if the state is already at the desired
one then nothing is to be done and no error has occurred.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
`<fcntl.h>`, `<net/if.h>`, and `<netinet/tcp.h>` were missing
`extern "C" { .. }"` which is required to avoid C++ name
mangling.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The POSIX spec requires that `SO_LINGER`, `SO_RCVLOWAT`,
and `SO_SNDLOWAT`, and `SOMAXCONN` are defined in
`<sys/socket.h>`. However, most of the existing socket
options and related constants are defined in
`<zephyr/net/socket.h>`.
For now, we'll co-locate them. It would be
good to properly namespace things.
Additionally, a no-op for setsockopt for `SO_LINGER` to
make things Just Work (TM) for now.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The `<netdb.h>` header typically defines `NI_MAXSERV` as a
reasonable default buffer size to use in applications that
use `getnameinfo()` to query a service name.
Most GNU and BSD systems define it by default so provide
it as a convenience so applications and 3rd-party libraries
do not encounter a compile error.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The spec requires `<sys/socket.h>` to declare
struct linger. Define it so that applications
and libraries do not get compile errors when
building against Zephyr.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The `FIONREAD` ioctl is usually used to query how many bytes
are available to read immediately from a specific file
descriptor. It's quite useful.
Define it here so that it can be used by applications.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Constants like `EAI_SYSTEM` should be defined in `<netdb.h>`
according to the spec.
In Zephyr, they should be defined via appropriately
namespaced z-variants (currently `DNS_EAI_SYSTEM` and so on).
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The spec requires that `in_addr_t` and `in_port_t` are both
defined when `<arpa/inet.h>` is included.
They were added to `<netinet/in.h>` in the previous commit.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The `<sys/ioctl.h>` header never actually declared
the `ioctl(2)` function prototype, so this fixes that.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The networking subsystem defines a rather large amount of POSIX
prototypes. However, it's done in a somewhat subversive way via
```
CONFIG_NET_SOCKETS_POSIX_NAMES
```
This option should be removed (or moved to POSIX) and the
networking implementations should be properly namespaced.
With that, the POSIX interface for network-related functions
can simply be a thin wrapper around the z-namespaced variants,
where applicable, or proper POSIX functions should actually
be moved to `lib/posix`.
This will also require a better solution to testing network
functionality on `native_posix` though. The ability to run
those tests and the supposed incompatibility between
`CONFIG_ARCH_POSIX` and `CONFIG_POSIX_API` was the main
motivation for adding `CONFIG_NET_SOCKETS_POSIX_NAMES`.
Eventually, with proper namespacing, these preprocessor
guards against redefining the same symbols can be
removed.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Defines DMA macro to help channel configuration and feature for the stm32
devices. Add one default value for most of the usecases
of peripheral DMA settings.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Adds the BT_AUDIO_METADATA_TYPE_AUDIO_STATE and
BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE metadata types from
the LE Audio assigned numbers document.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The current updatehub version forces user application to run in kernel
mode. This add necessary api syscalls to isolate userspace from kernel.
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
In case the IPv6 context pointer was not set on an interface (for
instance due to IPv6 context shortage), processing the RA message could
lead to a crash (i. e. NULL pointer dereference). Protect against this
by adding NULL pointer check, similarly to other functions in this area.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add support for configuring power save timeout in Wi-Fi chipsets.
Changes to configure power save inactivity timer.
Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
This service allows to synchronize the clock with the application
server.
Synchronization requests are initiated by the device in a regular
interval, configurable via Kconfig.
The implementation only supports TS003-2.0.0, as the previous revision
TS003-1.0.0 requested to temporarily disable ADR and and set nb_trans
to 1. This causes issues on the server side and is not recommended
anymore.
Signed-off-by: Martin Jäger <martin@libre.solar>