Commit Graph

19860 Commits

Author SHA1 Message Date
Adrian Gielniewski 9fd9e231df net: openthread: Add platform message management
* Add CONFIG_OPENTHREAD_PLATFORM_MESSAGE_MANAGEMENT to allow enabling
message management by the platform.
* Add implementation of `otPlatMessagePoolInit`, `otPlatMessagePoolNew`
and `otPlatMessagePoolFree`.

Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
2024-11-16 15:21:20 -05:00
Matt Rodgers 2eda6df48a net: lib: http_server: add option to use ALPN
Web browsers don't support HTTP Upgrade mechanism to upgrade to HTTP2.
Instead, HTTP2 is supported only over TLS, and ALPN is used to negotiate
the protocol to be used.

This commit adds the supported HTTP protocols to the ALPN list, so that
web browsers can use HTTP2 with the server.

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-11-16 15:19:36 -05:00
Carles Cufi 9643ca20e9 nordic: Remove the nRF54H20 Engineering B
The production version of the nRF54H20 SoC is now available, so remove
the initial Engineering B (EngB) preview version.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-16 15:09:14 -05:00
Troels Nilsson fa3bfa5453 Bluetooth: Controller: Add margin to ISOALs time offset
To ensure payloads are delivered in time for the first subevent
in framed BIS, ISOAL now enforces a (configurable) margin of
the calculated time offset

Without this margin, it has been observed that a broadcaster
can end up consistently missing the first subevent in every third
event in a 7.5 ms ISO with a 10 ms SDU interval

The margin is a conservative 2 ms by default, but can likely be
set a lot lower for most implementations and HWs

Signed-off-by: Troels Nilsson <trnn@demant.com>
2024-11-16 15:08:59 -05:00
Kenneth Witham aa9c9228d4 net: mqtt-sn: Add Gateway Advertisement and Discovery process support
Fixes: #78010
This commit implements the "Gateway Advertisement and Discovery" process
defined in section 6.1 of the MQTT-SN specification.
This includes breaking changes to the transport interface and the default
included UDP interface implementation as support for UDP multicast
messages is added as implemented by the Paho MQTT-SN Gateway.

Signed-off-by: Kenneth Witham <kennywitham4@gmail.com>
2024-11-16 15:08:27 -05:00
Fin Maaß 8646a6c289 net: ethernet: arp: extend error log
If a gateway is not set for a interface,
also log the destination address.

Also print the interface index instead of the
interface pointer.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-16 14:56:57 -05:00
Guennadi Liakhovetski ae8c373314 LLEXT: fix a needless allocation
When CONFIG_LLEXT_STORAGE_WRITABLE is selected and .pre_located is
set, the BSS section is allocated by the user too, no need to
allocate it internally.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-11-16 14:56:23 -05:00
Pisit Sawangvonganan effe4bbf95 fb: cfb_shell: remove `dev` null check
Remove `dev` null check as `DEVICE_DT_GET` ensures compile-time
initialization.
Refer to commit 6eb371f (fb: initialize devices at compile time)

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 14:53:57 -05:00
Pisit Sawangvonganan cff8b6092e fb: cfb_shell: use `shell_strtol` in `cmd_set_kerning`
Switch from using direct `strtol` calls to `shell_strtol`.
This change leverages the extensive error handling provided
by `shell_strtol`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 14:53:57 -05:00
Pisit Sawangvonganan 06e0b2d1d6 fb: cfb: remove unnecessary `NULL` check and `NULL` assignment
Since the `fb` pointer is always assigned to `char_fb`, there is no need
for a `NULL` check. Additionally, removed setting `fb->buf` to `NULL` in
`cfb_framebuffer_init` as it will be overwritten by subsequent operations.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 14:53:57 -05:00
Pisit Sawangvonganan b7fe2a0bf9 fb: cfb: avoid multiple `strlen` calls in `draw_text`
Added `len` to store the result of `strlen(str)` to avoid
multiple calls to `strlen` in the `for-loop`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 14:53:57 -05:00
Emil Gydesen 8703381764 Bluetooth: Host: Add conversion macros from ms to various units
Add conversion macros from milliseconds to various units.
The purpose of these macros is to make it more clear/easier
for users to set and read values using milliseconds rather
than the various BT units which may be in 0.625, 1.25 or 10ms
units.

This is especially useful when comparing related values using
different units, such as advertising interval (0.625ms units)
and periodic advertising interval units (1.25ms units).

Users will have to be aware that these macros can provide slightly
different values than what is provided, if the provided values
do not match the units.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 14:06:03 -05:00
romain pelletant bea68273d5 lorawan: replace booleans by atomic flags
ADR status and devtime updated flags merged into an atomic bits array.
Related to Issue #55072

Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>

Signed-off-by: romain pelletant <romain.pelletant@fullfreqs.com>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 14:03:36 -05:00
romain pelletant ae0c1b72cf lorawan: add devicetime request support
Add devicetime request support.
Update lorawan sample
Related to Issue #55072

Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>

Signed-off-by: romain pelletant <romain.pelletant@fullfreqs.com>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 14:03:36 -05:00
romain pelletant 866905fd6a lorawan: change downlink callback
Change downlink callback to transport data using flags.
Related to Issue #55072

Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>

Signed-off-by: romain pelletant <romainp@kickmaker.net>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 14:03:36 -05:00
Jukka Rissanen f95ab280fb net: shell: dns: Print DNS server with network interface
If network interface is specified in the DNS server, then send
the queries to the server via the network interface. Print this
information in the server list.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:51:27 -05:00
Jukka Rissanen 6c95daf0ae net: dns: Bind DNS server to a network interface
Allow user to specify a network interface in the DNS server
list. User can append "%" and network interface name to the
DNS server to use this. If the network interface is mentioned
in the server list, then the DNS queries are sent via this network
interface.
For example setting the interfaces like this:
   192.0.2.2%eth1
   [2001:db8::2]:5353%ppp0

would cause the DNS queries to sent to 192.0.2.1 via eth1 in the first
example, and to 2001:db8::2 via ppp0 in the second example.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:51:27 -05:00
Jukka Rissanen 5f3e6212af net: utils: Port parsing failure in net_ipaddr_parse()
If trying to parse a string like 192.0.2.2:80/foobar and
setting the length to 12 which means to parse the IP address
and port, the parsing failed because it used one extra character
from the string. This issue was not present if the input string
was terminated after the port number.

Add a test case to catch this problem.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 13:51:27 -05:00
Pisit Sawangvonganan c120ffb31d bluetooth: shell: avoid multiple `strlen` calls
Add `len` to store the result of `strlen(addr_arg)` to avoid
multiple calls to `strlen` within the `for-loop` in
`cmd_scan_filter_set_addr`.
While the performance impact may be minimal in a shell context,
storing `strlen(addr_arg)` in `len` ensures a single call,
making the code more predictable and consistent.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-16 13:50:58 -05:00
Emil Gydesen c32210b003 Bluetooth: Host: ID: Log resolve list conflicts
In case of conflicts when calling bt_id_find_conflict
there was no way to easily determine what conflicted.

This is a rare occurance, but has happened when testing
against PTS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 13:43:59 -05:00
Juha Sunnari 51bc60e142 logging: frontends: stmesp: alternate message output option
Add an alternate message output option in which messages are
ended with an additional zero data byte with marker and timestamp.
Can be used to maintain compatibility with certain decoders.

Signed-off-by: Juha Sunnari <juha.sunnari@nordicsemi.no>
2024-11-16 13:37:02 -05:00
Martin Stumpf 2e0687cfd2 generic: add `frame_incomplete` where missing
The newly introduced `frame_incomplete` flag of
`display_buffer_descriptor` needed to be added at several places to
avoid uninitialized memory.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Seppo Takalo b3f3bce23e net: lib: coap_client: Add API to cancel specific request
Add a new API to cancel just one, or mathing requests,
instead of cancelling all ongoing requests.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo f0c6efe798 net: lib: coap_client: Stop polling on unneeded sockets
poll() only for sockets that have traffic ongoing or have some lifetime
left.
On socket failures during a poll(), stop listening for the socket.
Application can recover by reconnecting the socket.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo f72d634826 net: lib: coap_client: All error cases should be reported to callback
When the client fails when parsing the response and we stop proceeding,
we should report that to the application.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo c0eb260c2c net: lib: coap_client: Drop duplicate MID only after responding with Ack
Even if we receive duplicate confirmable message, we should still
respond with the Ack. Just don't deliver the second callback.

This is achieved by moving the MID deduplication to after Ack handling.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 48434a3c1b net: lib: coap_client: Return -errno from send_request()
Return the -errno when zsock_sendto() or zsock_recvfrom() fails, so
rest of the code can deal with return values, instead of separately
comparing errno and return value.


Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo a1368a7ff7 net: lib: coap_client: Drop duplicate responses
When response is already handled, don't forward anymore responses
to the client application.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 934c74f26e net: lib: coap_client: Don't match zero length tokens
If our internal structure is cleared, don't match tokens.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 7b0cce4418 net: lib: coap_client: Parse incoming MID only once
Incomming Message-ID is already parsed, use it as a parameter to
get_request_with_mid().

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Seppo Takalo 41ee35ae8b net: lib: coap_client: Don't clear internal structures on response
When response is received and handled, don't just clear the structure
but instead mark it as ongoing=false.
So if we later on receive a duplicate response for it, we can still
respond with Ack or Rst.

This is achieved by using release_internal_request() when we don't
expect any response for it and reset_internal_request() when we really
fill up a new request.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-11-16 13:33:28 -05:00
Mahesh Mahadevan d9bfdaf996 bluetooth: kconfig: Remove deprecated config
Remove deprecated Kconfig BT_MESH_PROV_DEVICE

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-11-13 19:08:29 -08:00
Jukka Rissanen 04d8b7c595 net: sockets: Cleanup socket properly if POSIX API is enabled
The sock_obj_core_dealloc() was not called if close() is called
instead of zsock_close(). This happens if POSIX API is enabled.

Fix this by calling zvfs_close() from zsock_close() and then
pass the socket number to zsock_close_ctx() so that the cleanup
can be done properly.

Reported-by: Andreas Ålgård <aal@ixys.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-08 15:56:39 -06:00
Zak Portnoy 32b1140066 mgmt: smp: shell: Respond on uart shell device when changed at runtime
Responses are currently set to the shell device that was configured
in the device tree.

The shell_uart driver allows for changing it's device during runtime
which leads to a situation where we recieve packets on one device
and respond on another.

This patch causes smp_shell_tx_raw to use the shell_uart device

Signed-off-by: Zak Portnoy <zakportnoy@gmail.com>
2024-11-08 13:57:09 -06:00
Jukka Rissanen fe56ce5a1c net: ipv6: fragmentation: Drop the packet if fragmentation fails
If we could not fragment the IPv6 packet, then drop it and do
not try to send it. Let the upper layer re-send the packet if
needed. It is causing more trouble if we try to send the packet
and not honor the MTU setting.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-08 11:37:49 -06:00
Jukka Rissanen 414316379a net: ipv4: fragmentation: Drop the packet if fragmentation fails
If we could not fragment the IPv4 packet, then drop it and do
not try to send it. Let the upper layer re-send the packet if
needed. It is causing more trouble if we try to send the packet
and not honor the MTU setting.

Fixes #81021

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-08 11:37:49 -06:00
Marcus Penate 72534b83e4 net: lib: sntp_simple: Handle responses from previous iterations
SNTP simple runs request iterations with exponential backoff.
If the net interface is a slower connection (ie. CAT M1 modems)
then the request will be sent but the response may take time to
be received, thus causing a timeout and another request to be sent.
Because of the nature of UDP and the fact that the same socket
(source IP/port combo) is being used for both requests, a delayed
response to the first request can be received as the response to the
second request, causing -EINVAL to be returned when the timestamps
mismatch (see subsys/net/lib/sntp/sntp.c). The solution provided
retries receiving the response when the timestamp is mismatched
(without sending an additional request).

Signed-off-by: Marcus Penate <marcus.penate@ellenbytech.com>
2024-11-08 11:37:02 -06:00
Håvard Reierstad 42ae483795 Bluetooth: Host: Ensure only connected peers affect `_bt_gatt_ccc.value`
The doc on `_bt_gatt_ccc.value` specifies that only connected peers
contribute to that value. But before this change, it was computed from
all entries in `_bt_gatt_ccc.cfg`, which include bonded but not
connected peers when `CONFIG_BT_SETTINGS_CCC_LAZY_LOADING` is set.

Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-11-08 11:35:42 -06:00
Emil Gydesen 7c40b071e4 Bluetooth: CSIP: Fix off-by-one in in lock restore
If the lock request was rejected by a set member we should
restore any previously written logs in reverse order.

However there was a off-by-one error in
csip_set_coordinator_write_lock_cb which caused us to attempt to
release member[1] instead of member[0] if member[1] was the
one that rejected the lock request.

Additionally, the lock_set_complete would be called
prematurely before we get the response from the restore
request.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-08 09:24:43 -06:00
Hui Bai 67980643d7 net: wifi: Fix 11k command errors
Add condition check so that the 11k flag will be updated for set
operation only.
Fix print log error when getting 11k status.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-11-07 18:42:15 -08:00
Chaitanya Tata fd7fc17810 net: wifi: Fix strings for missing enumerations
Enumerations were extended but respective strings were not added.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-07 18:41:53 -08:00
Chris Desjardins 862af5e903 fs: Fix null pointer exception caused by async fs_unmount
The mp pointer is in fs_file_t and fs_dir_t so if the fs pointer is made
NULL then subsequent file I/O operations will cause a NULL pointer
exception. Removing the mount point from the list is threadsafe and
should be sufficient.

Signed-off-by: Chris Desjardins <chris@arch-embedded.com>
2024-11-07 18:06:58 -06:00
Emil Gydesen 6c79fdf2ca Bluetooth: BAP: Fix bad state check for broadcast sink
The state check used != instead of == to very that it entered
the streaming state for all streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-07 18:04:34 -06:00
Jun Lin 69e85b25fe board: npcx: remove CONFIG_PINCTRL from defconfig of npcx boards
The CONFIG_PINCTRL is removed from the board's defconfig files.
Drivers which use pin control function should add "select PINCTRL"
in their Kconfig files.

Fixes #78619

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-11-07 08:59:14 -08:00
Henrik Skreslet e254a7f3c8 modem: cmux: added validation of cmux frame length
Validates cmux frame length and drops it if its larger
than the receive buffer

Signed-off-by: Henrik Skreslet <henrik.skreslet@gmail.com>
2024-11-07 08:31:48 -06:00
Emil Gydesen 1f1e4afa4f Bluetooth: CSIP: Handle disconnects while in procedure
If a device disconnects while we are in a procedure then
get_next_active_instance would return a service instance pointer
with the `conn` set to NULL.

The issue was caused by the set_info being potentially memset
when the device that disconnected was the one that held the
set_info pointer.
The solution is to not use a pointer, but rather a copy of the
set_info, so that the active.set_info value is still valid
after a disconnect.

Since the set_info is not longer a pointer to a specific
set_info from one of the members, the logs have been updated
as well, as the pointer of the active.set_info is useless
for debugging.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-06 14:42:51 -06:00
Robin Kastberg 5d52e39a52 random: random_timer.c Remove __GNUC__ ifdef
Remove an old __GNUC__ ifdef

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
2024-11-06 10:11:58 -08:00
Ryan McClelland 952daca695 debug: symtab: fix ignored type qualifiers on func return type
const is ignored on the function return type. A warning is reported with
-Wignored-qualifers. Remove the ignored const.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-06 09:52:36 -08:00
Daniel DeGrasse 07a8e3253a drivers: disk: mmc_subsys: remove CONFIG_MMC_VOLUME_NAME
Remove CONFIG_MMC_VOLUME_NAME, and set the disk name based on the
``disk-name`` property. This aligns with other disk drivers, and allows
for multiple instances of the mmc_subsys disk driver to be registered.

Add disk-name properties for all in tree definitions for the
mmc-subsys disk driver, and change all in tree usage of the disk name

Fixes #75004

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-05 15:25:10 -06:00
Daniel DeGrasse a1dc0b8b3e drivers: disk: sdmmc_subsys: remove CONFIG_SDMMC_VOLUME_NAME
Remove CONFIG_SDMMC_VOLUME_NAME, and set the disk name based on the
``disk-name`` property. This aligns with other disk drivers, and allows
for multiple instances of the sdmmc_subsys disk driver to be registered.

Add disk-name properties for all in tree definitions for the
sdmmc-subsys disk driver, and change all in tree usage of the disk name

Fixes #75004

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-05 15:25:10 -06:00