Skip to content

drivers/netdev: cleanup dependencies and remove ieee802154_radio_hal pseudomodule#15886

Merged
miri64 merged 7 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/netdev_remove_radio_hal_pseudomodule
Mar 10, 2021
Merged

drivers/netdev: cleanup dependencies and remove ieee802154_radio_hal pseudomodule#15886
miri64 merged 7 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/netdev_remove_radio_hal_pseudomodule

Conversation

@leandrolanzieri
Copy link
Copy Markdown
Contributor

@leandrolanzieri leandrolanzieri commented Jan 29, 2021

Contribution description

Currently radio drivers that implement the IEEE 802.15.4 radio HAL allow switching to the netdev implementation when netdev_ieee802154_legacy module is included. In fact, that module and ieee802154_radio_hal are mutually exclusive, but can only be present on radio drivers that implement both interfaces. This PR tries to make a cleanup of all these dependencies.

  • The current behaviour on radio drivers that implement both interfaces is kept as is
  • Radios that implement the HAL can switch to use the legacy implementation by bringing a pseudomodule (<radio>_netdev_legacy) which is now specific to the radio, giving more granularity to the configuration. The check whether the legacy driver is used or not is kept internally in every driver.

This PR now depends on #15909, and includes its commits to ease testing.

Additionally, the PR avoids pulling netdev when netdev_default is used, as actually that pseudomodule should bring the network devices available in the platform, which could potentially not use netdev (e.g. cc2538, nrf52). As an example, see that tests/ieee802154_hal application does not use any netdev_% modules (aside from netdev_default) anymore, as it only tests the radio HAL.

Finally, the PR adds some documentation on default configurations (saul_default and netdev_default). I can split this part if it makes reviewing easier.

Testing procedure

  • IEEE 802.15.4 radios that don't implement the radio HAL include now netdev_ieee802154_legacy, but the binaries should not change for them
  • tests/ieee802154_hal still works on the supported boards, but no netdev dependencies should be pulled in

Issues/PRs references

Depends on #15909

@leandrolanzieri leandrolanzieri added Area: build system Area: Build system Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Area: drivers Area: Device drivers labels Jan 29, 2021
@leandrolanzieri leandrolanzieri requested a review from a user January 29, 2021 12:52
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 29, 2021
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

After an offline discussion with @jia200x we plan to make these dependencies in a different way, so I'll mark it as WIP for now.

@leandrolanzieri leandrolanzieri added State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 29, 2021
@leandrolanzieri leandrolanzieri force-pushed the pr/netdev_remove_radio_hal_pseudomodule branch from 12be225 to c4c2a17 Compare February 2, 2021 10:47
@leandrolanzieri leandrolanzieri added State: waiting for other PR State: The PR requires another PR to be merged first and removed State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet labels Feb 2, 2021
@leandrolanzieri leandrolanzieri force-pushed the pr/netdev_remove_radio_hal_pseudomodule branch from c4c2a17 to 640d755 Compare February 2, 2021 10:48
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

Updated description to new changes.

@leandrolanzieri leandrolanzieri force-pushed the pr/netdev_remove_radio_hal_pseudomodule branch from 640d755 to 50cf8b2 Compare February 5, 2021 16:23
@leandrolanzieri leandrolanzieri removed the State: waiting for other PR State: The PR requires another PR to be merged first label Feb 5, 2021
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

#15909 has been merged, so this has no dependencies now

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 5, 2021
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

ping?

Copy link
Copy Markdown
Contributor

@jeandudey jeandudey left a comment

Choose a reason for hiding this comment

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

LGTM, I'm +1 on having separate pseudomodules for each driver that implements either the netdev directly or the HAL, can be useful when an existing netdev drivers get ported to the HAL and you want to select which driver uses the HAL/netdev directly.

@leandrolanzieri leandrolanzieri force-pushed the pr/netdev_remove_radio_hal_pseudomodule branch from 2089a06 to c54d680 Compare March 10, 2021 13:17
netdev_default should enable the network devices, which do not
necessarily use netdev.
This introduces the cc2538_rf_netdev_legacy pseudomodule that switches
to the netdev-based implementation of the cc2538 radio driver.
This introduces the nrf802154_netdev_legacy pseudomodule that switches
to the netdev-based implementation of the nrf802154 radio driver.
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

Seems something has changed since last build, and CI now is failing. I'll take a look.

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

Seems to be fixed now

@miri64 miri64 merged commit 5521492 into RIOT-OS:master Mar 10, 2021
@leandrolanzieri leandrolanzieri deleted the pr/netdev_remove_radio_hal_pseudomodule branch March 10, 2021 16:39
@kaspar030 kaspar030 added this to the Release 2021.04 milestone Apr 23, 2021
@leandrolanzieri leandrolanzieri added the Release notes: ignored Set on PRs that have been considered for inclusion in the current release's notes but were minor. label Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Release notes: ignored Set on PRs that have been considered for inclusion in the current release's notes but were minor. Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants