The FCS flag of TX direction is not set correctly if the FCS flag of
RX direction is set. The issue could be found with following steps,
Step 1, Local sends configuration request with ERET mode and FCS
omitted.
Step 2, Peer replies the configuration response without any errors.
Step 3, Peer sends configuration request with ERET mode and NO FCS.
Step 4, Local replies the configuration response without any errors.
The FCS flag of TX is cleared incorrectly.
The FCS should be enabled if any one side enables the FCS.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
In current implementation, if the HCI ACL data length exceeds on L2CAP
packet, the HCI ACL data will be discarded.
Support the case if the transport is classic.
Add a function `bt_br_acl_recv()` to handle the multi L2CAP packets
one by one.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This adjust the IPv6 source address selection so that it is possible
to select deprecated IPv6 address if no better preferred address is found.
From RFC 6724 chapter 5:
Rule 3: Avoid deprecated addresses.
If one of the two source addresses is "preferred" and one of them is
"deprecated" (in the RFC 4862 sense), then prefer the one that is
"preferred".
Rule 8: Use longest matching prefix.
If CommonPrefixLen(SA, D) > CommonPrefixLen(SB, D), then prefer SA.
Similarly, if CommonPrefixLen(SB, D) > CommonPrefixLen(SA, D), then
prefer SB.
So the fix allows deprecated address to be selected if it is a better
match than the preferred one. The reasoning here is that an address with
a longer matching prefix is generally considered topologically closer to
the destination. Using such a source address can lead to more efficient
routing, as it's more likely that the source and destination are within
the same network segment or a closely related one.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
adsp_mtrace_log_init() can be called with its argument equal NULL,
mtrace_active shouldn't be set to true in that case.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Increased the heap mempool size for the socketpairs. This way there will
be enough memory available to allocate 2 * struct spair.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
When applying the connection parameter update, the window widening
for the previous connection interval was not applied since that is
normally done in LLL
Fixed by applying the window widening in ull_conn_update_parameters()
instead in this case
Fixes EBQ test failure in LL/CON/PER/BV-10-C
Signed-off-by: Troels Nilsson <trnn@demant.com>
Make sure RS process is stopped if network interface goes down
as there is no point doing it any more.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
It might happen that if the network interface is going up/down
fast enough, the RS timer could get inserted to the active RS
timer list twice. This would then cause a forever loop in
rs_timeout() when traversing the active list.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
On reboot, client list to notify is not updated properly.
Fix is to check and add the reconnected clients on
security changed cb.
Subscription check is added before notify to clients.
BT Enable check is added in the register function before adding
bonded devices to client list.
Also typo is corrected in add_bonded_addr_to_client_list in the
second loop.
Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
Update bit array (number of connections) added for each receive state.
Notifications are attempted to be sent in the system workqueue and
retried if failing.
Issue #85487
Signed-off-by: Jens Rehhoff Thomsen <jthm@demant.com>
Use -w option to delay the startup of the upload job.
Then when ready, do "zperf jobs start" to launch all upload
sessions at the same time.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If user has enabled CONFIG_ZPERF_SESSION_PER_THREAD, then if
user gives -a (async) option to upload command, then multiple
uploads can be run simultaneously. Each upload will be run
in a dedicated work queue. The work queue thread priority can
be set by -t option.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Shift the error handling for `ethernet_ll_prepare_on_ipv4` out into
`ethernet_send`, since that is the function that needs to handle the
various result types of the ARP process.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Make it clearer that the `net_buf_ref` is for `k_queue_unique_append`,
and reverse the reference if the queue add fails.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Update `net_arp_prepare` to return a return code instead of a pointer,
so that the various results of the function can be differentiated.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Print a warning if sending a packet on the L2 interface fails. Currently
this is completely silent unless `NET_DBG` is enabled and the `context`
parameter is provided.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Our decoder can handle decoding of non-deterministic CBOR just fine.
There is no need to block valid CBOR if the server does not produce
length-first deterministic CBOR.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Added a hook on the FS group that notify applications when a
file download/upload has completed.
Signed-off-by: Nicolas Goualard <nicolas.goualard@sfr.fr>
- When encrypt_state in a receive state of the scan delegator is
BT_BAP_BIG_ENC_STATE_BAD_CODE, make sure that on synchronization
encrypt_state is updated to BT_BAP_BIG_ENC_STATE_DEC, as this
implies that a correct code was provided, so that the broadcast
assistant is not asked for a correct code any longer.
Signed-off-by: Max Emde <mxem@demant.com>
The va.h file used both uintX and bool without including
the appropriate header files, which can cause a compile issue
if the file is included in the wrong order.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The new DSA framework purpose and changes are as below.
- Aligned to Linux DSA framework which has been already mature framework
for many years, For now in zephyr, the DSA components were splited
as: switch, port, master(not need driver file for now), slave, and tag.
Seperated drivers were used for maintaining and developing new
features.
- The unified dts bindings (aligned to linux) were supported. The port
driver would parse DTS to decide the port type (master port, slave
port, or cpu port) to set up the switch. All the ports registered as
standard ethernet devices. (dsa port and dsa switch tree was not
supported.)
- How to add DSA device driver based on the framework? All the device
driver needing to do is providing dsa_spi implementation and private
data, and calling below initialization.
DSA_INIT_INSTANCE(n, _dapi, data)
- For switch tag case, recv/xmit helpers in dsa_api could be used for
taging/untagging. No modified ethernet drivers.
For no-tag type case, ethernet driver of master port should support
packet injection/extraction for slave ports leaving NULL recv/xmit.
The dsa_nxp_imx_netc.c driver will be the first example of the new DSA
framework.
The future work for DSA will be supporting bridge for ports. We may align
Linux to give users two options to use DSA device:
- Standalone mode: the switch ports work as regular ethernet ports.
- Bridge mode: switch mode with virtual bridge device which could be
assigned IP address.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Current DSA TX/RX way was hard-coded in ethernet devices driver
with ETH_DSA_SUPPORT and NET_DSA.
This patch is to make such way obsolete, as we actually will support
a better DSA framework to handle this in NET/DSA core driver.
To make legacy devices not affected, below options are used instead.
- ETH_DSA_SUPPORT_DEPRECATED
- NET_DSA_DEPRECATED
Once the legacy devices are converted to new DSA framework, this code
could be removed.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
The commit 1e0af58b51 ("pmci: Move MCTP into the PMCI subsys") changes
'mctp' directory adding to unconditionally, which will cause:
CMake Warning at ./zephyrproject/zephyr/CMakeLists.txt:1022 (message):
No SOURCES given to Zephyr library: subsys__pmci__mctp
Excluding target from build.
Signed-off-by: Haiyue Wang <haiyuewa@163.com>
Moved OpenThread-related Kconfigs from L2 layer to
modules/openthread. All of those configs were not strictly related
to the L2 layer, so they fits better to OpenThread module.
This operation allows using OpenThread Kconfigs even if L2 layer is
disabled.
Enabling NET_L2_OPENTHREAD also configures those configs by
selecting the OPENTHREAD kconfig, so there is no change regarding
backwards compatibility. The only change is that the Kconfigs
related to Thread were moved to the modules space, so their
location in the menuconfig also changed.
Once it is done, a choice for setting different L2 implementations
seems to be redundant.
Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
anonymous/no authentication mode had been removed
from the last hawkBit server release, so mention it and
deprecate the option.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Make the zperf server support optional, if only upload throughput
testing is required. This reduces the resources required to operate.
Signed-off-by: Jordan Yates <jordan@embeint.com>
`NET_ZPERF` enables the core zperf utility library, not a shell module.
Add more specifics about what the utility can communicate with.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Part of the socket matching criteria for AF_PACKET family took place
inside conn_raw_socket() function, and some of it was redundant with
what already was checked in net_conn_packet_input(). Moreover, if the
packet cloning for packet socket failed for whatever reason, the packet
was reported as NET_DROP, which was confusing.
Finally, conn_raw_socket() updated network stats, which didn't really
work as net stats are only collected for UDP/TCP protocols and not for
L2 level protocols.
Therefore, cleanup the processing by:
* Moving all socket matching criteria into net_conn_packet_input()
for clarity,
* Drop unneeded net stats functions,
* Clarify NET_DROP strategy for packet socket input.
net_conn_packet_input() should only be responsible for delivering
packets to respective packet sockets, it should not decide whether
to drop the packet or not - it's L2/L3 processing code
responsibility. Therefore, assume this function forwards packet for
further processing by default, and only allow small optimization to
return NET_OK if the packet socket was really the only endpoint in
the system.
* And finally, since now conn_raw_socket() responsibility was to clone
the packet for the respective socket, and was almost identical to a
corresponding function for raw IP sockets, unify the two functions.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The current implementation of net_conn_input() can accept different
packet types, with completely different processing code, resulting in a
function which is pretty bloated, sliced with conditionally enabled code
and hard to understand and therefore maintain.
This commit splits that function into smaller ones, specialized for
different packet types (and entry levels). The following functions have
been extracted from the original one:
- net_conn_packet_input() for early packet processing (covering
AF_PACKET family sockets)
- net_conn_raw_ip_input() for raw IP packets processing (covering
AF_INET(6)/SOCK_RAW sockets)
- net_conn_can_input() for CAN packets processing (covering AF_CAN
family sockets)
The net_conn_input() function stripped from above cases now only takes
care of packets that have been processed by respective L4 and are
intended for regular TCP/UDP sockets.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
After L2 processing, the LL protocol type is already known and should be
set accordingly on the packet. Therefore it can be passed to the
net_packet_socket_input() function to allow proper socket filtering
based on protocol.
Additionally, as LL protocol type is 16 bit value, fix the proto
parameter type in net_packet_socket_input().
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
BR_SEND_KEYS_SC should be used to determine the value of
Responder Key Distribution when sending pairing_response to
reply smp br pairing_request.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
The declaration for the text region '__text_region_start' and
'__text_region_end' should be consistent with the declaration in the
include file 'zephyr/linker/linker-defs.h'.
The local declarations are:
extern uintptr_t __text_region_start, __text_region_end;
whereas 'linker_defs.h' declares them as:
extern char __text_region_start[];
extern char __text_region_end[];
This may result in conflicting types when 'linker_defs.h' is indirectly
included. Hence, remove the local declarations.
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
The logging module data is assigned to the memory partition
'k_log_partition' so that a user mode thread can access this data (see
k_mem_domain_add_thread()). The 'k_log_partition' is created when:
- CONFIG_USERSPACE=y
- CONFIG_LOG_ALWAYS_RUNTIME=y
The option CONFIG_NO_OPTIMIZATIONS=y forces the logging module to use
the runtime message creation CONFIG_LOG_ALWAYS_RUNTIME=y. This raises a
MPU violation when logging is used in a user mode thread since this
thread is not allowed to access the module data (e.g. __log_level,
__log_current_const_data).
Note that the user mode thread may also require access to the partition
'z_libc_partition'.
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
The runtime message creation (CONFIG_LOG_ALWAYS_RUNTIME=y) in a user-
mode thread raises a MPU violation, e.g. call LOG_INF("Test") in a
user-mode thread.
The function 'z_log_msg_runtime_vcreate' runs in user mode but works
with Kernel data. Hence, create the cbprintf package on the stack (of
the user mode thread) and pass it further to the syscall
'z_log_msg_static_create'.
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
This function is used for testing purposes only, there is no real use
for it in a user application. Remove in favor of implementation in new
device stack.
Also remove the part of the documentation that depends on loopback.
Documentation on how to implement your own USB device function using the
new USB device support will follow during the documentation rework.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The mod_src_param was several places stored on the stack.
However this is a complex paramater struct that has
2 Kconfig options that can significantly increase the size,
and the maximum size of the parameter is nearly 8 KiB, and
was always place the in the BT RX thread's stack.
For this reason, the param is now stored in a single
static variable in RAM instead, so that the BT RX thread's stack
does not need to be increased based on the Kconfig options,
as that is quite difficult for users to be aware of.
The add_src_param has been left as is, as that stored in
the calling thread, and it is easier for an application
to determine if the calling thread needs additional stack
space.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Bad Broadcast Code in BASS/Scan Delegator if BIG_Encryption
field value = 0x03 (Bad_Code), Bad_Code shall be set to the
value 0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF according to BASS v1.0.1
Signed-off-by: Gudipudi Ramana Kumar <gudipudiramanakumar@gmail.com>
When the connection status is "PENDING", need reset the br channel
identifier to the correct value before resend the connection response,
otherwise these is in an "ident mismatch" error being reported.
Signed-off-by: Make Shi <make.shi@nxp.com>