Make the service parameter optional in getaddrinfo().
The application should be able to use NULL as service when only
interested in the host lookup.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Add freeaddrinfo() to complement getaddrinfo().
Existing applications using getaddrinfo() will usually free
allocated memory using freeaddrinfo(). Even if nothing is allocated
the function should exist to avoid having to change the application
when porting.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Add support for MSG_DONTWAIT flag in send() and sendto(). This
aligns with the same flag used in recv() and recvfrom().
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
With upcoming ICs that are not in the nRF5x family, rename the flash
driver and all its dependencies from nrf5 to nrf.
Should also fix the issue introduced by f49150cab6 which broke the
assignment of the flash device due to a partial rename.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Avoid listing internal function in the public API documentation. After
enabling those doxygen configs, we go lots of errors and bad refs that
were fixed.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add k_fifo kernel object timeout scenario tests like basic
k_fifo API tests with timeouts and tests which involve other
threads to get/put items from/into k_fifo with timeouts.
This test is inspired from test_stack legacy test from
Zephyr v1.7.0 release.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Add k_fifo kernel object usage scenario tests between thread
to thread and thread to ISR.
This test is inspired from test_fifo legacy test from
Zephyr v1.7.0 release.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
The k_mem_partition structs need to be placed in the kernel memory.
This patch ensures that these structs are placed correctly.
Also when a struct k_mem_domain is declared it is advised to add
__kernel.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
There was not enough space for \0 at the end of the string.
Coverity-CID: 183057
Coverity-CID: 183050
Fixes#6675Fixes#6682
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Network packet cannot be NULL so no need to check its value.
Coverity-CID: 183063
Fixes#6669
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Decode Kconfig sources as UTF-8 instead of decoding them according to
the system locale (which might be ascii-only).
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Decode Kconfig sources as UTF-8 instead of decoding them according to
the system locale (which might be ascii-only).
This resolves an issue that can be reproduced like this:
$ export LANG=C
$ echo '# Sebastian Bøe' >> ~/zephyr/Kconfig
$ build_any_zephyr_app
See the Python comment for details.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
No need to verify that the configuration is proper if we are
compiling the driver for unit test and not going to ever run
the test.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As the board has ethernet chip it makes sense to enable the
ethernet support by default.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If CONFIG_NET_DEBUG_NET_PKT was enabled, then a call to
net_pkt_get_reserve_data() was calling wrong debug function
which caused compile error.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add support for MSG_PEEK flag in recv and recvfrom.
This flag is needed when using non-zephyr embedded applications with
Zephyr's socket API.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Memory leak occurs if neighbor table is full and echo request from an
unknown neighbor is received. Hence, on an attempt to send NS unref of
pending is not done, causing the memory leak.
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
Define IRQ number for SecureFault Handler when building Secure
Firmware for non-CMSIS-compliant ARM Cortex-M MCUs.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This was reported by valgrind
Source and destination overlap in memcpy(0x80c18c0, 0x80c18c0, 6)
at 0x4035C3E: memcpy (vg_replace_strmem.c:1023)
by 0x80978CA: ethernet_send (ethernet.c:319)
by 0x8061B9B: net_if_send_data (net_if.c:281)
by 0x805F215: net_send_data (net_core.c:399)
by 0x8080998: send_mldv2_raw (ipv6.c:2858)
by 0x8080BA6: send_mldv2 (ipv6.c:2889)
by 0x8080D6C: net_ipv6_mld_join (ipv6.c:2915)
by 0x8061EF0: join_mcast_allnodes (net_if.c:438)
by 0x8062CA4: net_if_ipv6_addr_add (net_if.c:826)
by 0x8062296: net_if_start_dad (net_if.c:557)
by 0x8066667: net_if_up (net_if.c:2107)
by 0x8066AF0: net_if_post_init (net_if.c:2341)
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
A previous commit had mistakenly overwritten the copyright years instead
of extending the range. Fix this mistake so that the proper range is
recorded.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The existing nrf5_common.h now applies to other Nordic ICs that are not
part of the "5" family. Instead rename this to nrf_common.h to cover the
upcoming ICs that belong to other families.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Upcoming Nordic ICs that share many of the peripherals and architecture
with the currently supported nRF5x ones are no longer part of the nRF5
family. In order to accomodate that, rename the SoC family from nrf5 to
nrf, so that it can contain all of the members of the wider Nordic
family.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
If the thread that sends the configuration messages has low priority
and is sending to the local node (a common use case currently) it's
possible that the response arrives before the cli->op_* state
variables are set, resulting in the message never getting properly
processed and the client API call timing out.
Split the initialization into a separete cli_prepare() call and add a
cli_reset() to clean up the variables in case of premature completion
of the client operation (e.g. due to message sending failure).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It's not always guaranteed that param->status will be non-NULL,
especially not after a subsequent patch to fix a race condition with
the response waiting.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Previously qemu_x86 was the only device to run this test in
userspace. With this patch, the pipe testcases can now
run on any device which has userspace enabed.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
The following are the test cases added for pipe.
1. Test pipe APIs on single data element.
2. Test pipe APIs on multiple data elements.
3. Test pipe APIs with forever wait.
4. Test pipe APIs with timeout.
5. Test pipe APIs on an empty pipe.
6. Test pipe get API with forever timeout.
7. Test pipe get API with limited timeout.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
A new Kconfig to help test the userspace mode. Needed for devices
which have userspace capabilities but are not enabled by default.
This kconfig enables the userspace for the devices which have
CONFIG_ARCH_HAS_USERSPACE enabled.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
New revision (SWCU117H) got published and the old one (supposedly
SWCU117G) is no longer available.
Signed-off-by: Reto Schneider <code@reto-schneider.ch>
Use HAS_ Kconfig option as intended, those are invisible option that
signify support of a certain feature that can be selected by a hardware
or platform.
For RTT and system view this was not dont in an inconsistent way.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
* ring_bufffer is in lib, so move the Kconfig out of the kernel.
* move one Kconfig used for json to lib/Kconfig alongside other
Kconfigs.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This application just enables native host networking and net-shell
which allows connectivity from zephyr to host system via tap device.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This creates zeth network interface in your host and allows user
to send and receive data sent to this network interface.
Fixes#6007
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As following commits need this functionality, create a function
which converts "01:02:ab:fe:34:dd" type hex strings to array of
bytes. Change the SLIP driver to use this new function.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add support for MSG_DONTWAIT flag in recv and recvfrom.
This flag is needed when using non-zephyr embedded applications with
Zephyr's socket API.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
STM32F0 flash driver already uses FLASH_PAGE_SIZE from HAL
in flash layout part, so CONFIG_FLASH_PAGE_SIZE is redundant
and confusing.
Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
The scheduler has a kernel-internal _pend_thread() utility which
sounds like a function which will add an arbitrary thread to a wait_q.
This is essentially unsupportable in SMP, where that thread might
actually be executing on a different CPU.
Thankfully we never used it like that. The only spots outside the
scheduler that use the API are in pipes and mailbox, which both just
want to pend a DUMMY thread to track the timeout but will never try to
pend a true foreign thread.
Clarify the comment and add an assertion to make sure this promise
isn't broken in the future.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This was the only spot where the scheduler-internal
_peek_first_pending_thread() API was used. Given that this kind of
thing is inherently racy (it may not be pending as long as you expect
if a timeout expires, etc...), it would be nice to retire it.
And as it happens all the queue code was using it for was to detect
the case of a non-empty wait_q over which it was looping, which is
trivial to do without API support.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>