Queue a TCP FIN packet when needed if the socket was connected or
listening and where FIN wasn't already received.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
A new context cannot have callbacks set, as it was freshly created
in the beginning of the function. Thus the extra callback clearing
can be removed. This is a left-over from commit ce41d5f432.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Ifdefs around TCP code can be removed since the TCP code will compile
to empty functions when not enabled.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Refactor sendto() code so that destination address and its validity
is checked first, followed by offloading verification. Move context
and shutdown checks into TCP queueing function.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
With CONFIG_NET_TCP is not set, provide empty static inline
prototypes for all TCP functions available to other parts of
the IP stack.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Enable the loopback driver and set up network testing so that it
will not require a SLIP driver. Move values from the extra test
config so that they are always enabled.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
The generated header uses Zephyr's custom integer type
definitions but wasn't including the proper header.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Update Kconfiglib to upstream revision 7245bad9ebb58 (+ local Zephyr
modifications), to get the following improvements/fixes in:
- Print a warning if an int or hex symbol is assigned a value that lies
outside an active 'range' constraint.
- Turn 'FOO' into a link in 'select FOO' when generating the Kconfig
reference documentation.
- Parenthesize '&&' expressions within '||' expressions --
(A && B) || (C && D) is more readable than A && B || C && D.
The final two fixes will only be visible once the fix for #5622 gets in.
Fixes#6749Fixes#6844
Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
The __net_if_align was removed in earlier commits but it needs
to come back as in some arch the alignment of net_if section
will be wrong.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
this sample expect there has a button in you board, that was
the mouse's left button, tested in linux by using evtest.
Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
Adapt the MyNewt non-volatile configuration system to become a settings
system in Zephyr.
The original code was modifed in the following ways:
* Renamed from config to settings
* Use the zephyr FCB, FS API, and base64 subsystems
* lltoa like function was added to sources as it was required but not
included in Zephyr itself.
* The original code was modified to use Zephyr's slist.h as single
linked list implementation.
* Reworked code which was using strtok_r, added function
for decoding a string to a s64_t value.
* Thank to the above the settings subsys doesn't require newlibc anymore.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The sensor enables the readout of multiple consecutive registers if
the MSb of the sub-address is set. The other 7bit are the register
address.
Signed-off-by: Tobias Aschenbrenner <taschenb@posteo.de>
As per uart_pipe.c, irq_is_pending should only return true if any
*unmasked* interrupts are pending.
The device_get_binding() code only checks devices that have an API.
Set the API at compile time so that other devices can refer to the CDC
ACM driver.
usb_write() may return EBUSY if the endpoint is full. Propagate this
for future use.
Signed-off-by: Michael Hope <mlhx@google.com>
Combine several generic config file into prj.conf that can be
used by several boards and configurations.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
__packed allows the struct to be linked at a non-word size boundrary
which causes an unaligned access fault on the Cortex-M0+.
Signed-off-by: Michael Hope <mlhx@google.com>
net_eth_get_hw_capabilities() calls .get_capabilities() which is part
of the ethernet API but not the net_if_api that netusb implements.
This causes a fault as .get_capabilities() was past the end of the
struct and resolved to a random address.
Also, make the API const and give it a unique name.
Signed-off-by: Michael Hope <mlhx@google.com>
There can be lot of traffic class threads and each will have
their own stacks. This can trigger issue when traversing the
stacks list in "net stacks" shell command. To overcome this issue,
we need to align each net_stack_info struct by 32 bytes. This is
the same issue that happened with net_if earlier.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This demostrates how to classify the network traffic when sending
data. The application will create similar functionality as
echo-client so user can use echo-server running in remote host to
test this sample application.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The "net stacks" command was printing TX or RX thread values so
that it was not possible to use the values in debugging easily.
Add traffic class value when printing the info so that it is
easy to see what TX or RX queue is doing.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add statistics for number of packets and bytes to each traffic
class. Print this information in net-shell.
Also make sure that we do not calculate total packet length many
times. So calculate network packet total length once and then use
that value instead of calculating it many times in a row.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Test that we can set the priority of the network packet and
that high priority packets are sent before low priority ones.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
With this commit it is possible to add priority to sent or received
network packets. So user is able to send or receive higher priority
packets faster than lower level packets.
The traffic class support is activated by CONFIG_NET_TC_COUNT option.
The TC support uses work queues to separate the traffic. The
priority of the work queue thread specifies the ordering of the
network traffic. Each work queue thread handles traffic to one specific
work queue. Note that you should not enable traffic classes unless
you really need them by your application. Each TC thread needs
stack so this feature requires more memory.
It is possible to disable transmit traffic class support and keep the
receive traffic class support, or vice versa. If both RX and TX traffic
classes are enabled, then both will use the same number of queues
defined by CONFIG_NET_TC_COUNT option.
Fixes#6588
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Allow caller to create array of thread stacks using
NET_STACK_ARRAY_DEFINE() macro. This allows more debug information
to be printed by "net stacks" command.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add context option support and implement PRIORITY option that
can be used to classify the network traffic to different trafic
classes according to said priority value.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of always allocating both IPv6 and IPv4 address information
to every network interface, allow more fine grained address
configuration. So it is possible to have IPv6 or IPv4 only network
interfaces.
This commit introduces two new config options:
CONFIG_NET_IF_MAX_IPV4_COUNT and CONFIG_NET_IF_MAX_IPV6_COUNT
which tell how many IP address information structs are allocated
statically. At runtime when network interface is setup, it is then
possible to attach this IP address info struct to a specific
network interface. This can save considerable amount of memory
as the IP address information struct can be quite large (depends
on how many IP addresses user configures in the system).
Note that the value of CONFIG_NET_IF_MAX_IPV4_COUNT and
CONFIG_NET_IF_MAX_IPV6_COUNT should reflect the estimated number of
network interfaces in the system. So if if CONFIG_NET_IF_MAX_IPV6_COUNT
is set to 1 and there are two network interfaces that need IPv6
addresses, then the system will not be able to setup IPv6 addresses to
the second network interface in this case. This scenario might be
just fine if the second network interface is IPv4 only. The net_if.c
will print a warning during startup if mismatch about the counts and
the actual number of network interface is detected.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Move IP address settings from net_if to separate structs.
This is needed for VLAN support.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add a sample that demonstrates a custom board definition. This proves
that BOARD_ROOT works and can be a useful reference when creating a
custom board definition.
Instead of spending time making up a board, the nrf52840_pca10056
board has been copied as-is. And the hello world sample has been used
as the basis for the application.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
There are currently two samples in the
~/zephyr/samples/application_development/ directory. This commit
allows them to be visible in the documentation.
It is not clear why this has not been done already.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
These files contain addresses of memory-mapped registers and their
bitfields definitions. They may become very useful in debugging.
Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v1.0.0
commit: cf78ebfea1719d85cf4018fe6c08cc73fe5ec719
Purpose: Facilitate debugging on nRF5 SoCs
Maintained-by: External
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Updates nrfx to the recently released version and adjusts its glue
layer accordingly.
License headers are slightly corrected to match the license text at
https://opensource.org/licenses/BSD-3-Clause.
Deprecated MDK files nrf51xxx_peripherals.h are removed, since they
are replaced by a common file named nrf51_peripherals.h.
Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v1.0.0
commit: cf78ebfea1719d85cf4018fe6c08cc73fe5ec719
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This event is no longer exposed for the USBD peripheral,
and the newest MDK version (and consequently new nrfx HAL)
does not contain its definition and related bitfields.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Cover the required steps to use the Controller with Linux's BlueZ and
QEMU, and link to the relevant sections in the subsystem developer
guide.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In order to avoid duplication, move all information relating to QEMU and
BlueZ from samples to subsystems, and expand to cover BlueZ installation
and usage of Controllers with BlueZ and QEMU in detail.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
During yaml collapse step, convert inherited 'id' key to 'node_type'.
With this new 'node_type', it's is more easy to apply common treatment
to all bindings that include the same base yaml file but might not
have similar bindings/constraint naming convention.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Prepare to split extract_dts_includes in modules.
extract_dts_includes design is based on globals. Every module must be
able to use (import) them.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Moving logical parts into dedicated functions for clarity.
Factorizing a bit the code for potential future changes (more
'zephyr,xxxx' directives related to CONFIG_ option).
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Thus no need to parse twice the .dtsi, .dts and .yaml files.
Simplify provided arguments relevancy, letting argparse generating usage
message by itself.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Mandated by Python PEP-8.
(And normalize the way we write python in dts scripts also)
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>