Link metric is part IPv6 neighbour data struct. But RPL code is
trying to access it from RPL parent table where link metric doesn't
exist. So provided an api to get IPv6 neighbour data from RPL parent
data.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
DAG rank will be properly written with net_pkt_write_be16() in
network packet. API will take care of endianness. So need
not to convert it using htons().
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Sender rank (16 bit uint) was properly read with net_frag_read_be16()
api and need not to convert it again using ntohs().
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Initialize the buffer to 0 and read one byte less than the
buffer size. The result should be that the last byte of
the buffer always stays 0. This way it is possible to verify
it the driver does not write outside the buffer.
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
Add a STM32 LL based driver for the RNG processor. The RNG processor
is a random number generator, based on a continuous analog noise, that
provides a random 32-bit value to the host when read. The RNG passed
the FIPS PUB 140-2 (2001 October 10) tests with a success ratio of 99%.
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
We had various asserts when checking network packet length but
printed also error when there was none. Fix this by checking
do we really have a too short message.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove NET_TCP_HDR() macro as we cannot safely access TCP header
via it if the network packet header spans over multiple net_buf
fragments.
Fixed also the TCP unit tests so that they pass correctly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove NET_UDP_HDR() macro as we cannot safely access UDP header
via it if the network packet header spans over multiple net_buf
fragments.
Fixed also the UDP unit tests so that they pass correctly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove NET_ICMP_HDR() macro as we cannot safely access ICMP header
via it if the network packet header spans over multiple net_buf
fragments.
Jira: ZEP-2306
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The IPv6 HBH option PAD1 ext header was not parsed properly
as the code read one extra byte from the ext header. The
PAD1 length is only 1 byte.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add utility function that helps to figure out if the
protocol headers can be directly accessed when they fit one
net_buf fragment, or if they need to accessed using various
net_pkt helpers that know about reading data from two
different net_buf's.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of directly setting pointer to where to start to calculate
the various IP related checksums, use the net_frag_skip() to first
find out what is the fragment where the calculation should start.
This needs to be like this so that if the IP header + possible
extension are so long that they do not fit the first fragment,
we need to be prepared to look into second fragment.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The following error and warning is received when connecting
to certain central devices:
[bt] [ERR] hci_num_completed_packets: packets count mismatch
[bt] [WRN] bt_att_recv: Ignoring unexpected request
This could happen if Tx-ed packet is not added to pending
list before a num of completed packets event and/or new Rx
packet is received.
This is fixed by reducing the Rx thread priorities in the
Host and the Controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
net_context_unref() is protocol agnostic, after being un-referenced,
the same context might end up being used then for UDP,
if context->tcp is not reset to NULL, calling net_context_unref()
after this UDP usage will again try to release this TCP pointer
which might lead to random error.
Signed-off-by: june li <junelizh@foxmail.com>
The config file for KW40Z has the shell disabled, as available
SRAM memory is limitted to 16kB.
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
Add support for KW40Z in the KW41Z IEEE 802.15.4 driver as both chips
expose almost the same radio registers.
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
Add minimal interface for the KW40Z XCVR driver to match the one offered
in MCUX v2.2 by the KW41Z XCVR driver.
This is needed to reuse the KW41Z IEEE 802.15.4 driver on KW40Z.
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
Add and update makefiles in order to build either the KW41Z or KW40Z
XCVR driver based on soc name.
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
Update KW40Z files for building XCVR driver by adding the required
includes, removing unneeded ones and replacing OSA_EnterCritical/
OSA_ExitCritical with OSA_InterruptDisable/OSA_InterruptEnable.
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
Import from Kinetis SDK v1.3 MKW40Z4_extension.h and fsl_bitaccess.h
which are needed to build the XCVR driver for KW40Z.
Origin: NXP Kinetis KW40Z Connectivity Software
Maintained-by: External
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
Import the KW40Z XCVR driver from Kinetis SDK v1.3, which is needed
to setup the radio on the hexiwear_kw40z board.
Origin: NXP Kinetis KW40Z Connectivity Software
Maintained-by: External
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
The chip seems to require a wait time before reading packet
data after the RX sequence done interrupt, as imidiate reading
of it will indicate a packet size of zero and cause the RX
sequence done to be continually retriggered.
In addition, the extra clearing of the interrupt flags can be
removed, as this is already done at the beginning of the isr.
Jira: ZEP-2278
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
The code in send_frag() depends on being able to allocate a new
pending tx contexts with 100% certainty. We must therefore notify
*all* connections instead of the current one in order to ensure that
there are free contexts available in free_tx.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In some cases the lladdr might not be set, currently this is
seen with RPL unit tests, in which case we must not access
the lladdr.
Jira: ZEP-2330
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If there is no route to the neighbor, then do not try to delete
it because the route pointer is NULL.
Jira: ZEP-2329
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We fail to build this test on stm32f3_disco which has 40k of SRAM.
Bump up the min_ram requirement to 48k.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The stm32f3_disco has 40k of ram and we have some tests that require
more than that so we need to specify it in the yaml.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
When building tests/kernel/test_build/test_debug on disco_l475_iot1 we
get the following build error:
drivers/i2c/i2c_ll_stm32_v2.c: In function ‘stm32_i2c_configure_timing’:
ext/hal/st/stm32cube/stm32l4xx/soc/stm32l4xx.h:207:38: error: ‘timing’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
^
drivers/i2c/i2c_ll_stm32_v2.c:265:8: note: ‘timing’ was declared here
u32_t timing;
^~~~~~
Fix by initializing timing to 0.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move a way from misc/ and put in its own subsystem to allow enhancements
in the future and make it a core part of Zephyr, not just something
misc.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The num_handles parameter of the Number Of Completed Packets event is
8-bits and not 16-bits, so no helper variable or byte order conversion
is needed.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In case both conn->tx_notify and conn->tx_queue have data in them we
should first process the notify queue and only then new outgoing
packets.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Due to the missing remainder support in the ticker_start
function for first interval, fix implementation so as to
round the first interval/offset during master connection
setup and connection update to within +/-16us.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The SYN-ACK timer is now handled by the TCP backlog functionality,
while the remaining ACKs for established connections use the tcp
struct ack timer. With this, code setting tcp struct SYN-ACK state
timers can now be removed.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Add timer for sent TCP SYN-ACKs. If the timer is already
scheduled to run before canceling it is attempted, set
the cancelled flag and let the callback remove the
delayed work.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Add an array of configurable size that holds TCP backlog entries.
The array is shared between all incoming TCP connections in order
to make it possible to get away with less memory consumed than
with a connection based approach.
The backlog entries are created when a SYN is received for a
listening TCP socket and removed once the corresponding ACK is
seen. With an incoming RST the corresponding backlog entry is
cleared, if any.
The size of the global backlog array is defined with the
CONFIG_NET_TCP_BACKLOG_SIZE Kconfig variable.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
No need to print errors if assinging null values into net_buf
pools as this is a normal condition if those pools are not used.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The external mbedTLS library seems to have some issues when DEBUG is
enabled, so disable this here becauase we will not change external 3rd
party code.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>