-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
[RFC] net: ieee802154: (re-)enforce vendor and protocol neutrality of the driver API #61227
Comments
@rlubos @jciupis @hubertmis We've been discussing the topic of this RFC on several occasions and I had promised to summarize my proposals and our discussion in one RFC. Here it is. |
@carlescufi @rlubos I think it makes sense that you review and comment on this RFC before we discuss it in the architecture WG. It is probably too specialized to discuss it in detail with 20 people in the call. I had asked @nashif to postpone it in the arch wg until when you have a chance to participate. I think your wholehearted approval is vital - otherwise it doesn't make sense. |
Thanks @fgrandel for the comprehensive description of the idea. As a high level feedback, I'm ok with separating concepts of PHY/offloaded MAC features into separate components of the 15.4 radio driver API. I think it could even be considered to move certain APIs/configurations introduced specifically for OpenThread into recently introduced OT extension header, so that they do not stand in a way of other 15.4 based protocols (although this should be discussed with OT contributors). There are however a few items that in my ignorance, require some clarification.
Ok, but I'm not sure if nRF5 is a proper example here. The driver is intended (on newer SoCs) to run on a separate NET core, not the CPU where L2/soft-MAC implementation would be executed. Therefore, for me, I'm not convinced that the driver contents should be considered as a soft-MAC solution that could be implemented in a "vendor-agnostic way w/o loss of performance".
By "stands fundamentally in the way" I understand there are some major blockers preventing other L2 implementations. I think it'd make sense to list the blockers, and decide one by one on how to proceed (either fix, in a way we don't break OT support, or make a particular config/api introduced for the sake of OT, OT specific).
Is "basic Thread protocol support" really that hard to achieve? I think we should settle on what "basic" means, but all of the advanced MAC features (CSL, IE support for Link Metrics , TX security) are either optional (need to be explicitly enabled) or have a soft-MAC variant in OT itself (like TX security). |
@rlubos Thanks for your review! :-)
Code that is always running on a dedicated (non-Zephyr) NET core is by definition offloaded code. Such code is not covered by this clause and most of the time cannot be ported anyway. CC13/26xx's radio core for example only accepts proprietary "blobs". If, however, code may optionally run as part of Zepyhr-scheduled threads or ISRs, then it can be pulled into a shared "Soft MAC" w/o any loss of performance: Calls into the proprietary driver can be replaced by equivalent "inversion of control" calls into a shared L2 - no matter on which core it runs. Whether this is "fast enough" on a single core is not an L2 architecture choice but a decision to be taken by individual driver maintainers. AFAICS the nRF5 driver contains code that (at least optionally) runs in Zephyr-scheduled threads or ISRs. The driver has a dedicated "mac_features" folder mostly implementing standard L2 primitives plus implements further standard L1/L2 primitives sprinkled throughout the rest of the code. Such code would be covered by this RFC. This doesn't mean that I'm proposing to migrate existing code (see "Concerns and Unresolved Questions"). I'm just proposing that future PRs SHALL NOT introduce further such code and that existing code MAY be ported into shared L2 by whoever finds it worth the time.
No, nothing blocks alternative L2 implementations and you're right that the way I wrote it was ambivalent (hopefully fixed). Alternative implementations are just unnecessarily hard as the Zephyr-runnable code I mention above has not been pulled into granular re-usable primitives as prescribed by the standard. By "fixing this situation" I mean that alternative re-usable implementations of these standard primitives should be provided rather than trying to migrate existing code, see "Concerns and Unresolved Questions". I would only "repair" existing code when it's actually less effort. Once such an alternative exists, existing drivers may or may not choose to migrate to the community-maintained re-usable version.
The individual features that cannot be re-used have been listed in the linked discussion thread.
Which OT-specific features are you speaking about? IMO the latest OT stack is exclusively based on plain IEEE 802.15.4 with some additional refinements inside the limits of the standard. The only non-standard OT feature I'm aware of is multi-CCA which we already pulled into its own namespace. All features required to support Thread 1.3.1 (not only OT) fall into the categories covered by this RFC. By the rules of this RFC it would therefore be wrong to place anything of this in an OT-specific API.
By "basic" I mean: "The most recent version of the standard with restrictions only in precise timing of ACKs" (but not CSL which can easily be scheduled in advance). I've updated the RFC text accordingly to be more precise. Prior versions of the standard may be even easier to support, as you say. Could you or the OT team easily name the parts of the API to be implemented for the different Thread versions? |
I was referring to the configs that were introduced to address OT radio API requirements:
I understand they cover standard 802.15.4 features, although from the RFC I also understood that in their current form they're difficult to reuse in other upper-layer implementations. Therefore, as part of the "alternative" solutions approach you suggested:
they could be moved to OT namespace and possibly deprecated in the future if possible.
I can think of improving documentation in this area. |
@rlubos Yeah, we have the same features in mind, except for RX slots. RX slots are already re-usable and do not need any further refactoring beyond what we've already done. We agree that these are all standard features. The fact that we've been thinking of them as "Thread requirements" is the problem I'm trying to address. IMO we should stop relating anything in L1/L2 specifically to [Open]Thread or a vendor's offloading choices unless it is really specific to that protocol stack or SoC. This has nothing to do with offloading as such. It just means that both, soft MAC and offloading APIs that implement standard features, SHALL NOT be tied in any way to upper layers or to a specific vendor's SoC.
I'm not in favor of moving standard-based features into an underspecified OT architecture block where they conceptually do not belong. This would just cement and "legitimize" the current status quo and provide an unwanted "safe haven" for it. IMO our limited resources should go into eliminating the problem rather than moving it. Therefore I'd deprecate non-reusable APIs in place if we cannot fix them.
Wow, that would be great. :-) |
Closed as "accepted" by the Arch WG with no objections. As no further immediate action is implied by this RFC it can be considered "done". |
Introduces new rules for IEEE 802.15.4 driver nomenclature, see zephyrproject-rtos#61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces new rules for IEEE 802.15.4 driver nomenclature, see zephyrproject-rtos#61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces new rules for IEEE 802.15.4 driver nomenclature, see zephyrproject-rtos#61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces new rules for IEEE 802.15.4 driver nomenclature, see zephyrproject-rtos#61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces new rules for IEEE 802.15.4 driver nomenclature, see zephyrproject-rtos#61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces new rules for IEEE 802.15.4 driver nomenclature, see zephyrproject-rtos#61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces new rules for IEEE 802.15.4 driver nomenclature, see #61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces new rules for IEEE 802.15.4 driver nomenclature, see zephyrproject-rtos#61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces new rules for IEEE 802.15.4 driver nomenclature, see zephyrproject-rtos#61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces new rules for IEEE 802.15.4 driver nomenclature, see zephyrproject-rtos#61227. Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE option and introduces certain "soft MAC" capabilities around header IEs: * Introduces types and helpers that allow driver maintainers to represent, parse, write and validate header IEs. * Introduces helper functions to access non-aligned fields in header IEs, namely element IDs. Updates the only existing L2 and driver pair that uses IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5 and improves header IE validation in the nRF5 driver. This change should help further driver maintainers to support OpenThread's CSL and vendor IE extensions. It is based on the rules specified in RFC zephyrproject-rtos#61227. It is also a precondition to generically support both, "soft MAC" and "hard MAC", approaches to header IEs in the TSCH protocol, namely the time synchronization IE. Fixes: zephyrproject-rtos#62940 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
DNM: Requires zephyrproject-rtos/hal_nordic#142 to be merged first. This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several IEEE 802.15.4 standard sub-protocols. This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE option and introduces certain "soft MAC" capabilities around header IEs: * Introduces types and helpers that allow driver maintainers to represent, parse, write and validate header IEs. * Introduces helper functions to access non-aligned fields in header IEs, namely element IDs. Updates the only existing L2 and driver pair that uses IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5 and improves header IE validation in the nRF5 driver. This change should help further driver maintainers to support OpenThread's CSL and vendor IE extensions. It is based on the rules specified in RFC zephyrproject-rtos#61227. It is also a precondition to generically support both, "soft MAC" and "hard MAC", approaches to header IEs in the TSCH protocol, namely the time synchronization IE. Fixes: zephyrproject-rtos#62940 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE option and introduces certain "soft MAC" capabilities around header IEs: * Introduces types and helpers that allow driver maintainers to represent, parse, write and validate header IEs. * Introduces helper functions to access non-aligned fields in header IEs, namely element IDs. Updates the only existing L2 and driver pair that uses IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5 and improves header IE validation in the nRF5 driver. This change should help further driver maintainers to support OpenThread's CSL and vendor IE extensions. It is based on the rules specified in RFC zephyrproject-rtos#61227. It is also a precondition to generically support both, "soft MAC" and "hard MAC", approaches to header IEs in the TSCH protocol, namely the time synchronization IE. Fixes: zephyrproject-rtos#62940 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE option and introduces certain "soft MAC" capabilities around header IEs: * Introduces types and helpers that allow driver maintainers to represent, parse, write and validate header IEs. * Introduces helper functions to access non-aligned fields in header IEs, namely element IDs. Updates the only existing L2 and driver pair that uses IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5 and improves header IE validation in the nRF5 driver. This change should help further driver maintainers to support OpenThread's CSL and vendor IE extensions. It is based on the rules specified in RFC zephyrproject-rtos#61227. It is also a precondition to generically support both, "soft MAC" and "hard MAC", approaches to header IEs in the TSCH protocol, namely the time synchronization IE. Fixes: zephyrproject-rtos#62940 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE option and introduces certain "soft MAC" capabilities around header IEs: * Introduces types and helpers that allow driver maintainers to represent, parse, write and validate header IEs. * Introduces helper functions to access non-aligned fields in header IEs, namely element IDs. Updates the only existing L2 and driver pair that uses IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5 and improves header IE validation in the nRF5 driver. This change should help further driver maintainers to support OpenThread's CSL and vendor IE extensions. It is based on the rules specified in RFC zephyrproject-rtos#61227. It is also a precondition to generically support both, "soft MAC" and "hard MAC", approaches to header IEs in the TSCH protocol, namely the time synchronization IE. Fixes: zephyrproject-rtos#62940 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE option and introduces certain "soft MAC" capabilities around header IEs: * Introduces types and helpers that allow driver maintainers to represent, parse, write and validate header IEs. * Introduces helper functions to access non-aligned fields in header IEs, namely element IDs. Updates the only existing L2 and driver pair that uses IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5 and improves header IE validation in the nRF5 driver. This change should help further driver maintainers to support OpenThread's CSL and vendor IE extensions. It is based on the rules specified in RFC zephyrproject-rtos#61227. It is also a precondition to generically support both, "soft MAC" and "hard MAC", approaches to header IEs in the TSCH protocol, namely the time synchronization IE. Fixes: zephyrproject-rtos#62940 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE option and introduces certain "soft MAC" capabilities around header IEs: * Introduces types and helpers that allow driver maintainers to represent, parse, write and validate header IEs. * Introduces helper functions to access non-aligned fields in header IEs, namely element IDs. Updates the only existing L2 and driver pair that uses IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5 and improves header IE validation in the nRF5 driver. This change should help further driver maintainers to support OpenThread's CSL and vendor IE extensions. It is based on the rules specified in RFC zephyrproject-rtos#61227. It is also a precondition to generically support both, "soft MAC" and "hard MAC", approaches to header IEs in the TSCH protocol, namely the time synchronization IE. Fixes: zephyrproject-rtos#62940 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
"Sleeping" has a well defined meaning in Zephyr related to threading and power management. This differs from OpenThread's definition: - Deprecates the "SLEEP_TO_TX" capability as it is redundant and conflicts with all of Zephyr's nomenclature, zephyrproject-rtos#61227, RFC 2863, Thread standard and IEEE 802.15.4. This binds the API to an implementation detail of OpenThread, instead. - Renames the "SLEEP" event to "RX_OFF" which conforms to the nomenclature in Zephyr, this API and IEEE 802.15.4. Fixes: zephyrproject-rtos#62995 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
"Sleeping" has a well defined meaning in Zephyr related to threading and power management. This differs from OpenThread's definition: - Deprecates the "SLEEP_TO_TX" capability as it is redundant and conflicts with all of Zephyr's nomenclature, zephyrproject-rtos#61227, RFC 2863, Thread standard and IEEE 802.15.4. This binds the API to an implementation detail of OpenThread, instead. - Renames the "SLEEP" event to "RX_OFF" which conforms to the nomenclature in Zephyr, this API and IEEE 802.15.4. Fixes: zephyrproject-rtos#62995 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
"Sleeping" has a well defined meaning in Zephyr related to threading and power management. This differs from OpenThread's definition: - Deprecates the "SLEEP_TO_TX" capability as it is redundant and conflicts with all of Zephyr's nomenclature, zephyrproject-rtos#61227, RFC 2863, Thread standard and IEEE 802.15.4. This binds the API to an implementation detail of OpenThread, instead. See zephyrproject-rtos#63670 for the agreed migration path. - Renames the "SLEEP" event to "RX_OFF" which conforms to the nomenclature in Zephyr, this API and IEEE 802.15.4. Fixes: zephyrproject-rtos#62995 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
"Sleeping" has a well defined meaning in Zephyr related to threading and power management. This differs from OpenThread's definition: - Deprecates the "SLEEP_TO_TX" capability as it is redundant and conflicts with all of Zephyr's nomenclature, #61227, RFC 2863, Thread standard and IEEE 802.15.4. This binds the API to an implementation detail of OpenThread, instead. See #63670 for the agreed migration path. - Renames the "SLEEP" event to "RX_OFF" which conforms to the nomenclature in Zephyr, this API and IEEE 802.15.4. Fixes: #62995 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE option and introduces certain "soft MAC" capabilities around header IEs: * Introduces types and helpers that allow driver maintainers to represent, parse, write and validate header IEs. * Introduces helper functions to access non-aligned fields in header IEs, namely element IDs. Updates the only existing L2 and driver pair that uses IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5 and improves header IE validation in the nRF5 driver. This change should help further driver maintainers to support OpenThread's CSL and vendor IE extensions. It is based on the rules specified in RFC #61227. It is also a precondition to generically support both, "soft MAC" and "hard MAC", approaches to header IEs in the TSCH protocol, namely the time synchronization IE. Fixes: #62940 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. Fixes: zephyrproject-rtos#62918 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
"Sleeping" has a well defined meaning in Zephyr related to threading and power management. This differs from OpenThread's definition: - Deprecates the "SLEEP_TO_TX" capability as it is redundant and conflicts with all of Zephyr's nomenclature, zephyrproject-rtos#61227, RFC 2863, Thread standard and IEEE 802.15.4. This binds the API to an implementation detail of OpenThread, instead. See zephyrproject-rtos#63670 for the agreed migration path. - Renames the "SLEEP" event to "RX_OFF" which conforms to the nomenclature in Zephyr, this API and IEEE 802.15.4. (cherry picked from commit 6239644) Original-Fixes: zephyrproject-rtos#62995 Original-Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de> GitOrigin-RevId: 6239644 Change-Id: Idf42c6b15c98f9f4bda2f49ab93b68c5ff8b1048 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4962229 Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Al Semjonovs <asemjonovs@google.com>
Improves standard conformance of the IEEE802154_CONFIG_ENH_ACK_HEADER_IE option and introduces certain "soft MAC" capabilities around header IEs: * Introduces types and helpers that allow driver maintainers to represent, parse, write and validate header IEs. * Introduces helper functions to access non-aligned fields in header IEs, namely element IDs. Updates the only existing L2 and driver pair that uses IEEE802154_CONFIG_ENH_ACK_HEADER_IE: OpenThread platform radio and nRF5 and improves header IE validation in the nRF5 driver. This change should help further driver maintainers to support OpenThread's CSL and vendor IE extensions. It is based on the rules specified in RFC zephyrproject-rtos#61227. It is also a precondition to generically support both, "soft MAC" and "hard MAC", approaches to header IEs in the TSCH protocol, namely the time synchronization IE. (cherry picked from commit 80da9dd) Original-Fixes: zephyrproject-rtos#62940 Original-Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de> GitOrigin-RevId: 80da9dd Change-Id: I8457d091bab347f7d17af7070083ee5446a1afa5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4962230 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Al Semjonovs <asemjonovs@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
This change slightly simplifies the configuration of a CSL receiver and generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive across several timing-sensitive IEEE 802.15.4 standard sub-protocols (namely BE-PANs/DSME/CSL/RIT/TSCH). This API change is based on the rules outlined in RFC zephyrproject-rtos#61227. (cherry picked from commit e9d5a98) Original-Fixes: zephyrproject-rtos#62918 Original-Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de> GitOrigin-RevId: e9d5a98 Change-Id: Ie6119554e2666c596639128ff09d986115f4e813 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4962231 Tested-by: Al Semjonovs <asemjonovs@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Introduction
Transforming the IEEE 802.15.4 driver API (back) into being vendor- and protocol-neutral, see detailed rationale including practical examples of problems and solutions. I'm arguing here that a more standard conforming API would considerably lower the hurdle to entry for other vendors into the Thread/IEEE 802.15.4 space.
Problem description
Some recent additions to the IEEE 802.15.4 driver API broke encapsulation: They are either closely coupled to one specific upper layer stack (OT) or a specific vendor's choice of hardware offloading.
This created some technical debt for L2 and community driver maintainers when different offloading choices or different upper layer stacks are to be implemented (e.g. to support [parts of] the Thread protocol or other IEEE 802.15.4 sub-protocols). This technical debt is currently experienced by the TSCH protocol and CC13/26xx driver developments. See e.g. #60946, openthread/openthread#9322, #60401, #59133, #58434, #51266 for a non-exhaustive list of PRs that fix the kind of technical debt specified in this RFC.
NB: By my personal estimate, the linked PRs cover about 5-10% of the actual technical debt in the current API as established by this RFC.
Proposed change
The following IEEE 802.15.4 driver API review policies are proposed for all future changes and as guidelines for "repair work":
mac_features
folder. Similar examples exist to a lesser extent in other drivers.)As an architectural measure, it is proposed, to divide the IEEE 802.15.4 driver API up into two separate sections:
Implementing the PHY/L1 part SHALL be sufficient for basic soft MAC support of all Zephyr protocol stacks, i.e. the hard MAC/L2 layer SHALL be architecturally optional even if the standard itself requires de-facto hardware offloading on some hardware (e.g. specialized peripherals in the absence of a fast-enough CPU). The decision whether some MAC feature needs to be offloaded SHALL be left to the individual driver maintainers as the standard itself has no requirements concerning implementation on CPUs vs. specialized peripherals or dedicated radio cores.
For historical reasons documentation and code calls L1 and L2 driver API parts jointly "IEEE 802.15.4 radio API" which is misleading for the L2 portion. As future documentation policy it is therefore proposed to introduce the following nomenclature:
Detailed RFC
See the detailed discussion in a pull request that first introduced parts of the new architecture approach
Proposed change (Detailed)
Practical relevance and feasibility of these architectural patterns and policies was proven and exemplified by two recent PRs (1, 2) - among several others.
See the detailed discussion in a pull request that first introduced parts of the new architecture approach
Dependencies
I'm not aware of any dependencies other than [Open]Thread development and the IEEE 802.15.4 drivers and native L2 stack.
The change has, however, considerable positive impact on the general implementation effort and feasibility of future additions to the IEEE 802.15.4 subsystem.
Impact that can be proven rather objectively:
Impact that represents my personal opinions:
Concerns and Unresolved Questions
Alternatives
I personally have none - please feel free to add in case I'm missing something.
The text was updated successfully, but these errors were encountered: