Commit graph

15409 commits

Author SHA1 Message Date
Fabio Baltieri
9b30667c77 build: drop LEGACY_INCLUDE_PATH support
LEGACY_INCLUDE_PATH has been defaulting to "n" and marked as deprecated
in both v3.2 and v3.3. Drop the option entirely for v3.4.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-02-21 15:06:48 +01:00
Siyuan Cheng
b475e1fcbf zdsp: add ARC DSPLIB backend for zdsp
Introduce ARC DSPLIB backend zdsp library for ARC target.
Add agu and restrict attributes to map with ARC DSPLIB

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-02-21 15:06:06 +01:00
Siyuan Cheng
a0db069978 zdsp: Introduce attribute marco for third-party backend
Introduce DSP_DATA and DSP_STATIC_DATA attribute marco
to support third-party backend

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-02-21 15:06:06 +01:00
Andrzej Głąbek
22b17e490b arch: arm: aarch32: Introduce z_arm_on_enter_cpu_idle() hook
Introduce an optional hook to be called when the CPU is made idle.
If needed, this hook can be used to prevent the CPU from actually
entering sleep by skipping the WFE/WFI instruction.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-02-21 15:03:30 +01:00
Ajay Parida
c69731a281 net: wifi_mgmt: Display TWT setup response status
Display the TWT setup response status.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2023-02-21 10:58:40 +01:00
Emil Gydesen
928e5bbcf0 Bluetooth: Audio: CAP inittiator broadcast stop procedure
Implemented support for stopping and deleting a
CAP broadcast source.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 13:24:34 +01:00
Emil Gydesen
9d0ec99315 Bluetooth: Audio: CAP initiator broadcast metadata update
Add support for the update metadata for broadcast audio
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 13:24:34 +01:00
Emil Gydesen
6f1bb59b26 Bluetooth: Audio: Implement bt_cap_initiator_broadcast_audio_start
Implement the CAP initiator broadcast audio start procedure.

This basically just verifies that the stream context
is set in the metadata, and then calls the BAP
procedure.

We define a new opaque struct, bt_cap_broadcast_source,
that is just an abstraction of the bt_audio_broadcast_source
but is used to indicate that these functions require a
broadcast source created by the CAP function (and not the
BAP) function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 13:24:34 +01:00
Maximilian Deubel
408f157e27 net: mgmt: add NET_REQUEST_WIFI_CMD_MAX
This patch adds an end-of-list marker to net_request_wifi_cmd to make it
easier to expand on it.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2023-02-20 11:30:57 +01:00
Emil Gydesen
333825a97b Bluetooth: Audio: Add BT_AUDIO_BROADCAST_ID_MAX
Add BT_AUDIO_BROADCAST_ID_MAX to denote the maximum value
of the BAP broadcast ID.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:29:44 +01:00
Emil Gydesen
a1c0bddde1 Bluetooth: Audio: Add presentation value macros
Add BT_AUDIO_PD_MAX and BT_AUDIO_PD_PREF_NONE to
better define the value range (and unit) of the
presentation delay.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 11:29:44 +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
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
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
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
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
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
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
Jun Qing Zou
cd79b81d4d lib: tftp_client: Add TFTP PUT function
Add tftp_put() API to support TFTP WRITE request.

Signed-off-by: Jun Qing Zou <jun.qing.zou@nordicsemi.no>
2023-02-20 09:50:23 +01:00
Jun Qing Zou
f7b0ccba0c lib: tftp_client: Receive file with arbitrary size
Add a callback for READ request to download files with arbitrary length.
Define TFTP_BLOCK_SIZE in API header for application to allocate buffer.

Signed-off-by: Jun Qing Zou <jun.qing.zou@nordicsemi.no>
2023-02-20 09:50:23 +01:00
Magdalena Kasenberg
5d2fb499af LE Audio: Allow server to initiate Codec Config procedure
Required by ASCS/SR/ACP/BV-07-C PTS test case.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-02-20 09:49:09 +01:00
Radosław Koppel
14a1b2ffec dts: Add _STRING_UNQUOTED string and string-array
This commit adds access to the string values without a quotes.

Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
Co-authored-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-02-20 09:49:00 +01:00
Peter Mitsis
87899c07f7 drivers: mm: Add module for tracking page usage
Adds a module for tracking page usage within a memory bank.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-02-20 09:48:44 +01:00
Ravi Dondaputi
1c547580e4 wifi: shell: Print beacon interval and DTIM period
Print beacon interval and DTIM period as part of Wi-Fi
status output.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
2023-02-20 09:46:34 +01:00
Emil Gydesen
e71460cdb8 Bluetooth: Audio: Only allow receiver to send start command
Only the receiver of the audio is allowed to send the
receiver start ready command.

Furthermore, this removes the automated transition to the
streaming state on the server, as the server now shall
call bt_audio_stream_start to put the stream into the
streaming state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-20 09:45:18 +01:00
Emil Gydesen
1ff32085f8 Bluetooth: Audio: Add comment for bt_audio_stream.audio_iso
The bt_audio_stream.audio_iso is something we only use for the
unicast client, and will only be set by the unicast client
operatiosn.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-19 20:56:44 -05:00
Kumar Gala
5af7ff4558 Bluetooth: Mesh: Cfg_cli: Remove deprecated functions
Remove deprecated functions that have been deprecated for at least
two releases now.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-02-19 20:48:06 -05:00
Juha Ylinen
fdffdedc41 net: lwm2m: Add event LWM2M_RD_CLIENT_EVENT_REG_UPDATE
New event LWM2M_RD_CLIENT_EVENT_REG_UPDATE to indicate
application that engine starts registration update.

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2023-02-19 20:44:02 -05:00
Jaska Uimonen
3b7f9c320d drivers: dai: modify dai_config_get API func
Modify dai_config_get function to have the config struct as argument.
This was not a showstopper but a request in the API review.

In the same patch modify all Intel dai drivers using the API to preserve
bisect/compile.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2023-02-19 20:43:14 -05:00
Rajavardhan Gundi
09d8123d0a drivers: sbs_gauge: Add support for additional properties
Fuel Gauge mode, status, charge current, charge voltage, design
capacity and design voltage are added.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2023-02-19 20:42:10 -05:00
Keith Short
db9faa30ce devicetree: Fix DT_FOREACH_PROP_ELEM_SEP example
Change the DT_FOREACH_PROP_ELEM_SEP example documented to use the
correct macro GPIO_DT_SPEC_GET_BY_IDX() instead of
GPIO_DT_SPEC_BY_IDX().

Signed-off-by: Keith Short <keithshort@google.com>
2023-02-08 07:14:47 -08:00
Ryan Erickson
d19e99b6d7 net: DHCPv4: Filter NAK during requesting state
During the requesting state, ignore NAKs from any
non-requesting server.  This gives the requesting
server a chance to ACK the request.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2023-02-08 19:05:13 +09:00
Ryan Erickson
6e58ba5dd8 modem: hl7800: Improve set bands API
Change the API to not block waiting for a reboot.
Reboot asynchronously.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2023-02-07 00:25:53 -08:00
Ryan Erickson
fe76aa0959 modem: hl7800: Fix event lock
Change event callback lock to a semaphore to avoid
priority issues the mutexes can cause.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2023-02-07 00:25:53 -08:00
Yasushi SHOJI
d51f874158 sys/cbprintf_internal.h: Silence spurious warnings with -save-temps
Because Z_CBPRINTF_STATIC_PACKAGE_GENERIC()'s first argument can be a
static memory location and we have `-Wall`, which implicitly enables
`-Waddress`, we get the following warnings when you enable
`EXTRA_CFLAGS=-save-temps=obj`.

    $ west build -b qemu_cortex_m3 samples/hello_world -- \
          -DEXTRA_CFLAGS=-save-temps=obj
       :
       :
    zephyr/kernel/fatal.c: In function 'k_sys_fatal_error_handler':
    zephyr/kernel/fatal.c:45:1125: warning: the comparison will
    always evaluate as 'true' for the address of 'data' will never be NULL
    [-Waddress]
       45 |         LOG_ERR("Halting system");
          |
    In file included from zephyr/include/zephyr/logging/log_backend.h:9,
                     from zephyr/include/zephyr/logging/log_ctrl.h:10,
                     from zephyr/kernel/fatal.c:13:
    .../include/zephyr/logging/log_msg.h:94:17: note: 'data' declared here
       94 |         uint8_t data[];
          |                 ^~~~

The reason why you don't see this warning without the flag is that GCC
tracks tokens and suppress the warning if it's from a macro expansion.  You
can disable this feature by adding `-ftrack-macro-expansion=0`:

    west build -b qemu_cortex_m3 samples/hello_world -- \
          -DEXTRA_CFLAGS=-ftrack-macro-expansion=0

Because `-save-temps` generates .i files, all macros have been expanded and
the information has already been lost.  All GCC sees at the compilation
stage are the comparisons of static memory locations.

This commit replaces `buf != NULL` with a static inline function
`___is_null()` to silence the compiler.  By passing a static memory
location to a function, the compiler doesn't see the comparisons of a
static memory locations against literal values.  But it's still able to
optimize out in the later stage.

There is another way to silence it; By ignoring `-Waddress` with a pragma.
But its effect is the macro wide and it's too wide IMHO.  Thus, I've
decided to go with the inline function.

To add one more note: The name `___is_null()` is obviously too generic.
But let's have it here until someone finds it problematic.

This closes #51528.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2023-02-06 10:05:26 +01:00
Bjarki Arge Andreasen
55aa282cdf net/net_pkt: Fix is_ppp dependency issue
The functions net_pkt_is_ppp() and net_pkt_set_ppp() are used by
both the l2 ppp subsystem (NET_L2_PPP) and the ppp uart based driver
(NET_PPP), but the function is only included when NET_PPP is enabled.

the l2 ppp subsystem does not depend on the uart based PPP driver, the
ppp uart driver does however depend on the l2 ppp subsystem. Including
the two functions should therefore be dependent on if the l2 ppp
subsystem is enabled using the symbol CONFIG_NET_L2_PPP instead of the
symbol CONFIG_NET_PPP

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-02-03 02:19:45 +09:00
Peter Mitsis
bdb49f21ad tracing: Resolve undefined event symbols
Fixes various unresolved symbols when kernel event object tracking
is enabled via CONFIG_TRACING=y.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-02-02 20:21:12 +09:00
Purdea Andrei
788c9422d3 usb: add const to usb_reqtype_is_to_host/device function calls
This makes it possible to call them on const structures without getting
a compiler warning.

Signed-off-by: Purdea Andrei <andrei@purdea.ro>
2023-02-01 03:53:01 +09:00
Georgij Cernysiov
3fd6893435 include: tracing: fix k_fifo peek defines
Tracing macros expect trace ENTER defines to end
with 'enter.

Correct 'k_fifo_peek_head' and 'k_fifo_peek_tail'
defines to end with 'enter' rather than 'entry'.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2023-02-01 03:51:28 +09:00
Conor Paxton
804aa29f89 riscv: smp: use devicetree to map hartids to zephyr cpus
For RISC-V, the reg property of a cpu node in the devicetree describes
the low level unique ID of each hart. Using devicetree macro's, a list
of all cpus with status "okay" can be generated.

Using devicetree overlays, a hart or multiple harts can be marked as
"disabled", thus excluding them from the list. This allows platforms
that have non-zero indexed SMP capable harts to be functionally mapped
to Zephyr's sequential CPU numbering scheme.

On kernel init, if the application has MP_MAX_NUM_CPUS greater than 1,
generate the list of cpu nodes from the device tree with status "okay"
and  map the unique hartid's to zephyr cpu's

While we are at it, as the hartid is the value that gets passed to
z_riscv_secondary_cpu_init, use that as the variable name instead of
cpu_num

Signed-off-by: Conor Paxton <conor.paxton@microchip.com>
2023-01-30 23:45:35 +00:00
Robert Lubos
2ab11953e3 net: context: Separate user data pointer from FIFO reserved space
Using the same memory as a user data pointer and FIFO reserved space
could lead to a crash in certain circumstances, those two use cases were
not completely separate.

The crash could happen for example, if an incoming TCP connection was
abruptly closed just after being established. As TCP uses the user data
to notify error condition to the upper layer, the user data pointer
could've been used while the newly allocated context could still be
waiting on the accept queue. This damaged the data area used by the FIFO
and eventually could lead to a crash.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-01-30 10:07:44 +00:00
Henrik Brix Andersen
ef61db0d29 devicetree: add DT_GPIO_HOG_* macros
Add DT_GPIO_HOG_* macros for accessing special GPIO hog node properties
from C code.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-01-27 14:38:52 -08:00
Hein Wessels
98112542c2 include: Add a macro to check pointer alignment against boundary
Add a new macro, IS_PTR_ALIGNED_BYTES() that verifies if a pointer
is aligned against a specific byte boundary supplied as argument.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-01-27 12:50:26 -08:00
Johann Fischer
2f310dc424 drivers: udc: add capability for MPS of control endpoint
New capability is to be used by the stack to adjust the corresponding
field in the device descriptor.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-01-27 16:11:20 +01:00
Johann Fischer
373d660d96 drivers: udc: remove unused and unsupported udc_ep_flush()
udc_ep_flush() is not implemented by the driver and is not
used by the USB device stack. Remove it for less confusion
when porting drivers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-01-27 16:11:20 +01:00