The network application API is a higher level API for creating
client and server type applications. Instead of applications
dealing with low level details, the network application API
provides services that most of the applications can use directly.
This commit removes the internal net_sample_*() API and converts
the existing users of it to use the new net_app API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This doesn't make much practical difference, however it should resolve
Coverity CIDs 170740 and 170748.
Jira: ZEP-2343
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If ICMP packets do not fit in 1 net_pkt fragment the checksum
will be calculated incorrectly.
The problem shows up when using ping with the -s option to
create large ping requests. Eventhough the ping command does
accept the reply without complaining, Wireshark warns that
the icmp checksum is incorrect.
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
We get some failures to build if we don't filter this test to only
boards that support uart interrupts.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Build issues caused by commit fe882f407d
which missed camel case conversion of _TimestampOpen, _TimestampRead,
and _TimestampClose.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
With the ticker for flash driver added, the Controller was
corrupting memory outside its allocations by incorrectly
using the flash ticker instance to be a BLE role and
corrupting memory. This is now fixed by checking for the
ticker ids to be within the Controller's use before using
them.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In some cases applications may want better control of advertising
instead of the stack doing automated re-enablement. Introduce a new
option that can be used to do more "manual" advertising control.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The BT_DEV_ADVERTISING flag already does a suffient job with tracking
the actual advertising state, so there's no need for bt_le_adv_stop()
to return an error if KEEP_ADVERTISING is set. We still need to clear
KEEP_ADVERTISING, but it should not be considered an error if it was
not set.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Implements CONFIG_APPLICATION_MEMORY for x86. Working in
XIP and non-XIP configurations.
This patch does *not* implement any alignment constraints
imposed by the x86 MMU, such enabling will be done later.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The defaults of 0x100000 for ROM and 0x400000 for RAM are intended
to 'fake' a XIP configuration, this all takes place in just RAM.
The gap between these two values is 3 megabytes, specify this
properly.
Fixes numerous test cases on qemu_x86 if CONFIG_XIP is enabled.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This script was assuming that all XIP data copied sections
were contiguous. However with application memory partitioning
enabled, this is not the case; in between the kernel data sections
and the app data sections will be the kernel's BSS and noinit.
As a quick fix, reset the last section compared if we encounter
the kernel's BSS section.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Applications will have their own BSS and data sections which
will need to be additionally copied.
This covers the common C implementation of these functions.
Arches which implement their own optimized versions will need
to be updated.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This is conditionally defined based on whether we are splitting
the application from the kernel, and is used for specifying
kernel input sections based on input files.
The kernel output sections will get matching input sections only
in libzephyr.a and kernel/lib.a.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
To prepare for upcoming memory protection features, we need to
distinguish between objects that are owned by the kernel itself
(and will be protected with supervisor permissions) and those
objects which are properly part of the application.
The current policy will be to place in libapplication.a anything
under lib/ (such as the C library), the application itself, and
additional libaries specified by KBUILD_ZEPHYR_APP.
These entities will no longer end up in libzephyr.a, which will
let us do output section routing in the linker script on a
per-file basis.
Some of the internal variables have been combined and simplified.
Issue: ZEP-2184
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Makefiles which start QEMU (make run) have been changed to operate
off of the QEMU_INSTANCE variable. QEMU_INSTANCE is simply appended
to the pid and sock file names. This makes us able to run multiple
QEMU Zephyr instances of the same sample.
Signed-off-by: John Andersen <john.s.andersen@intel.com>
Enabled the boot_time test on ARM SoCs, set __start_time_stamp on ARM
since we don't have a free running counter similar to TSC on x86.
Also moved to printing the values out as %u to increase the range of
values.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The shell tests were limited to running on just qemu_x86 platform, we
can run them on any platform with UART_CONSOLE support so move to using
a filter.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
There were a few different issues with the UART_CONSOLE filtering:
* Filter was incorrect - UART_CONSOLE should be CONFIG_UART_CONSOLE
* platform_exclude was used for drivers that had a #error for lack of
interrupt support. We can now use CONFIG_SERIAL_SUPPORT_INTERRUPT in
the filter for that. This catches all the various drivers that needed
don't support uart interrupts, not just the onces that had a #error
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
As not all drivers support interrupts we don't have a means to know if
we can allow UART_INTERRUPT_DRIVEN to be enabled and thus various
Kconfig options that select UART_INTERRUPT_DRIVEN. Some drivers have a
interrupts, however not all do. So introduce a Kconfig option to let us
know what the driver actually supports.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Test whichever had Camel case defined for functions and variables have
been replaced.
Following warnings have been fixed in test cases as well.
- line over 80 characters
- Macros with flow control statements should be avoided
- Macros with complex values should be enclosed in parentheses
- break quoted strings at a space character
- do not add new typedefs
- Comparisons should place the constant on the right
side of the test
- suspect code indent for conditional statements
- Missing a blank line after declarations
- macros should not use a trailing semicolon
- Macros with multiple statements should be
enclosed in a do - while loop
- do not use C99 // comments
JIRA: ZEP-2249
Signed-off-by: Punit Vara <punit.vara@intel.com>
Fixed uninitialised auto variables, that had caused compile
errors under CONFIG_DEBUG=y.
Jira: Zep-2334
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This patch allows more generic USB configuration in the samples
and removes platform dependent driver configuration.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Where possible, replace the use of filter with newly added keywords.
This will speed things up and in some cases add more coverage due to bad
filters.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Some testcases can only be built with certain toolchains. Instead of
using filters, add support for toolchain keyword which enables
whitelisting and exclusion.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The example source code is POSIX-compatible (modulo include files),
i.e. can be built and behaves the same way for Zephyr and a POSIX
system (e.g. Linux). Makefile.posix is available for the latter.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
If a socket is closed without reading all data from peer or accepting
all pending connection, they will be leaked. So, flush queues
explicitly.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
As explained in the docstrings, a usecase behind these operations is
when other container objects are put in a fifo. The typical
processing iteration make take just some data from a container at
the head of fifo, with the container still being kept at the fifo,
unless it becomes empty, and only then it's removed. Similarly with
adding more data - first step may be to try to add more data to a
container at the tail of fifo, and only if it's full, add another
container to a fifo.
The specific usecase these operations are added for is network
subsystem processing, where net_buf's and net_pkt's are added
to fifo.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
By moving user_data member at the beginning of structure. With
refcount at the beginning, reliable passsing of contexts via
FIFO was just impossible. (Queuing contexts to a FIFO is required
for BSD Sockets API).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
With CONFIG_NET_SOCKETS_POSIX_NAMES=y, "raw" POSIX names like
socket(), recv(), close() will be exposed (using macro defines).
The close() is the biggest culprit here, because in POSIX it
applies to any file descriptor, but in this implementation -
only to sockets.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Two changes are required so far:
* There's unavoidable need to have a per-socket queue of packets
(for data sockets) or pending connections (for listening sockets).
These queues share the same space (as a C union).
* There's a need to track "EOF" status of connection, synchronized
with a queue of pending packets (i.e. EOF status should be processed
only when all pending packets are processed). A natural place to
store it per-packet then, and we had a "sent" bit which was used
only for outgoing packets, recast it as "eof" for incoming socket
packets.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>