Convert the mesh code to use the new net_buf_siple APIs. This has the
benefit of saving 4 bytes off the stack due to the not needed pointer.
Also update the publication context helpers to map to the new
net_buf_simple API in an intuitive way.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If context is bound to IPv6 unspecified addresss and some port
number, then unspecified address is passed in TCP reset packet
message preparation. Eventually packet dropped at the peer.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Zephyr doesn't have luxury to create re-transmit timer per packet. So
it has different methods to handle packets in queue. But re-sending
packets on valid ack messages causing issues.
E.g. A TCP node sent two packets (packet-1, packet-2). Peer replied
two ACKs (ACK-1 and ACK-2), and these two ACK's are at rx_thread
queue. Now ACK-1 is handled and reference of packet-1 is freed
from sent list. Then if condiftion (valid ACK and connection
state is ESTABLISHED) notices that, sent list is not empty.
Restart the timer, modify sent flag and resend packets in a
list. Here packet-2 is sent again, even though ACK-2 is already
received. Situation is worse if there are more packets in the
list.
So only start the re-transmit timer in-case queue is not empty. It
allows rx_thread to handle all incoming packets (in this e.g ACKs).
When the re-trasmit timer expires, it sends the packets which
are left in queue.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
In case of failed to get source address from the net packet,
release the assgined tcp backlog entry. Otherwise it will
never be freed.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
k_delayed_work_cancel(&context->tcp->fin_timer) called twice
immediately one after other.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Application should normally declare a bt_uuid with proper type and then
use bt_uuid_cmp.
Fixes#5162
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
RFC 7252, sec 4.8 [https://tools.ietf.org/html/rfc7252#section-4.8]
The default MAX_RETRANSMIT is 4, current implementation only
retry 3 times. Update next_timeout() to return one more retry.
Also, add a TODO for random generated initial ACK timeout
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Two docs listed in the Samples an Demos TOC had the same title displayed
in the board-specific samples section, "Power Management Demo". Give
both sample docs a more specific title.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
The existing implementation assumed DNS resolv callback will be
called just once, but that's not always the case (apparently,
for multi-homes hosts or something). So, apply array bounds
checking (and do pointer arithmetic only after it, as the C
standard otherwise warns of "undefined behavior"). In such a case,
the port number wasn't set in each entry too, so rework how it's
done.
The issues discovered while resolving archive.ubuntu.com.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
As per current policy of requiring supervisor mode to register
callbacks, dma_config() is omitted.
A note added about checking the channel ID for start/stop, current
implementations already do this but best make it explicitly
documented.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Add a new zephyr-env.cmd that mirrors the functionality of zephyr-env.sh
but on Windows platforms. It sets ZEPHYR_BASE to the location of the
script.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
During compile of lwm2m_client using qemu_x86, the following build
warning was noticed:
zephyr/arch/x86/core/excstub.S:132:2: warning: "/*" within comment [-Wcomment]
/*
In commit ff42bdd0a0 ("debug: remove option GDB_INFO"), the comment tag
was omitted. Fix the comment end tag.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
This feature is X86 only and is not used or being tested. It is legacy
feature and no one can prove it actually works. Remove it until we have
proper documentation and samples and multi architecture support.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This feature is X86 only and is not used or being tested. It is legacy
feature and no one can prove it actually works. Remove it until we have
proper documentation and samples and multi architecture support.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Correct 2 items in the Windows Getting Started doc:
* dtc-msys2 is now an upstream Chocolatey package
* Add instructions to clone and build Ninja for MSYS2
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This patch updates information pertaining to userspace related security
features. Some of these have been added to releases and this needs to
be shown in the document.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
stm32f334 is not an expansion of stm32f303, since
stm32f303 has more I2C, SPI ports than stm32f303.
Fix this by including stm32f3.dtsi in stm32f334.dtsi.
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
It is important that it is easy to reproduce CI issues locally. Using
the same sanitycheck options locally and in CI helps in this
regard. Specifically, Ninja and Make can produce different results and
therefore the default generator should be the same for sanitycheck and
shippable.
This patch makes four changes:
The sanitycheck option '--make' is introduced to allow specifying Make
as a generator.
CI no longer passes the option '--ninja' to sanitycheck.
Sanitycheck defaults to using Ninja.
Sanitycheck documents the --ninja option as deprecated.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
New advertising started while scanning is already enabled
would delay the first advertisement event until the end of
the current overlapping scan window in the Zephyr native BLE
controller implementation. Hence, consider this scan window
duration when calculating the advertising stop.
Relates to: #6083
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix, add the missing code for the removal of any accumulated
soft latencies or negative drift ticks when scheduling next
interval expiry with added laziness.
Typically a first interval would accumulate soft latencies
and this has to be removed if the interval is rescheduled
with any added laziness (scheduled to the next soft real
time interval).
Example, scan windows block any new scheduling until the end
of the window, adding latencies to any soft real time ticker
expiry which should try to execute as early as possible after
the scan window.
Fixes: #6083
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor BT_CTLR_ADV_INDICATION feature by moving the
implementation closer to the implementation that is closing
the advertisement event so that in the future new members
can be added as necessary (example, advertised channels).
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
No one was setting this to any other value than its default, which
happens to be the same as BT_BUF_USER_DATA_MIN.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Since all in-tree users are good with 4 bytes of user data, reduce the
default to 4. Also fix the default and rage values where apparently
'0' and '8' had been swapped.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The HCI command buffers are the only ones with more than 4 bytes of
required user data. Move the user data into a separate array and do
the mapping with the help of net_buf_id(). After this, it will be
possible to reduce the default net_buf user data size from 8 to 4.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Fix incorrect radio timing for Tx chain delay for S2 and S8
coding. Regression introduced in commit 55d3ce111c
("Bluetooth: controller: Refactoring nRF5 radio driver").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Having these in the beginning of a switch statement without any case
statement makes no sense.
Fixes#6135
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
When generating coverage report:
* Also generate branch coverage
* If the report is properly generated tell user where to find it
* Handle case in which no ztests are run (it would crash before)
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
With 323e8cf069 applied and printf() working out of the box,
CONFIG_NET_BUF_LOG=y workarounds can be removed from configs of
all samples.
Also, print an intro message at the start of each server sample,
to give a user hint that the app didn't just hang and what to do
next. (The port waiting for connection is printed. We can't (easily)
print host address, because the samples should run on both Zephyr
and POSIX systems, and finding out local host address would require
hairy #ifdef's undermining the purpose of these samples (that is,
showing that the *same* code can be used on both types of systems)).
Fixes: #5379
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Make it safe to call net_buf_simple_init() even if the buffer was
created using the new macros. This is possible to detect since with
the new macros buf->__buf will be non-NULL and with the old
NET_BUF_SIMPLE() macro it will be NULL.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Remove spurious console code block to fix formatting of the following
zephyr-app-commands directive. While I am here, fix the indentation of
the two zephyr-app-commands directives.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Aligned sanitycheck command line options in doc
with the actual ones.
+
Minor fix in --coverage description.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Added guards to the toolchain/gcc.h and toolchain/common.h
Those files should never be included directly, but a guard is useful
regardless.
Fixes#5130
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Introduce two new "standard" data allocators to net_buf. There are now
three in total:
NET_BUF_POOL_FIXED_DEFINE: This is the closes to the old
implementation, i.e. fixed size chunks. It's also what the old
NET_BUF_POOL_DEFINE macro maps to.
NET_BUF_POOL_HEAP_DEFINE: uses the OS heap
NET_BUF_POOL_VAR_DEFINE: defines a variable sized allocator using
k_mem_pool (this is all that there was in my first draft of this
feature)
Currently the variable length allocators (HEAP & VAR) support
reference counted data payloads, i.e. cheap cloning. The FIXED
allocator does not currentlty support this to allow for the simplest
possible implementation, but the support can be added later if
desired.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Redesign of the net_buf_simple and net_buf structs, where the data
payload portion is split to a separately allocated chunk of memory. In
practice this means that buf->__buf becomes a pointer from having just
been a marker (empty array) for where the payload begins right after
the meta-data.
Fixes#3283
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The net_buf unit tests were doing some pretty hacky stuff with
defining a dummy _net_buf_pool_list variable to fulfil the linker
magic that happens with a real build. Until now the code got lucky in
that the simple net_buf_alloc() tests didn't depend on
_net_buf_pool_list being valid, however with the coming redesign even
net_buf_alloc will require proper setup of this.
Since the unit tests were extremely minimal, and not testing anything
beyond what tests/net/buf already tests, just remove them for now.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commit messages now require a body summary (before it could be blank for
"trivial" changes).
Add mention of uncrustify to help format code to project standards.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Very brief documentation of the board as a placeholder, more info on
supported features will follow.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Sort the glob results when Kconfig sources do 'source
"/path/*/Kconfig"' to ensure that the resulting dotconfig file is the
same for all platforms.
This fixes#5743
Credit goes to @ulfalizer.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>