The Kconfig symbol CONFIG_USB_DEVICE_HID_BOOTP isn't defined anywhere,
so remove dead code associated with it.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This patch fixes possible null pointer dereference in
net_stats_update_rpl_resets(...).
net_rpl_set_root_with_version(...) does not initialize instance->iface
and calls net_rpl_reset_dio_timer(...), which then calls
net_stats_update_rpl_resets(instance->iface).
fixes: #7862
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Some versions of gcc do not seem to compile out the inaccessible code
in this case and instead give the following error:
subsys/bluetooth/host/mesh/transport.c:419: undefined reference to
`bt_mesh_lpn_poll'
This happens at least when building samples/bluetooth/mesh for
native_posix on Fedora 28.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Implement the new entropy_get_entropy_isr() function to allow the kernel
to collect entropy before the scheduler and kernel data structures are
ready. Switch to an nrf-specific version for high-performance
requirements in the BLE Link Layer.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This keeps biting us; sanitycheck turns on assertions by
default for tests, but standalone builds, or builds done
for other test infrastructure do not. Put all builds in
the same state.
Specific tests (such as benchmarks) can override this with
CONFIG_FORCE_NO_ASSERT.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Rename CONFIG_RNDIS_TX_BUF_* to CFG_RNDIS_TX_BUF_* and rename
CONFIG_RNDIS_CMD_BUF_* to CFG_RNDIS_CMD_BUF_*. The CONFIG options where
not exposed in Kconfig so limit use of CONFIG_ to Kconfig only symbols.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Remove non-existent Kconfig symbol references. An additional (but
related) change is the removal of all persistent storage symbols from
the Arduino 101 Bluetooth shell app, since BT_STORAGE no longer
exists.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Not only removes a branch during normal operation, but also ensures
that, by initializing at the PRE_KERNEL_2 stage, and granting
privileges to all threads to the semaphore, this code will work in
early boot situations and in user mode.
This assumes that entropy drivers will all initialize during
PRE_KERNEL_1 stage. All in-tree drivers do that.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The code was using MSEC() macro in few places instead of more
proper K_MSEC(). The MSEC() takes seconds as a parameter and
K_MSEC() takes milliseconds.
Fixes#7657
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
sin6_scope_id is not set anywhere and not used. Probably left over
from old ZOAP library. Just address, port and family type are enough
to find registered CoAP observer.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
The next error check is much more suitable to handle the error due to
the error message which lets the user know that something went wrong.
Fixes#7661.
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
In switch statement break statement was missing causing IPv4 part to
execute even if the packet is IPv6. Also logical negation is wrong in
this context.
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
Leading/trailing whitespace in prompts requires ugly workarounds in
genrest.py, as e.g. *prompt * is invalid RST. strip() all prompts in
Kconfiglib and get rid of the genrest.py workarounds. Add a warning too.
The Kconfiglib update has some unrelated cleanups and fixes (that won't
affect Zephyr).
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This was declared but unused. And recent toolchains have apparently
started warning on it leading to sanitycheck failures.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
NET_ASSERT is useless here, as we already know that an error happened.
Use NET_ERR in order to print a more informative message.
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
When calling net_frag_read(), frag == NULL is an error only if pos is
not zero. It is thus incorrect to throw an error only if !frag, as
pos must also be checked to be not zero.
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
Current implementation hardcoded channel in received frame structure.
With this change channel can be retrieved from a OpenThread platform,
and put in the frame. In result procedures like Discovery can be
executed correctly. Change was tested with OpenThread Border Router.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit contains bugfix for Joiner eui-64 handling and setting radio
in correct mode after calling thread stop.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The Bluetooth core specification splits the valid LE L2CAP PSM range
into two subranges:
- Standard, SIG-assigned fixed PSM values in the range 0x0001-0x007f
- Dynamic, allocated at runtime in the range 0x0080-0x00ff
Previously the bt_l2cap_server_register() API was assuming that the
app would always decide the PSM, which effectively made it impossible
to have collision-free dynamic PSMs. This patch extends the
implementation so that if server->psm is 0, then the stack will look
for a free PSM from the dynamic range and take it into use.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Instead of having an ivu_unknown variable to track when we can ignore
the 96-hour minimum duration requirement, simply set the duration to
the minimum (96 hours) in the places where ivu_unknown would have been
1.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If a packet with source IP address and port same as the address of echo
server is received, it causes echo server to recursively send the packet
to itself, resulting in a crash and memory depletion. This commit fixes
the crash by dropping the packet.
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
When designing the registration client for LwM2M, I understood
that the LwM2M Technical Specification allows for a multi-server
connection setup where the client makes several connections
to various LwM2M servers and allows each of them to manage
various aspects of the LwM2M client based on Access Controls.
However, the way I implemented it was not well thought out and
as we look forward to adding Bootstrap support, it needs a
do over.
Let's remove all of the code dedicated to handling multiple LwM2M
client connections. This will simplify and reduce the code size
of the registration client considerably.
Later, once Bootstrap support has been added, we can implement
multi-server connections in a cleaner manner.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
This allows a user to customize the port used for downloading
firmware via the pull method of the LwM2M client. It's default
value of 0 will select a random port during initialization.
NOTE: If set, this value should not be the same port as the
LWM2M_LOCAL_PORT setting.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Due to a bug where LWM2M_LOCAL_PORT was not being honored, all
outgoing traffic from the LwM2M client was coming from a random
port determined during initialization.
Now that this bug bas been fixed, let's default the client to the
behavior that most users are expecting, and let new users customize
the outgoing port if needed (which should be rarely).
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Currently, CONFIG_LWM2M_LOCAL_PORT is never used when setting up
the LwM2M client. Let's set the port of the local address using
CONFIG_LWM2M_LOCAL_PORT, so that the client can bind to it.
NOTE: A setting of 0 will use a random port.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Currently, the client_addr parameter is only used to check the
sa_family at various points during the init process. Both the
IP address and the port are ignored. Let's set the local client's
port based on the port value of the passed in client_addr if one
is supplied.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
The port parameter passed to _net_app_set_local_addr() is converted
from host byte-order to network byte-order. Here we are passing
a port value which has already been translated to network byte-order.
Let's translate the local port to host byte-order when passing it
to _net_app_set_local_addr() to fix this issue.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
There were multiple spots where code was using the _wait_q_t
abstraction as a synonym for a dlist and doing direct list management
on them with the dlist APIs. Refactor _wait_q_t into a proper opaque
struct (not a typedef for sys_dlist_t) and write a simple wrapper API
for the existing usages. Now replacement of wait_q with a different
data structure is much cleaner.
Note that there were some SYS_DLIST_FOR_EACH_SAFE loops in mailbox.c
that got replaced by the normal/non-safe macro. While these loops do
mutate the list in the code body, they always do an early return in
those circumstances instead of returning into the macro'd for() loop,
so the _SAFE usage was needless.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
When the IV Update state enters Normal operation or IV Update in
Progress, we need to keep track of how many hours has passed in the
state, since the specification requires us to remain in the state at
least for 96 hours (Update in Progress has an additional upper limit
of 144 hours).
In order to fulfil the above requirement, even if the node might be
powered off once in a while, we need to store persistently how many
hours the node has been in the state. This doesn't necessarily need to
happen every hour (thanks to the flexible duration range). The exact
cadence will depend a lot on the ways that the node will be used and
what kind of power source it has.
Since there is no single optimal answer, this patch adds a new
configuration option, which allows specifying a divider, i.e. how many
intervals the 96 hour minimum gets split into. After each interval the
duration that the node has been in the current state gets stored to
flash. E.g. the default value of 4 means that the state is saved every
24 hours (96 / 4).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
L2 could take advantage of such hardware capability, when supported by
the device. This is also required for OpenThread.
Fixes#5714
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The settings_init() API was protected against multiple calls, but the
only function that calls it, settings_subsys_init(), was not. Add the
protection to the higher-level function as well.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
After introducing persistent storage, it's useful for an app to check
if the node has been provisioned or not.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Previously, there was a boolean CONFIG_NET_TCP_TIME_WAIT setting
("master switch") and numeric CONFIG_NET_TCP_2MSL_TIME setting,
both named not ideally (there were both NET_TCP_TIME_WAIT and
CONFIG_NET_TCP_TIME_WAIT symbols in the source, with very different
meaning; "2MSL_TIME" was also a roundabout way to refer to
TIME_WAIT state time). In addition to that, some code was defining
adhoc, hardcoded duplicates for these settings.
CONFIG_NET_TCP_2MSL_TIME was also measured in seconds, giving
poor precision control for this resource-tying setting.
Instead, replace them all with the single
CONFIG_NET_TCP_TIME_WAIT_DELAY setting, measured in milliseconds.
The value of 0 means that TIME_WAIT state is skipped.
Fixes: #7459
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
We only clear 3 of the 6 member variables of the coap_reply structure
in coap_reply_clear().
Let's make sure to reset all of them.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
The base CoAP retry setting is quite fast for network technologies
such as LTE-M and LoRa. Let's add an option to delay retries
a bit longer depending on the need.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Using IPSO Smart Object Guideline: "Smart Objects Starter Pack 1.0"
dated May 27, 2017, let's mark the OPTIONAL resources for an
IPSO Temperature object (Section 10. "IPSO Object: Temperature").
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Using IPSO Smart Object Guideline: "Smart Objects Starter Pack 1.0"
dated May 27, 2017, let's mark the OPTIONAL resources for an
IPSO Light Control object (Section 16. "IPSO Object: Light Control")
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Using OMA Technical Specification LwM2M Enabler 1.0.2 dated
Feb. 9, 2018, let's mark the OPTIONAL resources for an LwM2M
Firmware Update object (Section E.6 "LwM2M Object: Firmware
Update")
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Using OMA Technical Specification LwM2M Enabler 1.0.2 dated
Feb. 9, 2018, let's mark the OPTIONAL resources for an LwM2M
Device object (Section E.4 "LwM2M Object: Device")
As a result, the Device object no longer configures the default
buffers for data storage of several optional resources.
The LwM2M client sample is also changed to to setup these read-only
buffers instead.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Using OMA Technical Specification LwM2M Enabler 1.0.2 dated
Feb. 9, 2018, let's mark the OPTIONAL resources for an LwM2M
Server object (Section E.1 "LwM2M Object: Server")
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>