Skip to content
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

nuttx/wireless/ioctl: Common IOCTL API for RF Modulation Technologies #16024

Merged
merged 2 commits into from
Mar 23, 2025

Conversation

keever50
Copy link
Contributor

Summary

This PR is a follow-up of #15856 and the mailing list proposal "Proposal: Common IOCTL API for RF Modulation Technologies"

Currently, the IOCTL API for character-driven RF devices lacks a common
interface across different modulation technologies, such as LoRa, FSK, and
OOK. As a result, driver-specific IOCTL commands are created even when they
could be shared across multiple radios. This fragmentation makes
application portability more difficult to maintain.

This PR will add a common API that can be shared across all new drivers.
Such as

  • LoRa
  • FSK
  • OOK / ASK
  • read() return struct

Impact

This change does not impact existing drivers by design.

  • Legacy drivers remain unchanged but can be ported if desired.
  • Experimental drivers can be freely adapted.
  • New drivers must use the common API whenever possible.

The API covers the most common RF features. If additional functionality is required, new IOCTL commands can be introduced without breaking compatibility.

Documentation updates will follow after the initial approval of this commit.

Relevant to previous discussions: This update is no more a breaking change. No existing IOCTL commands have been replaced or removed.

Testing

This update is designed to be non-disruptive to existing drivers. However, some IOCTL command offsets have been adjusted.

  • Tested on: SX126x driver
  • Verification: The SX126x driver was tested using its driver-specific (non-common API) commands and continues to function as expected.
  • Next Steps: Since no drivers currently implement this API, further testing will occur during the porting process.

@github-actions github-actions bot added Area: Drivers Drivers issues Size: M The size of the change in this PR is medium labels Mar 19, 2025
@nuttxpr
Copy link

nuttxpr commented Mar 19, 2025

[Experimental Bot, please feedback here]

Yes, this PR generally meets the NuttX requirements, but could be improved. Here's a breakdown:

Strengths:

  • Clear Summary: The summary explains the "why," "what," and "how" of the change, linking it back to the original issue and mailing list discussion.
  • Impact Assessment: Addresses most impact areas, explicitly stating the lack of impact on existing drivers and the plan for documentation.
  • Testing Strategy Outlined: Explains the current testing limitations due to the nature of the change (new API with no implementing drivers yet) and outlines next steps.

Areas for Improvement:

  • More Specific "How": While the summary mentions a common API, it only lists a few technologies (LoRa, FSK, OOK). Providing a few specific examples of new IOCTL commands and their parameters would strengthen the description of "how" the change works. Example: "Adds IOCTL_RF_SET_FREQUENCY which takes a uint32_t frequency in Hz."
  • Complete Testing Section: The testing section needs to be filled out more thoroughly. While acknowledging the limitations is good, the "Testing logs before change" and "Testing logs after change" sections are empty. Even if the new API isn't used yet, show some logs demonstrating the existing SX126x driver still works after the changes. This proves the changes haven't inadvertently broken anything. Include specific commands used and expected outputs.
  • Build Host/Target Details: The "Testing" section is missing crucial details about the build host and target environments. Be specific: "Build Host: Linux (Ubuntu 20.04), x86_64, GCC 9.4.0. Target: sim:qemu-arm." This is essential for reproducibility.
  • Documentation Impact Clarification: While it mentions documentation updates will follow, be more explicit. Will a new document be created, or will existing documentation be updated? If the latter, specify which files.
  • Consider Security/Compatibility in More Detail: While marked "NO," briefly justify why there are no security or compatibility implications. For example: "Security Impact: NO - This change only introduces new API calls and does not alter any existing functionality, therefore no new security vulnerabilities are introduced. Compatibility Impact: NO - This change is additive and does not modify existing driver behavior. New drivers are encouraged but not required to use the new API." This demonstrates you've considered these aspects.

By addressing these points, the PR will be even stronger and more readily accepted.

@keever50
Copy link
Contributor Author

will fix the conflict. That error did not pop up for me. Ill make sure to clean build double check everything.

@keever50 keever50 force-pushed the common_wireless_api_PR branch from 4c2794e to 8696cd8 Compare March 19, 2025 19:44
@lupyuen
Copy link
Member

lupyuen commented Mar 20, 2025

Please remember to fill in the Commit Message. Just copy from the PR Summary above. Thanks :-)

@xiaoxiang781216 xiaoxiang781216 linked an issue Mar 20, 2025 that may be closed by this pull request
1 task
@keever50
Copy link
Contributor Author

Please remember to fill in the Commit Message. Just copy from the PR Summary above. Thanks :-)

I suggest adding a checklist contributors can fill in somewhere? In the guidelines or PR template. This makes things a bit easier for both reviewers and contributors, because less time is going into corrections, hopefully.

@lupyuen
Copy link
Member

lupyuen commented Mar 20, 2025

Yep we just updated the guidelines here :-)
https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md

@keever50 keever50 force-pushed the common_wireless_api_PR branch from 8696cd8 to 60e8a5d Compare March 20, 2025 18:51
@github-actions github-actions bot added the Area: Documentation Improvements or additions to documentation label Mar 20, 2025
This PR is a follow-up of issue apache#15856 and the mailing list proposal "Proposal: Common IOCTL API for RF Modulation Technologies"

Before this PR, the IOCTL API for character-driven RF devices lacked a common
interface across different modulation technologies, such as LoRa, FSK, and
OOK. The result was, driver-specific IOCTL commands were created even when they
could be shared across multiple radios. This fragmentation made
application portability more difficult to maintain.

This PR will add a common API that can be shared across all new drivers.
Such as
* LoRa
* FSK
* OOK / ASK
* read() return struct

Signed-off-by: Kevin Witteveen (MartiniMarter) <[email protected]>
@keever50 keever50 force-pushed the common_wireless_api_PR branch from 60e8a5d to 3d4f8f2 Compare March 20, 2025 21:48
@keever50
Copy link
Contributor Author

Thank you for the spelling checks. These are now corrected

@keever50 keever50 requested a review from hartmannathan March 21, 2025 12:48
…initial documentation.

Adds initial documentation to the IOCTL commands of wireless character devices.

Signed-off-by: Kevin Witteveen (MartiniMarter) <[email protected]>
@keever50 keever50 force-pushed the common_wireless_api_PR branch from 3d4f8f2 to a42b673 Compare March 22, 2025 11:32
@keever50 keever50 requested a review from raiden00pl March 22, 2025 11:33
@xiaoxiang781216 xiaoxiang781216 merged commit 6b3f7e0 into apache:master Mar 23, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Documentation Improvements or additions to documentation Area: Drivers Drivers issues Size: M The size of the change in this PR is medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Common interface for LORA chips
6 participants