Currently there is no way to distinguish between a caller
explicitly asking for a semaphore with a limit that
happens to be `UINT_MAX` and a semaphore that just
has a limit "as large as possible".
Add `K_SEM_MAX_LIMIT`, currently defined to `UINT_MAX`, and akin
to `K_FOREVER` versus just passing some very large wait time.
In addition, the `k_sem_*` APIs were type-confused, where
the internal data structure was `uint32_t`, but the APIs took
and returned `unsigned int`. This changes the underlying data
structure to also use `unsigned int`, as changing the APIs
would be a (potentially) breaking change.
These changes are backwards-compatible, but it is strongly suggested
to take a quick scan for `k_sem_init` and `K_SEM_DEFINE` calls with
`UINT_MAX` (or `UINT32_MAX`) and replace them with `K_SEM_MAX_LIMIT`
where appropriate.
Signed-off-by: James Harris <james.harris@intel.com>
As network interface array size might be larger than the actual
network interface count, check this condition and ignore those
interfaces that are not in use.
We cannot know for certain how many network interfaces there
are at built time, as the total count is only available at runtime.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The network interface index is very useful info to see in
debug prints so add those to debug output.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If networking pre-emptive thread priorities are enabled,
then use the proper macro to enable them.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The name of the connection manager thread (conn_mgr_thread) was
unnecessarily long in "kernel stacks" command. So make the name
to "conn_mgr" which fits nicely to the output of that command.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The time parameter cannot be K_NO_DELAY because the time delay
parameter is ms so using value 0 instead.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Use this short header style in all Kconfig files:
# <description>
# <copyright>
# <license>
...
Also change all <description>s from
# Kconfig[.extension] - Foo-related options
to just
# Foo-related options
It's clear enough that it's about Kconfig.
The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)
git ls-files '*Kconfig*' | \
xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Re-run with updated script to convert integer literal delay arguments
to k_thread_create and K_THREAD_DEFINE to use the standard timeout
macros.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Allow user to disable native IP stack and use offloaded IP
stack instead. It is also possible to enable both at the same
time if needed.
Fixes#18105
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure we use the IPv4 event command when checking IPv4 address
add or delete instead of event mask.
Coverity-CID: 203483
Fixes#18400
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
IPv4 connection management status is stored in wrong
variable. ip_state should hold the status and then
it should be stored in state variable.
Fixes#18253
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
- Commands were not gathered with the right macro
- bus fault access due to wrong declaration of iface_states external
variable.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It currently only listens to relevant events about network interface to
decide whether raising connected or disconnected event.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>