Have the yaml_list now have 'node', 'bus', and 'compat' information
instead of just the 'node' info. For now we have all YAML nodes under
yaml_list['node'], however this will change to support sensors that
can be on I2C or SPI, since they will have the same compat, but
different YAML nodes.
This also introduces yaml_list['bus'] which has YAML nodes for any
compatiables on a given 'parent' bus (ie, 'i2c', or 'spi').
Finally, we also have yaml_list['compat'] with all the compatiables
that we parsed and matched to a YAML.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Change get_binding to take the node address instead of the
compatiable. This is in prep for having get_binding be able to look
at the parent of the node and determine which bus specific binding to
utilize (for cases like sensors that support both I2C & SPI).
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add accessor functions get_binding and get_binding_compats to
encapsulate access to binding database info. Cleanup all direct access
to binding info and replace with calls to get_binding() and
get_binding_compats()
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Various functions like add_prop_aliases, extract_single_prop,
extract_single, reg.extract, compatible.extract, default.extract, and
flash.extract don't use the yaml argument that is passed to them.
Remove passing the argument, this is the first step in making access to
the yaml node information go through an accessor function.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move the handling of 'inherits' in the YAML to right when we load. This
allows us to remove yaml_collapse function and will allow us to look
into the yaml right after we load it for things like if the yaml is for
a child bus.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The state2str() function should only be used if debugging
is enabled thus add some pre-processor checks there.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Print function and line number when changing state and when
debugging is enabled. Otherwise it is a bit difficult to follow
the program logic and locate the state change operation.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As the msg parameter for PRINT_INFO() is always a const string
that is not coming from stack, there is no need to use
log_strdup() here. This helps to avoid the
"<log_strdup alloc failed>" messages.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Material that is being written to the device, as well as blocks of
octets used to specify the operation, are never written to by the I2C
infrastructure. Applications should be permitted to store these objects
in immutable memory.
Update the API to add const qualifiers to object pointer arguments where
the corresponding address is used in an I2C write operation.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
MISRA-C says all declarations of an object or function must use the
same name and qualifiers.
MISRA-C rule 8.3
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
In C90 was introduced function prototype, that allows argument types
to be checked against parameter types, though it is not necessary
specify names for the parameters. MISRA-C requires names for function
prototype parameters, it claims that names can provide useful
information regarding the function interface.
MISRA-C rule 8.2
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
When __ASSERT is not enabled there is an attribution to the variable
total_partitions and it is never used.
MISRA-C rule 2.2
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
There is a function called _thread_entry defined in
lib/thread_entry.c. Just changing name to fix MISRA-C violation.
MISRA-C rule 5.8
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The order of evaluation of function calls in the arguments of a
function. This is undefined (32)/ unspecified(15-18) in C99.
MISRA-C rule 13.2 does not allow that a value of an expression and its
side effects happens in not deterministic order to avoid these
undefined behaviors.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The order of evaluation of function calls in the arguments of a
function. This is undefined (32)/ unspecified(15-18) in C99.
MISRA-C rule 13.2 does not allow that a value of an expression and its
side effects happens in not deterministic order to avoid these
undefined behaviors.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
According with MISRA-C and unconditional break statement must
terminate every switch-clause.
MISRA-C rule 16.1 and 16.3
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
MISRA-C requires the right-hand operand of && or || operator does not
contain persistent effect.
MISRA-C rule 13.5
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
We get an intermittent fail when running on qemu_xtensa. Disable this
sample for now on that platform to allow sanitycheck / CI to pass for
other PRs.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Update such statistic on all drivers.
Also, remove TX stats in native and stellaris drivers: such update is
done in L2 now.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Common statistics should be updated in one centralized place and
ethernet_send is the right place for tx stats, as well as ethernet_recv
for rx stats.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It's now either L2 which unref the pkt on successful tx, or net_if on
error.
Also removing pkt->frags check, net_core.c:net_send_data() does it
already.
And using data_len in logging instead of net_pkt_get_len(), which one is
currently greedy (it goes over all net_bufs).
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Just recalculate the chksum without resetting its value to 0, and test
if return value is 0.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
In order to clarify their use, add a brief description of the Device
Tree `aliases` and `chosen` nodes and their use in Zephyr.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Removed Console dependencies from shell uart backend.
Generated define: CONFIG_UART_SHELL_ON_DEV_NAME for each board.
Fixes#10191
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
The net_dhcpv4_stop() function stops the event listener for any IF_UP
events previously. In case multiple interfaces are used and optionally
being switched over, it could result in disabling dhcp unintentionally.
The callback is initialized at the init function and added/removed in
the start/stop function based on the interface list being empty
or not. (first added, last removed)
The event handler checks if the interface is in the list before acting
on it.
Signed-off-by: Vincent van der Locht <vincent@vlotech.nl>
In case "net_dhcpv4_stop(..) is called when the interface is
in NET_DHCPV4_RENEWING state, the address is not removed.
When deleting the address in the NET_DHCPV4_RENEWING state
means the status is always equal to the moment before _start
is called.
Signed-off-by: Vincent van der Locht <vincent@vlotech.nl>
The unit test gives net_context_get() an invalid protocol family
value which triggers an assert in net_context.c:160
This assert fails the test when it should not as we properly
check the return value. Fix this by disabling asserts for this
test.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The network interface mac address was not initialized properly
which caused assert in net_if.c:2881 to fail.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Avoid dependency to logging subsystem in NET_ASSERT*(), so
use standard Zephyr asserts instead.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Use generic logging macros LOG_*() instead of NET_*() as the
latter are mostly meant for internal networking stack use.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.
Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.
Fixes#11343Fixes#11659
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Solves an issue where any output from the user's shell's cd command
would be prepended to ZEPHYR_BASE when sourcing zephyr_env.sh.
Fixes#11894.
Signed-off-by: Linden Krouse <ztaticnull@gmail.com>
Previously, this was only built if CONFIG_EXCEPTION_DEBUG
was enabled, but CONFIG_USERSPACE needs it too for validating
strings sent in from user mode.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Adding ninja targets based on the files that are to be copied into the
build folder doesn't seem to speed up the build, so simplify the CMake
script by relying on extract_content.py to do the copy.
Numbers on my machine:
* master
clean: 6m45.541s, 6m8.113s
incremental: 1m24.233s, 1m32.720s
* revert
clean: 6m25.221s, 6m19.751s
incremental:1m20.893s, 1m20.337s
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add Bluetooth, 802.15.4 and OpenThread overlay configurations to socket
echo_client and echo_server samples.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Sample application to demonstrate usage of cmsis_rtos_v1 APIs
with dining philosopher's problem implementation.
This covers semaphores, mutex and thread APIs of CMSIS RTOS V1.
Signed-off-by: Spoorthi K <spoorthi.k@intel.com>