disk_access functions were called from an interupt context, thus
crashing on mutexes (no sleep is allowed in interrupt context).
The usage of a spinlock is permitted. The functions guarded by
the spinlock are executed very quickly anyway, so the spinlock
is applicable.
Signed-off-by: Alexi Demers <alexi.demers@axceta.com>
Usb "write" method never copies the input data buffer, it uses the
buffer pointer directly. The fact that it was on the stack made
the buffer ephemeral, and could disappear before the USB transfer
actually occurred. The data transmitted was then random. This commit
converts the transfer buffer to a static buffer, so that it always
exists for the duration of the USB transfer.
Known side-effect: if "read capacity" command is read twice
simultaneously, the same buffer will be used twice. As the capacity of a
USB drive should not change between 2 calls, this side effect can be
ignored.
Signed-off-by: Alexi Demers <alexi.demers@axceta.com>
This provides memory mappings with the ability to be initialized in their
paged-out state and be paged in on demand. This is especially nice for
anonymous memory mappings as they no longer have to allocate all memory
at mem_map time. This also allows for file mappings to be implemented by
simply providing backing store location tokens.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Having `CONFIG_EXCEPTION_STACK_TRACE_SYMTAB` to select the
`CONFIG_SYMTAB` or to explicitly not print the symbol name
during exception stack unwind seems unnecessary, as the extra
code to print the symbol name is negligible when compared with
the symbol table, so just remove it.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Currently it supports `esf` based unwinding only.
Then, update the exception stack unwinding to use
`arch_stack_walk()`, and update the Kconfigs & testcase
accordingly.
Also, `EXCEPTION_STACK_TRACE_MAX_FRAMES` is unused and
made redundant after this change, so remove it.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Currently it supports `esf` based unwinding only.
Then, update the exception stack unwinding to use
`arch_stack_walk()`, and update the Kconfigs & testcase
accordingly.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit introduces a new ARCH_STACKWALK Kconfig which
determines if the `arch_stack_walk()` is available should the
arch supports it.
Starting from RISCV, this will be able to converge the exception
stack trace implementation & stack walking features. Existing
exception stack trace implementation will be updated later.
Eventually we will end up with the following:
1. If an arch implements `arch_stack_walk()`
`ARCH_HAS_STACKWALK` should be selected.
2. If the above is enabled, `ARCH_SUPPORTS_STACKWALK` indicates
if the dependencies are met for arch to enable stack walking.
This Kconfig replaces `<arch>_EXCEPTION_STACK_TRACE`
2. If the above is enabled, then, `ARCH_STACKWALK` determines
if `arch_stack_walk()` should be compiled.
3. `EXCEPTION_STACK_TRACE` should build on top of the
`ARCH_STACKWALK`, stack traces will be printed when it
is enabled.
4. `ARCH_STACKWALK_MAX_FRAMES` will be removed as it is
replaced by `ARCH_STACKWALK_MAX_FRAMES`
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Fix missing implementation to handle Broadcast ISO MIC
failure during Broadcast ISO establishment, and during an
already established Broadcast ISO sync.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
We want to make sure `struct closure` fits in the user data, so a user data
size of `sizeof(struct closure)` is valid.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
This commit addresses an issue in net_context_bind() where unaligned
memory access was not properly handled when checking for INADDR_ANY.
The problem primarily affected MCUs like ARMv6 that don't support
unaligned memory access.
- Use UNALIGNED_GET() to safely access the sin_addr.s_addr field
- Ensures correct behavior on architectures with alignment restrictions
This fix improves compatibility and prevents potential crashes or
unexpected behavior on affected platforms.
Signed-off-by: Daekeun Kang <dkkang@huconn.com>
If we receive incoming neighbor solicitation packet and drop
it for some reason, ignore some of the errors which are not
really errors so that the icmpv6 handler does not complain.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure that incoming DAD NS message is allowed in
so that we can detect duplicate address detection NS packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Net capturing would not link when either IPv6 or IPv4 was switched off
due to missing symbols. This change allows for capturing a single IP
protocol only.
To reproduce:
samples/net/sockets/http_client/prj.conf
```
-CONFIG_NET_IPV4=y
+CONFIG_NET_IPV4=n
-CONFIG_NET_CONFIG_NEED_IPV4=y
+CONFIG_NET_CONFIG_NEED_IPV4=n
+
+CONFIG_NET_CAPTURE=y
```
This will cause the following linker error:
```
.../subsys/net/lib/capture/capture.c:648:
undefined reference to `net_if_ipv4_get_ttl'
```
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improved debuggability of IEEE 802.15.4 network management commands.
Some of these conditions were especially hard to debug (e.g. invalid
channels due to the wrong driver being selected, conflict between
settings, ...)
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Adds string names to the groups in MCUmgr when the enum mgmt
Kconfig is enabled to support listing names of groups
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a new MCUmgr group which allows for listing which groups are
supported by the MCUmgr server by remote devices.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a group callback function which can be used to iterate over
all the registered MCUmgr command groups
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
- Slightly improve the name of this kconfig adding the suffix
_POLL in order to highlight that this adds a callback
function used to poll data.
- Description was also updated to point out that this symbols
might not only use the (secure) entropy driver, but also
generic number generators, some of which are not really
secure.
- The symbol was move from Kconfig to Kconfig.tls-generic because
this is where MBEDTLS_ENTROPY_C is located and since
MBEDTLS_ENTROPY_HARDWARE_ALT depends on the former (it only
makes sense if the entropy module is also enabled), we add
also the "depends on".
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
ENABLED suffix does not really makes much sense for a kconfig
so it should be removed. Also other MBEDTLS symbols were recently
updated accordingly.
Moreover having it named exactly the same way as in Mbed TLS
symplifies the understanding of what this kconfig is doing.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Building with NEWLIBC triggers warnings about
snprintf since stdio is no longer automatically
included by printk.h
This PR switches to using snprintk to avoid these
warnings.
Fixes#77330
Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
According to recvmsg man page, msg_controllen should be set to the sum
of the length of all control messages in the buffer.
This is missing from the current recvmsg implementation.
This commit aims to fix this by updating msg_controllen each time control
data are added to the buffer.
This commit also fixes cases where the msg_controllen is cleared
incorrectly.
Fixes#77303
Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
Expanding the ZTEST shell to include a command that
accepts additional parameters, such as ztest run_testcase
<suite:test> -p any_value.
Adding the new ZTEST_P macro, to create the
parameterized test.
Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
Expand ztest_shell subcommands `run-testcase`
and `run-testsuite` to include additional parameter `-r`
repeat-iter. This allows to run a particular testcase or
testsuite several times.
Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
Initialize the missing chunk field when canceling a BLOB Transfer.
If you canceled a BLOB Transfer, the missing_chunk was not cleared in
the next BLOB Transfer. This can make it look like there are still
missing chunks, even though all chunks in the block have already been
received, and it does cause bugs.
Signed-off-by: Junho Lee <tot0roprog@gmail.com>
Adds an optional callback which can be used to append custom
fields to the image slot state command response
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
`OTS_CLIENT=y` and `OTS=n` is a valid config.
Since the logs weren't conditionally included, this flew under the radar
for a while.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
- got rid of "Others" menu
- JK I made a new one: "Common"
- moved all host-related opts to "Host" instead of "Others"
- moved all audio-related opts behind `if BT_AUDIO`
- moved only controller kconfig to controller/Kconfig.ll_sw_split
- it had a dependency there already
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Having all the configs be visible by default clutters the menuconfig
view. Make them visible only when the corresponding subsys or module is
enabled.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
All the network related shell activities should be under
network shell so moving it to "net bridge ..." command.
Add this information to migration guide.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add macros for converting between Max Packet Size and total payload
length. Allow drivers specify whether endpoint supports high-bandwidth
interrupt and high-bandwidth isochronous transfers.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Use COND_CODE_1() instead of UTIL_AND() to make it possible to only
define the HID_MPS_LESS_65_ macros up to value 64.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
wMaxPacketSize in endpoint descriptor is stored in little-endian order,
but the mps parameter passed to functions is in host order.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
This adds a kconfig option to force
tx blocking on serial. This way only rx
will use the interrupt.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
CONFIG_BT_CONN_TX_USER_DATA_SIZE is now used for callbacks in the host.
We don't want to limit ourselves to that, so change the wording to be
more generic.
In the future, the plan is to not use user_data at all, removing the
need for the kconfig altogether.
Also rename the structure that was referenced in the docstring.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Power off the SD card in `DISK_IOCTL_CTRL_DEINIT`, instead of only
waiting for the card to be idle then doing nothing. This is a safer
state for `DISK_IOCTL_CTRL_DEINIT`, which is documented as preparing the
disk to be removed from the system. It also has the advantage of
lowering power consumption while de-initialized.
Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit ensures that the state of the address can be changed from
the Deprecated state to the Preferred state.
Additionally, an issue with improper memory comparison size for the mesh
local prefix has been fixed.
Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
Added the battery level status char to bas service
as per bas_1.1 spec. Added BSIM test for BAS service
to test the NTF/INDs of BAS characteristics.
Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
dhcv4 server was not providing the dns server details to the
client because dns option was handled. Added the dns server
option to be send to the client as response form dhcpv4 server
Signed-off-by: Muhammad Haziq <muhammad.haziq@zintechnologies.com>
To make the scanner module more understandable and more streamlined, I
reworked the update mechanism of the scanner. The scanner tracks now the
parameters that were used to enable it and the reason why it is running.
This facilitates state logic and allows other modules to "start the
scanner", altough it is already running.
This is mostly a refactoring and not a functional change.
Added a test to verify the behavior.
Signed-off-by: Jan Müller <jan.mueller@nordicsemi.no>
add to task
The MBT server, as the MBT client currently sets the maximum chunk size
according to maximum supported segments in the accesss layer. This might
be suboptimal for some use cases.
The added Kconfig options give customers the option to fine tune it
themselves.
Future work will include addition of an API for the customer to modify
it also during runtime.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
Add conn parameter to status/flags callbacks of bt_vcp_vol_rend_cb
to differentiate between remote and local changes.
Signed-off-by: Chang An <chang.an_1@nxp.com>
Check if the frame is within the text address before saving
into the buffer, this eliminates the extra, uninitialized frame
at the end of the unwind.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Relocate stack unwind backends from `arch/` to perf's
`backends/` folder, just like logging/shell/..
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>