Initially, there was support only for buffered input, and adhoc var
names used. Later, buffered output support was added, with variables
consistently using "tx_" prefix. Now, rename the original RX path
to use symmetric "rx_" prefix.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The nrf_rtc_timer used own method to calculate number of timer cycles
per tick. As the result value was different than the one used by
the kernel, the reported time was incorrect.
This commit fixes the problem described above by using global
sys_clock_hw_cycles_per_tick instead of custom RTC_TICKS_PER_SYS_TICK.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
Added support for circular linked list of DMA buffers
This patch checks the last block supplied by the application
and if the next pointer in the last block is valid, the tail
linked list item is linked to the head linked list item
to form a circular linked list
Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
Because per-interface statistics rely on interface pointer stored in a
net_pkt, it should not be unreferenced before stats are updated.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Default stack size was too small for main thread in qemu_x86
configuration and resulted in stack overflow during initialization.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Functions for per-interface statistics collection used a pointer to a
packet that could've been deallocated in the net_conn callback function.
In result, application could crash when interface related to the packet
was referenced. To fix that, packet interface is stored earlier, so it
can be used instead for statistics collection.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Users are sometimes mistakenly invoking cmake with $ZEPHYR_BASE set as
the source directory.
This user-error can occur if the user believes that the toplevel
CMakeLists.txt file is at the root of the repo, or if the user uses
the wrong path when invoking cmake.
The error given when this user-error occurs is cryptic and undefined,
so we replace it with what should be an easy-to-understand error
message.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
In verbose mode (-v) progress of running test cases number out of total
number is not printed. Thus, if there are many test cases, it is
impossible to follow the progress. This commit adds printing of current
test case and total numbers to the verbose output.
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
The IP stack drops any TCP segment which doesn't fit into our
receive window. However, we still must accept Zero Window Probe
segments, which are segments, usually with data length of 1, which
a peer sends to us after we stayed with zero window for some time.
In this case, we need to repeat an ACK with the old ack number.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
For the native_posix board,
added the command line options -rt and -no-rt to control
if the execution should be slowed down to real time or not.
CONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME still works, but
now it just sets a default.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Use transfer API for ACL out transfers. No extra buffer is requested,
directly use the net buf and update its len on transfer completion.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Bluetooth net buffers have 1-byte reserve, which can be used by HCI bus
driver (uart, spi...) to set packet type (H4).
This fixes assert when building hci_usb with CONFIG_NET_BUF_SIMPLE_LOG.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Calling bt_send from IRQ context is not safe, at least in HCI SPI case.
In the same way as hci_core, create a thread for TX.
This fixes hci_usb sample for 96b_carbon board.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
SPI driver has its own rx thread, select BT_RECV_IS_RX_THREAD.
This fixes build issue because of undefined CONFIG_BT_RX_PRIO.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
IRQ priorities for CAVS and DW were previously defined in Kconfig.
They are now defined via DTS and removed from Kconfig.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Catch interface up/down events so that we can renew the
address if interface goes down and is then restored.
Fixes#7553
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If carrier is ON or OFF, then tell this information to upper IP stack
so that it can act accordingly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add net_eth_carrier_on() and net_eth_carrier_off() functions that
can be called by ethernet device driver when it detects that carrier
is lost or found.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If CONFIG_NET_L2_ETHERNET_MGMT is not enabled, then provide
stubs for ethernet_mgmt_raise_carrier_on_event() and
ethernet_mgmt_raise_carrier_off_event() functions so that those
functions can be called always.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Update the application documentation to discuss the new ability to
use semicolons as separators when there are multiple files. Enabling
semicolon separators also enables CMake lists to manipulate CONF_FILE
from the application side.
Signed-off-by: Michael R Rosen <michael.r.rosen@intel.com>
Modify CONF_FILE variable treatment in the cmake infrastructure
to enable the use of CMake lists and semicolon-separated strings
in setting the CONF_FILE list for multiple configuration files.
This change does not impact the current method of using
single-space-separated strings for multiple files.
Signed-off-by: Michael R Rosen <michael.r.rosen@intel.com>
Doxygen has issues with function macros (those that don't end with a
semicolon). Workaround is to have doxygen treat these as predefined by
the doxygen preprocessor.
Fixes: #7367
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
The native_posix board does model irq_offload properly now
and therefore this test can be executed without problems.
So let's enable it.
Related to commit:
86b5364335
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fix in interrupt wrapping for native_posix so it also
supports meta-interrupts.
Related to commit:
3a0cb2d35d
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
New tests rely on irq_offload() actually being based on an
interrupt.
So let's base it on a new SW interrupt.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The _THREAD_POLLING bit in thread_state was never actually a
legitimate thread "state". It is a clever synchronization trick
introduced to allow the thread to release the irq_lock while looping
over the input event array without dropping events.
Instead, make that flag a word in the "poller" struct that lives on
the stack of the thread calling k_poll. The disadvantage is the 4
bytes of thread space needed. Advantages:
+ Cleaner API, it's now internal to poll instead of being globally
visible.
+ The thread_state bit space is just one byte, and was almost full
already.
+ Smaller code to write/test a full word and not a bitfield
+ Words are atomic, so no need for one of irq lock/unlock pairs.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Use logging settings consistent with other samples/net/sockets/ apps
(which includes error logging enabled by default).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Symbols that are assigned values in .config files must have satisfied
dependencies, and must have a prompt. Otherwise, the assigned value is
ignored. A warning is printed if the symbol ends up with a different
value than the assigned value as a result.
It might be difficult to know how to fix the problem just from seeing
the current warning. Add some hints to it to help out:
- The symbol information dialog in menuconfig is good for figuring out
dependencies that need to be enabled. Mention menuconfig in the
warning.
- The page for the symbol in the autogenerated Kconfig docs can be
helpful too, so link it. There's a slight chance that it'll be
outdated, but it's usually correct when working on the master
branch.
Automatically enabling dependencies is much trickier than it might seem
at first, due to the generality of Kconfig. See
https://github.com/zephyrproject-rtos/zephyr/issues/8181 for some
discussion.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
It's rather confusing to not see current TCP state in any way (it
makes distinguishing different TCP contexts very hard). And nobody
can know/remember that it's printed with CONFIG_NET_DEBUG_TCP
defined. So, just make it be printed always (initially I thought
about printing just numeric value if CONFIG_NET_DEBUG_TCP isn't
defined, but why, if we can print symbolic name easily).
Also, add a hint that defining CONFIG_NET_DEBUG_TCP will still
print even more info (like unacked pkt list) - similarly to
similar helpful hints we have in other parts of net shell.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Let's set it by default when allocating net_pkt. A macro will avoid
ifdefs as well
CONFIG_NET_TX_DEFAULT_PRIORITY is always defined.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
As stated in LIS2DH datasheet in section "5.1.1 I2C Operation",
in order to read/write multiple bytes on I2C it is necessary
to add the autoincrement bit to the subaddress field.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
The lis2dh_burst_write used "bus" as an input parameters, while
inside "dev" was referred. Now variable names are aligned.
Signed-off-by: Evgeny Kalugin <evgeny.kalugin@intel.com>
Introduce a custom HCI driver for the native POSIX port, which opens a
HCI User Channel socket to the Linux kernel to gain access to a local
Bluetooth controller.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The queue loop when CONFIG_POLL is in used has an inherent race
between the return of k_poll() and the inspection of the list where no
lock can be held. Other contending readers of the same queue can
sneak in and steal the item out of the list before the current thread
gets to the sys_sflist_get() call, and the current loop will (if it
has a timeout) spuriously return NULL before the timeout expires.
It's not even a hard race to exercise. Consider three threads at
different priorities: High (which can be an ISR too), Mid, and Low:
1. Mid and Low both enter k_queue_get() and sleep inside k_poll() on
an empty queue.
2. High comes along and calls k_queue_insert(). The queue code then
wakes up Mid, and reschedules, but because High is still running Mid
doesn't get to run yet.
3. High inserts a SECOND item. The queue then unpends the next thread
in the list (Low), and readies it to run. But as before, it won't
be scheduled yet.
4. Now High sleeps (or if it's an interrupt, exits), and Mid gets to
run. It dequeues and returns the item it was delivered normally.
5. But Mid is still running! So it re-enters the loop it's sitting in
and calls k_queue_get() again, which sees and returns the second
item in the queue synchronously. Then it calls it a third time and
goes to sleep because the queue is empty.
6. Finally, Low wakes up to find an empty queue, and returns NULL
despite the fact that the timeout hadn't expired.
The fix is simple enough: check the timeout expiration inside the loop
so we don't return early.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
No need to have a category for grove, instead moved the samples to both
sensors and display based on what the sample does.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This is not used by Zephyr directly and comes from a test framework. We
do matching in the sample.yaml file now.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The minimal libc source files have been added to 'app'. The Zephyr
build system should not be adding source files to the 'app' library
unless necessary.
This patch creates a new Zephyr CMake Library in lib/libc/minimal and
adds the sources to it.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
With updates to bt_gatt_notify and bt_gatt_indicate it is now possible
to pass the Characteristic attribute instead of its value which makes
the code able to verify if attribute properties are set correctly.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>