There could be situations where many services are changed in a row which
would cause k_sem_take to block on the second change, but if the calling
thread is actually the RX thread then this will deadlock since the RX
thread is the one processing the confirmations of indications and it is
blocked k_sem_give is never called.
To solve this the services changes are now offloaded to the system wq
and the code will attempt to consolidate the range being changed so only
one indication is send. If for some reason another changes is caused
while confirmation is pending we just reschedule it to run later to
avoid blocking the system wq in the same way.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
For consistency with the Resolving List, rename the whitelist filter to
match its type and the privacy-enabled version to align it with the
short name used in the RL.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
To correctly handle the allocation and deallocation of resolving list
items, the ll_rl_find and wl_pees_find functions have been modified to
return an invalid index instead of a negative value in case of error.
This is to avoid the ambiguity when mixing indices and negative numbers,
which does not play well with the first index 0.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
We have lots of RAM, this helps catch bugs.
Enable XIP as well, this used to be turned on but was
shut off for some reason.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
It's useful to see what original memory regions were configured
in code via the MMU_BOOT_REGION() macros.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This breaks too easily, for example if &some_linker_variable
is used. The names don't matter at all, use preprocessor
__COUNTER__.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The IA32 MMU has no concept of a "no execute" flag, this is
unfortunately only implemented in x86_64.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The QEMU targets have plenty of RAM now and the current value
specified wasn't a multiple of a 4K page.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Previously we were instantiating QEMU with 32MB of RAM but
only enabling a small fraction of it.
Now we boot with 8MB of ram. We ignore the first 4K so we can
make that an unmapped paged to catch NULL pointer dereferences.
If XIP is enabled, the "ROM" region will be the first half of
memory, the "RAM" region the latter.
Move the IDT_LIST and MMU_LIST regions elsewhere so they don't
overlap the new memory arrangement.
Use !XIP to fix a problem where CONFIG_RAM_SIZE was set incorrectly
for XIP case.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
A network stack thread was trying to use a semaphore before it was
initialized. Set it up at toplevel so it is ready to go.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
By the time we get to POST_KERNEL, kernel services and kernel objects
should be available for use. This should include timers and the random
number generator, but we don't init the system clock until sometime
during the POST_KERNEL phase. Initialize it earlier.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
These special kernel sections represent arrays of kernel objects than
are iterated over at runtime to perform initialization.
The code expects all the data in these sections to be in the form of an
array of that section type, with each element sizeof(type) bytes apart.
Unfortunately, the linker sometimes has other plans and in some cases
was defaulting to aligning the data to some large power-of-two value,
such as 64 bytes. This causes any attempt to iterate over these sections
to fail as they are not a proper array.
Use the ld SUBALIGN() directive to force the alignment of these input
sections to 4 bytes.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Upcoming memory protection features will be placing some additional
constraints on kernel objects:
- They need to reside in memory owned by the kernel and not the
application
- Certain kernel object validation schemes will require some run-time
initialization of all kernel objects before they can be used.
Per Ben these initializer macros were never intended to be public. It is
not forbidden to use them, but doing so requires care: the memory being
initialized must reside in kernel space, and extra runtime
initialization steps may need to be peformed before they are fully
usable as kernel objects. In particular, kernel subsystems or drivers
whose objects are already in kernel memory may still need to use these
macros if they define kernel objects as members of a larger data
structure.
It is intended that application developers instead use the
K_<object>_DEFINE macros, which will automatically put the object in the
right memory and add them to a section which can be iterated over at
boot to complete initiailization.
There was no K_WORK_DEFINE() macro for creating struct k_work objects,
this is now added.
k_poll_event and k_poll_signal are intended to be instatiated from
application memory and have not been changed.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This fixes coverity CID 171565 which may be valid in case of the
connection is not properly setup, or its memory is corrupted, it
may cause use of invalid addresses to be set using
net_if_set_link_addr.
JIRA: ZEP-2344
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If the TCP data packet needs to be re-sent after the packet is lost,
then the acknowledgment number will be changed. This then means that
the TCP checksum needs to be recalculated too.
Signed-off-by: june li <junelizh@foxmail.com>
The controller and host-side RX threads recently had their priorities
lowered to 8. Make the driver RX threads consistent with this.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This patch splits out the application data and bss from the
rest of the kernel. Choosing CONFIG_APPLICATION_MEMORY will
result in the application and kernel being split.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Configure I2C using DT for the following STM32 boards:
disco_l475_iot1
nucleo_f401re
96b_carbon
olimexino_stm32
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
The SAM4S, SAM3X, SAME70 all use the uart_sam.c serial
driver. This patch puts the configuration in DTS and
out of Kconfig. The SAME70 uses the USART as well.
USART DTS support for the SAME70 is also in this patch.
Signed-off-by: Justin Watson <jwatson5@gmail.com>
The I2C Slave Read support isn't well defined and not actually supported
by any i2c driver at this point. We can add this back when slave mode
is more thought out.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Right now keep it simple for testing, we can decide how we want to go
forward with this vs MAINTAINERs file, etc.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
If the depends_on has more than one item we need to match all of those
dependencies in the supported list.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
When a node receives consistent DIO messages with same data from
Border Router just ignore those messages. Need not to proceed
further.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
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>