Based on the example shown in drivers/net/phy/ax88796b_rust.rs, I ported
the rockchip phy driver to Rust. The code in drivers/net/phy/rockchip.c
was basically rewritten in Rust. The patchset includes changes to
phy.rs, adding more struct driver functions for the abstraction with
Rust.
The driver was not tested on real hardware, because I do not have a
board with this phy, and I would appreciate it if somebody could try
out the driver on their board.
Signed-off-by: Christina Quast <[email protected]>
---
Christina Quast (3):
DONOTMERGE: rust: prelude: add bit function
rust: phy: add some phy_driver and genphy_ functions
net: phy: add Rust Rockchip PHY driver
drivers/net/phy/Kconfig | 8 +++
drivers/net/phy/Makefile | 4 ++
drivers/net/phy/rockchip_rust.rs | 131 +++++++++++++++++++++++++++++++++++++++
rust/kernel/net/phy.rs | 31 +++++++++
rust/kernel/prelude.rs | 16 +++++
5 files changed, 190 insertions(+)
---
base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
change-id: 20240201-rockchip-rust-phy_depend-681db4707777
Best regards,
--
Christina Quast <[email protected]>
On Thu, Feb 01, 2024 at 07:06:57PM +0100, Christina Quast wrote:
> Based on the example shown in drivers/net/phy/ax88796b_rust.rs, I ported
> the rockchip phy driver to Rust. The code in drivers/net/phy/rockchip.c
> was basically rewritten in Rust. The patchset includes changes to
> phy.rs, adding more struct driver functions for the abstraction with
> Rust.
>
> The driver was not tested on real hardware, because I do not have a
> board with this phy, and I would appreciate it if somebody could try
> out the driver on their board.
As a general point, please post such code RFT. Also adding RFC would
be good, and explain what sort of comments you are requesting.
Andrew
---
pw-bot: cr