Commit graph

15 commits

Author SHA1 Message Date
Arkadiusz Balys 3afd564bba modules: openthread: platform: Added setting default tx power
There were some requests from users for adding the possibility
of setting default openthread tx output power using kConfig.
It is possible by adding the CONFIG_OPENTHREAD_DEFAULT_TX_POWER
kConfig and assigning it to the tx_power variable in the radio.c
file in the Openthread module.

Added the possibility to set default openthread power using
kConfig.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
2022-12-21 12:21:09 +01:00
Erwan Gouriou 66d4c64966 all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-12-21 10:09:23 +01:00
Eduardo Montoya 78cf49e0fd net: openthread: fix otPlatRadioSetMacKey when asserts are disabled
Ensure `otPlatRadioSetMacKey` is properly implemented when asserts are
disabled.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2022-11-23 11:37:24 +01:00
Robert Lubos 387a66131e net: pkt: Introduce minimum length requirement to net_pkt_get_frag()
net_pkt_get_frag() and a few other functions did not specify the
allocated fragment length, incorrectly assuming that fixed-sized
buffers are always used.

In order to make the function work properly also with variable-sized
buffers, extend the function argument list with minimum expected
fragment length parameter. This allows to use net_buf_alloc_len()
allocator in variable buffer length configuration, as well as verify if
the fixed-sized buffer is large enough to satisfy the requirements
otherwise.

Update the existing codebase to provide the expected fragment length,
based on the context.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-11-19 07:39:32 -05:00
Eduardo Montoya 257df2e21c net: openthread: implement PSA support for ECDSA API
Implement the four new ECDSA platform functions required by OT.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2022-11-17 11:20:03 +01:00
Florian Grandel f1e9dd2930 drivers: ieee802154: properly announce promisc mode
Most IEEE 802.15.4 drivers do not support promiscuous mode, some do.
There is a dedicated L2 flag to signal this capability to clients.

Unfortunately the IEEE 802.15.4 L2 stack does not announce this flag
even for drivers that correctly expose it in their HW capabilities.
Some clients (notably the OpenThread L2) even uses promiscuous mode
without checking whether the driver actually supports it.

This change lets the vanilla IEEE 802.15.4 L2 check the driver's
HW capabilities to announce promiscuous mode on its 'get_flags()'
interface if supported.

The OpenThread L2 uses a constant (potentially incorrect) response
to 'get_flags()'. Fixing the OpenThread L2 is out of scope of this
change. This change just introduces TODO messages to the OpenThread code
so that the OpenThread team may fix the issue (or delete the TODO if they
deem it irrelevant).

Fixes: #51263

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
2022-10-17 16:54:37 +02:00
Przemyslaw Bida 2636bb4e4a net: openthread: priortize usec timer for openthread port.
This commit prioritizes usec timer over msec. Doing so improves
CSL by helping scheduling timeslots on IEEE 802.15.4 with lower miss
rate.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2022-09-12 10:54:56 +00:00
Pieter De Gendt 8563744997 modules: openthread: Build FTD/MTD libraries based on device type
Set OpenThread specific cmake options depending on the selected
device type.
This reduces the number of libraries to build.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-09-02 17:48:50 +02:00
Lukasz Maciejonczyk abc89c497f net: openthread: add option for optimizing large packet transmission
If enabled the optimization is done at the expense of power consumption
on SED/SSED devices.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2022-08-30 10:26:02 +02:00
Gerard Marull-Paretas e0125d04af devices: constify statically initialized device pointers
It is frequent to find variable definitions like this:

```c
static const struct device *dev = DEVICE_DT_GET(...)
```

That is, module level variables that are statically initialized with a
device reference. Such value is, in most cases, never changed meaning
the variable can also be declared as const (immutable). This patch
constifies all such cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Eduardo Montoya ee2a8d9a64 net: openthread: allow to configure OPENTHREAD_MESSAGE_BUFFER_SIZE
Add `OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE` to Kconfig.

Also set the number of children to minumum possible for MTD builds
in order to save some resources (~512B of RAM).

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2022-08-10 12:01:18 +02:00
Gerard Marull-Paretas 8faa7b8891 modules: openthread: use zephyr,ieee802154 choice
Use chosen ieee802154 device from DT since
CONFIG_NET_CONFIG_IEEE802154_DEV_NAME is being phased out.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-10 11:57:34 +02:00
Pieter De Gendt 584d1966e4 modules: openthread: Fix building with picolibc
The OpenThread module should not explicitly link with libc in case of
minimal libc or picolibc.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-08-04 13:46:08 +02:00
Robert Lubos 815ebc316e net: openthread: Move glue code into module directory
Move OpenThread's glue code along with the Kconfig files that configure
OpenThread stack itself into module directory.

Update the maintainers file to reflect this change.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-07-11 11:00:12 +02:00
Przemyslaw Bida 47557d7d9d manifest: openthread: Simplification of openthread integration.
This commit moves openthread CMakeLists.txt from openthread submodule
to zephyr/modules/openthread.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2022-03-02 10:06:03 -08:00