Add a 'continue' statement when the first section of a region is
detected, to avoid unnecessary indentation.
No functional change is introduced in this commit.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Fix the following warning
att.c:734:3: warning: label followed by a declaration is a C23 extension
[-Wc23-extensions]
734 | k_tid_t current_thread = k_current_get();
| ^
By wrapping that code as a compound statement
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Previously the net_linkaddr struct had pointers to the link address.
This is error prone and difficult to handle if cloning the packet as
those pointers can point to wrong place. Mitigate this issue by
allocating the space for link address in net_linkaddr struct. This will
increase the size of the net_pkt by 4 octets for IEEE 802.15.4 where the
link address length is 8, but there no increase in size if link address
is 6 bytes like in Ethernet/Wi-Fi.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add a function `bt_br_bond_exists()` to check if the address of the
classic device has been bonded.
Update release-notes-4.2.rst
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Fix that a lwm2m message is reset without executing a registered
callback on lwm2m_engine_context_close.
Signed-off-by: Sebastian Schoch <sebastian.schoch@husqvarnagroup.com>
The API has not changed since it was introduced so should no longer be
considered experimental.
Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
Define macros for encryption value,
#define BT_HCI_ENCRYPTION_OFF 0x00
#define BT_HCI_ENCRYPTION_ON_LE_AES_CCM 0x01
#define BT_HCI_ENCRYPTION_ON_BR_E0 0x01
#define BT_HCI_ENCRYPTION_ON_BR_AES_CCM 0x02
Use the macros to replace the hard code.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The LTK should not be generated from BR link key if there is a LTK
exists and BR LK is weaker.
Do not drive LTK from BR LK in the case.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Clarify that all max limit on RTOS objects set by Kconfig only apply
to objects whose control blocks were dynamically allocated. The
CMSIS-RTOSv2 impl layer itself does not restrict the number of
statically created RTOS objects.
Signed-off-by: Utsav Munendra <utsavm@meta.com>
Clarify thread Kconfigs to denote the maximum number of dynamically
allocated control blocks and stacks for threads. Allow application to
create any number of threads with statically allocated control block
and stack.
Signed-off-by: Utsav Munendra <utsavm@meta.com>
In order to use fstab with fatfs in addition to
littlefs a new driver fstab,fatfs was introduced
containing the required logic to detect and if
needed automount fatfs devices specified in fstab.
Additionally as the partition phandle is not needed
by fatfs and currently is specific to littlefs it
was moved from the common dts binding into the
littlefs binding.
Signed-off-by: Carlo Kirchmeier <carlo.kirchmeier@zuehlke.com>
Co-authored-by: Carlo Kirchmeier <carlo.kirchmeier@zuehlke.com>
Co-authored-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Add a Kconfig option to match the Mbed TLS define
instead of defining it based on CONFIG_SECURE_STORAGE.
This gives more flexibility regarding the potential re-definition of the
CONFIG_MBEDTLS_PSA_CRYPTO_STORAGE_C Kconfig option.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Ignore bootstrap 'transition done' state transition
(ENGINE_BOOTSTRAP_TRANS_DONE) from an invalid state. The client must be
in state ENGINE_BOOTSTRAP_REG_DONE to process a bootstrap finish command
received from the server.
The LwM2M client does not implement CoAP deduplication (rfc 7252,
section 4.5) and retransmissions of the bootstrap finish command `/bs`
would restart the registration client with undesired side effects.
Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
Set the default maximum argument count for the shell to 30
when the Wi-Fi shell is enabled, to ensure all Wi-Fi
commands work without failure.
Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
This commit changes log level for already registered callback from
warning to debug as this is cause unnecessary noise and doesn't indicate
actual issue. Caller gets a certain error code for this case which can
be handled properly.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
There is a corner case that the channel is in disconnecting status,
due to there is a disconnect request sent from peer.
At this time, the channel is status is `BT_L2CAP_CONNECTED`. But it
has been removed from `conn->channels` by calling the function
`l2cap_br_remove_tx_cid`.
And the disconnect event is notified upper layer via the callback
`ops->disconnected`. The thread of the callback context is blocked
due to the the calling of `printk` in the callback function.
Then the pending lower priority thread, sending the data in this
l2cap channel, is activated. Then in the function
`bt_l2cap_br_send_cb`, a NULL pointer will be got according to the
given CID. And unexpected behavior happens when accessing a NULL
pointer, since the invalid channel pointer is not checked in
function `bt_l2cap_br_send_cb`.
Check the channel pointer after function `bt_l2cap_br_lookup_tx_cid`
called. If the channel pointer is invalid, return error code
`-ESHUTDOWN` directly.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add an assert ensuring programming errors where the executor code
assumes there is a next node in the list for transaction/chained
submissions.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Extensions with the pre_located flag set, manage memory themselves,
including MMU permissions. Skip any such adjustments in LLEXT core.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Renamed BT_CSIP_SET_MEMBER_NOTIFIABLE to
BT_CSIP_SET_MEMBER_SIRK_NOTIFIABLE to be more specific.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Conform rfc6762 a mDNS responder should answer clients
which are not using the mDNS port in the source address
with unicast UDP to the same port as described in chapter 6.7
Fixes: #81657
Signed-off-by: Vincent van der Locht <vincent@synchronicit.nl>
When the link key of BR is upgraded, the encrypt key refresh event
will be notified. The link key is upgraded from weak to strong.
The LTK of LE should be derived from strong link key.
Start SMP pairing procedure to try to derive LTK from LK.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This fixes an issue where a subsequent Config Model Subscription Add
message with the same virtual address UUID would result in a Config
Model Subscription Status message with the Address field incorrectly set
to 0.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Some GATT services and profiles define specific behavior
based on whether the remote device is bonded or not.
The internal function, bt_addr_le_is_bonded, is the
only function to do this, but it was kept internal,
and could thus not be used for those services
without including hci_core.h.
The function has been moved to the public API
so that application can determine if a remote
address is bonded or not, and has been renamed
to not use the bt_addr namespace, but rather the
bt_le.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The existing implemented only attempted to send all notifications,
but if host was out of ATT TX buffers the notifications would fail
and the client may miss out on important information, and would be
a spec violation.
This commit refactors notificatios in TBS so that they are always
sent.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There is an issue that the L2CAP connect response function
`l2cap_br_conn_req_reply()` is called first. And then the ACL
disconnect function `bt_conn_disconnect()` is called following. But
the packet of `bt_conn_disconnect()` appears on the HCI bus first.
Add a flag `L2CAP_FLAG_DISCONNECT_ACL` to flag whether it is needed to
disconnect ACL connection.
Set the flag `L2CAP_FLAG_DISCONNECT_ACL` when result of the L2CAP
channel conn rsp is `BT_L2CAP_BR_ERR_SEC_BLOCK`.
Add a l2cap packet sent out callback `l2cap_br_conn_rsp_sent_cb()`.
When the callback triggered, disconnect the ACL connect with
`BT_HCI_ERR_AUTH_FAIL` if the flag `L2CAP_FLAG_DISCONNECT_ACL` has
been set.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
- added HCI command to send hci-reset in bt_disable() func, and
remove its call from the driver close() call.
- remove rsp buf pass to 'hci_reset_complete()' func as status is
already checked under 'bt_hci_cmd_send_sync()'.
Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
Add new tracing API which is called when core is exiting from idle.
Current implementation is using it to track CPU load. Implementation
in tracing_none is now weak so it can be used if given backend does
not support new API call.
When CONFIG_CPU_LOAD is enabled then sys_trace_idle also calls a
hook which stores the timing information when CPU entered idle.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add module which can measure CPU idle time. Idle time is measured in
the pre/post CPU idle hooks but they are not provided by this module.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Use Wi-Fi connecting to Qualcomm IPQ8074 AP, and run the UDP RX traffic
with Zperf, but zperf does not return the throughput number after
traffic completion nor any session started prints. After traffic
completion, ping from STA to AP and vice versa does not work. The
socket_service thread is found blocked forever at zsock_wait_data()
after dns_dispatcher_svc_handler() is called via trigger_work().
The root cause of this issue is:
STA received one DHCPv4 packet containing DHCPV4_OPTIONS_DNS_SERVER,
it will create DNS socket and registered to socket_service. Then STA
received another IPv6 router advertisement packet containing
NET_ICMPV6_ND_OPT_RDNSS, it will close socket and change the state of
poll_events to K_POLL_STATE_CANCELLED(8), then registered to
socket_service with same fd. In socket_service thread, zsock_poll()
called zsock_poll_update_ctx() when handled ZFD_IOCTL_POLL_UPDATE, and
it checked the state of poll_events was not K_POLL_STATE_NOT_READY(0),
then it will set pfd->revents to '|= ZSOCK_POLLIN'. Finally
trigger_work() can be called as 'ctx.events[i].revents > 0' is matched.
The fix of this issue is that, in zsock_poll_update_ctx(), it should
check the state of poll_events is neither K_POLL_STATE_NOT_READY nor
K_POLL_STATE_CANCELLED before setting revents as ZSOCK_POLLIN, to avoid
trigger_work be unexpectedly called.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
There is a case that if the local is a peripheral and a L2CAP server
with the security level 3,the mitm should be set to make sure the
security level can reach level 3.
But in current implementation, the MITM is not set because the MITM
of `Authentication_Requirements` parameter of remote is not set. And
the security level will be level 2 after the security pairing
procedure complete.
Add a function `bt_l2cap_br_get_max_sec_level` to
get the max level of the registered servers.
`
Force set the MITM bit if the max level is bigger than level 2 and
pairing method is not `just works`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The ethernet header size with VLAN tag is 18 bytes,
so the length check should accommodate this.
Signed-off-by: Christoph Seitz <christoph.seitz@infineon.com>
Do not update packet length for unsupported packet families.
AF_PACKET family used the IPv6 length update, which breaks the
packet length if there is a payload with bytes resembling a
IPv6 length field less then 6 or a IPv4 length field less
then 46.
Signed-off-by: Christoph Seitz <christoph.seitz@infineon.com>
Avoid a "defined but not used" warning on
`init_next_pending_timeseries_data` when
LWM2M_RESOURCE_DATA_CACHE_SUPPORT is enabled but not LWM2M_VERSION_1_1.
Signed-off-by: Etienne de Maricourt <edmecomemail@gmail.com>
Remove a kconfig dependency on BOARD_NATIVE_POSIX which
does not really exist anymore.
Replace a comment mention of native_posix with native_posix.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The config LOG_USE_VLA depends on that MISRA_SANE is not set.
Unfortunately the IAR toolchain can't handle vla:s inside a
statement, which the LOG_USE_VLA macro does.
I've added a new, hidden config to check if vla is ok inside
statements, SUPPORT_VLA_IN_STATEMENTS. Default is always y, but
a toolchain can override it so that VLA is not used by
Z_LOG_MSG_ON_STACK_ALLOC.
Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
The backend uses a new USB device stack and bulk endpoints. Only a
single instance of the backend function is currently supported. Both DAP
packet processing and the new backend are prepared to support multiple
instances, but require a user interface and minor modifications.
New backen has similar functionality to what is provided by the function
in the sample samples/subsys/dap.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
We need a way to update the value configured by option
CMSIS_DAP_PACKET_SIZE at runtime. For example, the USB backend may have
different values depending on the speed at which the device is being
enumerated.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
If the ACL link has been encrypted and it has a authenticated link key,
it means the pairing procedure has been done. And the security level of
the link key can not be upgraded. In this case, if `conn->sec_level` is
less than the required security level of the L2CAP channel, reject the
L2CAP conn request.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Improves readability by removing the need to check the table
to figure out how many antennas devices A and B are using.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>