Skip to content

Commit 616fbde

Browse files
doc: releases: add release note for OpenThread update
Add an entry to the release note and migration guide regarding moving the OpenThread implementation from the L2 networking layer to the OpenThread module. The migration guide note contains information about deprecated functions, explains what functions should be used instead and provides a guide for required updates in users' applications. Signed-off-by: Arkadiusz Balys <[email protected]>
1 parent 97a6ec9 commit 616fbde

File tree

2 files changed

+75
-3
lines changed

2 files changed

+75
-3
lines changed

doc/releases/migration-guide-4.2.rst

+72-3
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,78 @@ Networking
304304
the server commands, enable :kconfig:option:`NET_ZPERF_SERVER`. If server support
305305
is not needed, :kconfig:option:`ZVFS_POLL_MAX` can possibly be reduced.
306306

307-
* The OpenThread-related Kconfig options from ``subsys/net/l2/openthread/Kconfig`` have been moved to
308-
``modules/openthread/Kconfig``. All the Kconfig options remain the same. You can still use them in the
309-
same way as before, but to modify them, use the new path in the menuconfig or guiconfig.
307+
OpenThread
308+
==========
309+
310+
* The OpenThread stack integration in Zephyr has undergone a major refactor.
311+
The implementation has been moved from the Zephyr networking layer (``subsys/net/l2/openthread/``)
312+
to a dedicated module (``modules/openthread/platform/``).
313+
314+
* OpenThread is now a standalone module in Zephyr.
315+
It can be used independently of Zephyr's networking stack (L2 and IEEE802.15.4 shim layers).
316+
This enables new use cases, such as applications that use OpenThread directly with their
317+
own IEEE802.15.4 driver, or that do not need the full Zephyr networking stack.
318+
319+
* Most functions in the ``include/net/openthread.h`` file have been deprecated.
320+
These deprecated APIs are still available for backward compatibility, but new applications should
321+
use the new APIs provided by the OpenThread module. The following list summarizes the changes:
322+
323+
* Mutex handling:
324+
* Previously:
325+
* ``openthread_api_mutex_lock``
326+
* ``openthread_api_mutex_try_lock``
327+
* ``openthread_api_mutex_unlock``
328+
* Now use:
329+
* ``openthread_mutex_lock``
330+
* ``openthread_mutex_try_lock``
331+
* ``openthread_mutex_unlock``
332+
* OpenThread starting:
333+
* Previously: ``openthread_start``
334+
* Now use: ``openthread_run``
335+
* Callback registration:
336+
* Previously:
337+
* ``openthread_state_changed_cb_register``
338+
* ``openthread_state_changed_cb_unregister``
339+
* Now use:
340+
* ``openthread_state_change_callback_register``
341+
* ``openthread_state_change_callback_unregister``
342+
* Callback structure:
343+
* Previously: ``openthread_state_changed_cb``
344+
* Now use: ``openthread_state_changed_callback``
345+
* The following ``openthread_context`` struct fields are deprecated and shall not be used in
346+
new code anymore:
347+
* ``instance``
348+
* ``api_lock``
349+
* ``work_q``
350+
* ``api_work``
351+
* ``state_change_cbs``
352+
* The new functions that were not present before:
353+
* ``openthread_init`` to initialize the OpenThread stack.
354+
* ``openthread_stop`` to stop and disable the OpenThread stack.
355+
356+
* The OpenThread-related Kconfig options from ``subsys/net/l2/openthread/Kconfig`` have been moved
357+
to ``modules/openthread/Kconfig``. All Kconfig options remain the same. You can still use them
358+
in the same way as before, but to modify them, use the new path in the menuconfig or guiconfig.
359+
360+
* If the ``CONFIG_NET_L2_OPENTHREAD`` Kconfig option is enabled, Zephyr's L2 layer will use the new
361+
OpenThread module API as its backend. The L2 layer no longer implements OpenThread itself, but
362+
delegates the implementation to the module.
363+
364+
* For existing applications using OpenThread through Zephyr's networking stack:
365+
* Your application should continue to work, as the old APIs are still available for compatibility.
366+
However, you are encouraged to migrate to the new APIs for future-proofing and use the new
367+
modular structure.
368+
* Update any references to OpenThread Kconfig options to use the new path
369+
(``modules/openthread/Kconfig``) in your configuration tools.
370+
* For applications using ``openthread_context`` or other deprecated APIs:
371+
* Begin migrating to the new APIs. The deprecated APIs will be removed in a future release.
372+
* Avoid direct use of ``openthread_context`` and related fields; use the new initialization and
373+
callback registration functions instead.
374+
* For new applications or those using OpenThread without Zephyr L2:
375+
* Use the new initialization (``openthread_init``), run (``openthread_run``), and callback
376+
registration APIs.
377+
* You can now use OpenThread directly, without enabling Zephyr's L2 or IEEE802.15.4 layers, if
378+
your use case allows.
310379

311380
SPI
312381
===

doc/releases/release-notes-4.2.rst

+3
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ New APIs and options
176176
* OpenThread
177177

178178
* Moved OpenThread-related Kconfig options from ``subsys/net/l2/openthread/Kconfig`` to ``modules/openthread/Kconfig``.
179+
* OpenThread has been refactored into a standalone module, decoupled from Zephyr's networking stack.
180+
Most old APIs have been deprecated and the new APIs is used by the Zephyr L2 layer to maintain backward compatibility.
181+
For migration steps and details, see the :ref:`migration guide <migration_4.2>`.
179182

180183
* Sensor
181184

0 commit comments

Comments
 (0)