Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Sep 11, 2023

This PR intends to improve the overall IEEE 802.15.4 documentation and resolve ambivalence re it's stability:

  • Adds the IEEE 802.15.4 documentation to the API overview and starts to version three separate IEEE 802.15.4 sub-APIs.
  • Divides the IEEE 802.15.4 documentation into three parts: l2, driver and mgmt and documents the relevance of these parts to different audiences
  • Adds cross references between Thread/OpenThread and native L2 as both stacks share the same driver API
  • Improves type-level grouping and documentation and hides types of no public interest

Currently all L2/L1s seem to be subsumed under "network" but IMO that doesn't make sense as it does not allow us to address the different versioning requirements of IEEE 802.15.4 sub-APIs nor does it allow us to differentiate the stability of Ethernet, Bluetooth, CAN and IEEE 802.15.4.

This PR therefore proposes to version the IEEE 802.15.4 subsystem at three independent levels (all of which I consider UNSTABLE for now):

  • L2: internal API needed to interface with the net stack, the IEEE 802.15.4 specific part (ieee802154_context/pkt) very unstable due to active protocol development, audience: subsystem maintainers only
  • drivers: internal API, currently very unstable, requires a lot of change, audience: driver maintainers only
  • net_mgmt: API exposed to applications, mostly only additions are required, could be stable but I wouldn't do that, yet, audience: application developers

This allows us to address the different requirements of the three sub-APIs re versioning and change management:

  • Breaking net_mgmt really causes headaches to existing applications - so that one we should keep as stable as possible.
  • The driver API will break out-of-tree drivers, but so far I haven't heard of a single existing instance of one from the community.
  • The L2 API is not a problem at all AFAICS as it is used in-tree only.

For all practical purposes, @rlubos, @jukkar and I considered the existing user base of those APIs small and the changes required for its transformation many so that we agreed to treat it de facto as unstable over the last three releases (which I'm proposing to formalize now).

This strategy seems to have worked out well. AFAICS we didn't get a single complaint and a lot of positive feedback for that approach from the community.

@kartben
Copy link
Contributor

kartben commented Sep 11, 2023

One thing that works well in Doxygen but not in the Sphinx version of the API is member grouping. See the undocumented driver API constants in Sphinx which are correctly documented in Doxygen via member groups. Not sure what's the problem there...

which ones?

@ghost
Copy link
Author

ghost commented Sep 12, 2023

One thing that works well in Doxygen but not in the Sphinx version of the API is member grouping. See the undocumented driver API constants in Sphinx which are correctly documented in Doxygen via member groups.

which ones?

@kartben Oups, I dreamed that. I just wanted to make screenshots for you when I realized that I was confusing enums and defines which had almost the same name. Sorry. Looks like this is ready for a quick preliminary review then if you find the time.

Copy link
Author

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rlubos Thanks for the review. :-)

Fixes bugs in USB and DSA group titles (networking) and a minor bug in
sys/utils.

Signed-off-by: Florian Grandel <[email protected]>
Improves the API documentation including it's structure and integration
into the Zephyr documentation.

Previously the API status of the IEEE 802.15.4 API (and its sub-APIs)
was unclear.

This change adds three APIs in an "unstable" state:
- IEEE 802.15.4 L2 for subsystem developers
- IEEE 802.15.4 drivers for driver developers
- IEEE 802.15.4 net_mgmt for application developers

The corresponding APIs are documented at a group level.

These sub-APIs need to be separately versioned as they have different
audiences, change velocities and levels of stability.

Signed-off-by: Florian Grandel <[email protected]>
Integrates and cross-references OpenThread and native IEEE 802.15.4 docs
as they share a common driver layer.

While OpenThread is of course not an IEEE 802.15.4 subsystem API it is
still included in the ieee802154 documentation group, purely for
convenience to the documentation readers.

For organizational purposes OT is considered a separate area of
maintenance and therefore keeps its dedicated documentation page - but
the two subsystems now cross-reference each other for convenience.

Signed-off-by: Florian Grandel <[email protected]>
Hides types used in the IEEE 802.15.4 L2 sub-API and L2-internal APIs
that are of no public interest and improves documentation of the
remainder.

The changes are mostly minor as the API documentation had already been
improved and clarified in previous changes. Also includes non-visible
documentation to the subsystem-internal Frame API by adding references
to the specification.

Signed-off-by: Florian Grandel <[email protected]>
Hides types in the IEEE 802.15.4 driver sub-API that are of no public
interest and improves documentation of the remainder.

Apart from extending and clarifying many details of the driver API, this
change also specifies certain formal properties of API calls, such as
"sleeps" or "isr-ok". Plus it removes semantic ambivalence that had been
resolved and hidden in existing implementation details but is highly
relevant to the way the API can be used and shall be implemented.

As far as possible this change introduces formal requirements language
(MAY, SHALL/MUST, SHOULD) to specify driver implementation requirements.

This change also introduces two definitions - for the moment being of
purely documentary relevance (i.e. to be referred in the documentation):
* IEEE802154_CONFIG_RX_SLOT_NONE
* IEEE802154_CONFIG_RX_SLOT_OFF

These "magic" values are required to clarify the exact semantics of RX
slots as to receiver activity.

Signed-off-by: Florian Grandel <[email protected]>
Hides types in the IEEE 802.15.4 net_mgmt sub-API that are of no public
interest and improves documentation of the remainder.

All constants that are not meant to be used by applications have been
hidden. Only the API actually being of relevance to application
developers is now publicly visible and documented.

Signed-off-by: Florian Grandel <[email protected]>
@ghost ghost removed the DNM This PR should not be merged (Do Not Merge) label Sep 27, 2023
@ghost ghost marked this pull request as ready for review September 27, 2023 17:32
@ghost ghost requested review from kartben and rlubos September 27, 2023 17:32
@zephyrbot zephyrbot requested a review from cfriedt September 27, 2023 17:32
@ghost
Copy link
Author

ghost commented Sep 27, 2023

@kartben @carlescufi Open for review now - proposes IEEE 802.15.4 as "unstable" and divided up as discussed.

@rlubos No changes introduced since your last review (except for improved commit messages and a few lines of extra docs for members that had none yet - I ensured that the compare button works for you by pushing the rebase separately). Needs re-approval, though, as I removed the draft status and rebased.

@jukkar Would be nice to hear your opinion as well re the proposal to split up into three sub-APIs and mark them as "unstable" for now.

Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for the API maturity level changes

@carlescufi carlescufi merged commit e639695 into zephyrproject-rtos:main Sep 28, 2023
@ghost ghost deleted the doc/ieee802154-improved-doc-structure branch September 28, 2023 13:21
@ghost ghost mentioned this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants