-
Notifications
You must be signed in to change notification settings - Fork 7.3k
openthread: Move OpenThread implementation from net to modules #89090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
openthread: Move OpenThread implementation from net to modules #89090
Conversation
I will add a release note and migration guide entries to this PR soon. |
cc18e05
to
54a60ae
Compare
54a60ae
to
1db166c
Compare
1db166c
to
6509f4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks fine, but need to figure out what's broken - apart from the twister issues, BabbleSim shows the Thread network fails to start.
Yeah, I'm debugging it locally to figure it out. |
6509f4e
to
616fbde
Compare
26203f8
to
aff1452
Compare
d6815ed
to
133c4e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the detailed migration guide.
doc/releases/migration-guide-4.2.rst
Outdated
|
||
* Now use: | ||
|
||
* ``openthread_mutex_lock`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion: for the new functions we could use func reference to generate links in the documentation
:c:func:`openthread_mutex_lock`
etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I have it. All new things (structs, kconfigs, functions) are now shown as links. Deprecated functions remain as they were previously.
b61a12e
to
e84fc07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Some mostly nits found.
e84fc07
to
7bd9745
Compare
@Damian-Nordic, I've provided all suggested changes, thanks! |
7bd9745
to
645dfea
Compare
645dfea
to
5de8d57
Compare
Move OpenThread-related code from zephyr/subsys/net/l2/openthread/openthread.c to zephyr/modules/openthread/platform/openthread.c. The primary goal of this refactor is to enable the use of OpenThread as an independent module, without the necessity of Zephyr's networking layer. This change is particularly beneficial for simple applications that have their own implementation of the IEEE802.15.4 driver and do not require a networking layer. These applications can now disable Zephyr's L2 and IEEE802.15.4 shim layers and directly use the OpenThread module, saving valuable kilobytes of memory. In this approach if the CONFIG_NET_L2_OPENTHREAD Kconfig option is set, Zephyr's L2 and IEEE802.15.4 layers will be used, and everything will function as before. The main difference is the Zephyr's L2 layer now uses the OpenThread module, no longer implementing it. While most of the functions in include/net/openthread.h have been deprecated, they are still available for use to maintain backwards compatibility. Signed-off-by: Arkadiusz Balys <[email protected]>
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]>
An implementation should use a dedicated function to get openthread instance instead of using the private L2 data. Signed-off-by: Arkadiusz Balys <[email protected]>
Some OpenThread logs were moved from L2 to the OpenThread module, so enable logging from there to keep previous logging visibility. Signed-off-by: Arkadiusz Balys <[email protected]>
Discussed offline that the new |
5de8d57
to
77b12cb
Compare
Move OpenThread-related code from
zephyr/subsys/net/l2/openthread/openthread.c
tozephyr/modules/openthread/platform/openthread.c
.The primary goal of this refactor is to enable the use of OpenThread as an independent module, without the necessity of Zephyr's networking layer.
This change is particularly beneficial for simple applications that have their own implementation of the IEEE802.15.4 driver and do not require a networking layer. These applications can now disable Zephyr's L2 and IEEE802.15.4 shim layers and directly use the OpenThread module, saving valuable kilobytes of memory.
In this approach, if the
CONFIG_NET_L2_OPENTHREAD
Kconfig option is set, Zephyr's L2 and IEEE802.15.4 layers will be used, and everything will function as before. The main difference is that the Zephyr's L2 layer now uses the OpenThread module, no longer implementing it.While most of the functions in
include/net/openthread.h
have been deprecated, they are still available for use to maintain backwards compatibility.