In order to properly remove struct tcp and its data, net_context
needs to be supplied as k_timer user data. Modify net_tcp_unref()
to take a net_context argument when removing, and add ifdefs
around code that after this will only be used by TCP testing
functionality.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Add a net_context backpointer and receiver user data to the tcp
structure. Once the desired callback and user data is set in
net_tcp_recv(), net_context_packet_received() can be called at
TCP reception in tcp_data_get(), moving the TCP data to the
recipient. IP and TCP protocol headers are sent as NULL, they
are not used by e.g. the socket code.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Since TCP needs to be able to decide how much data is to be sent
in a TCP segment and when the segment needs to be sent, the TCP
data buffer needs to be passed down to the TCP stack. For tcp2
this causes a new function handling the data as a buffer or as an
iov to be implemented and only that function is called when
sending data out via the new TCP stack. net_tcp_send_data() is
invoked as the caller expects to be informed when the data has
been sent.
For the current stack keep the sending functions as is.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Register the TCP connection when accept() and connect() is called.
With the connection registration net_context will have the necessary
callback pointer set up, whereby net_context can call the proper
function when receiving packets for the TCP connecton.
With the new TCP stack this callback is always the same function.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Currently the TCP commands work only for legacy TCP.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
In order to be able to run the sanity check, don't open the socket
if the test protocol is enabled.
Also add a debug print at the recv().
This commit will be dropped:
- As soon as the sanity check site accomodates
- As soon as the integration is complete
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Add documentation for the Websocket API, also add information how
to use the Websocket as a transport for other high level protocols
like MQTT.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Applications should use setsockopt() to setup the SOCKS5 proxy,
so the old API file, which is using net_context directly, is
moved SOCKS5 directory.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fix GCC "warning: 'ipv4' defined but not used [-Wunused-variable]" and
"warning: 'ipv6' defined but not used [-Wunused-variable]" when either
IPv4 or IPv6 support is not enabled.
Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
Updated mbedtls reference to take in:
native: debug: Set speed optimization if ASAN is used
(zephyrproject-rtos/mbedtls#4)
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Use sys_put_xyz() helpers instead of memcpy() whenever possible. This
brings in straight-line inline code for pushes and adds of known,
small sizes.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
In some applications where power management is used, it is not expected
that the GPIO pins of the UARTE is reconfigured upon power state change.
Added a Kconfig option to disable the UARTE driver management of GPIOs.
It defaults to y in order to not affect current behavior unless the user
configures it specifically.
Signed-off-by: Dennis Wildmark <dennis.wildmark@assaabloy.com>
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
The page tables to use are now stored in the cpuboot struct.
For the first CPU, we set to the flat page tables, and then
update later in z_x86_prep_c() once the runtime tables have
been generated.
For other CPUs, by the time we get to z_arch_start_cpu()
the runtime tables are ready do go, and so we just install
them directly.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
- Bring in CONFIG_X86_MMU and some related defines to
common X86 Kconfig
- Don't set ARCH_HAS_USERSPACE for intel64 yet when
X86_MMU is enabled
- Uplevel x86_mmu.c to common code
- Add logic for handling PML4 table and generating PDPTs
- move z_x86_paging_init() to common kernel_arch_func.h
- Uplevel inclusion of mmustructs.h to common x86 arch.h,
both need it for memory domain defines
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Same snippet as in our 32-bit linker file. Creates
an iterable section with all the MMU_BOOT_REGION() info.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Some linker symbols indicating the bounds of various memory
areas needed for setting up boot MMU regions are now in
place.
MMU_BOOT_REGION macros added to align the bounds of these
sections if we're using runtime page tables.
_image_rodata_start moved to the proper place, it was not
accounting for the rodata sections specified in
linker/common_rom.ld.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Program text, rodata, and data need different MMU
permissions. Split out rodata and data from the program
text, updating the linker script appropriately.
Region size symbols added to the linker script, so these
can later be used with MMU_BOOT_REGION().
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
can_copy_zframe_to_frame did not distinguish between the standard and
extended frames. As a result, uninitialized bits were copied to the
destination frame. This commit changes the function to use the correct
bitfields.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
Since the LE (Enhanced) Connection Complete that comes as part of
cancelling a connection does not come through the priority rx thread in
hci_driver.c, the event class was not being calculated and cached.
Hence, calculate and cache the class whenever an event is received as
part of invoking a command.
Fixes#20110.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Unused since commit 7e96ca5d80 ("i2c: Remove non DTS Kconfig params").
intel_s1000_crb probably isn't getting tested in CI, because Kconfiglib
generated a warning for the symbol no longer being given a type, which
would be turned into an error.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Make the clkout properties of the NXP Kinetis SIM module device tree
bindings optional since not all boards rely on this clock signal for
clocking external peripherals.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Same deal as in commit 7fdb525754 ("kconfig: Use 'default' instead of
'def_bool' in Kconfig.defconfig files"), but I hacked Kconfiglib to also
find cases where the type is given separately as e.g.
config FOO
int
default 3
Motivation (from a note in
https://docs.zephyrproject.org/latest/guides/kconfig/index.html):
For a symbol defined in multiple locations (e.g., in a
Kconfig.defconfig file in Zephyr), it is best to only give the
symbol type for the "base" definition of the symbol, and to use
'default' (instead of 'def_<type>' value) for the remaining
definitions. That way, if the base definition of the symbol is
removed, the symbol ends up without a type, which generates a
warning that points to the other definitions. That makes the extra
definitions easier to discover and remove.
It's also nice if 'def_bool' and the like turn into a semi-reliable flag
that the symbol is only defined in Kconfig.defconfig files. That might
be a sign that things could be cleaned up.
Will do a separate pass later to remove some symbols only defined in
Kconfig.defconfig files.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit adds a new test suite in tests/arch/arm that
intends to testing system faults inside interrupts.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
For ARM, Z_ARCH_EXCEPT triggers an SVC to induce a system error.
This code block may be inlined, so, if we want to return from
this error DIRECTLY to thread mode, e.g. if the system error
occurred in ISR context and we are not aborting the current
thread, we must instruct the compiler that the execution
may continue after the inlined SVC. Therefore, we must remove
the CODE_UNREACHABLE statements.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
In z_fatal_error() we invoke the arch-specific API that
evaluates whether we are in a nested exception. We then
use the result to log a message that the error occurred
in ISR. In non-test mode, we unconditionally panic, if
an exception has occurred in an ISR and the fatal error
handler has not returned (apart from the case of an
error in stack sentinel check).
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>