rust: phy: extend abstractions for real-world PHY drivers
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 1 replyIn review
- v14 patches 2 repliesSuperseded
Changes in v2 from the cover letter
- Added cover letter (Andrew)
- Fixed Subject prefix to net-next (Andrew)
- Added RTL8211F driver as API user (Andrew)
- Fixed rustfmt issues reported by kernel test robot
- Removed RGMII from interface() doc example (Andrew)
[1] https://lore.kernel.org/lkml/20240201-rockchip-rust-phy_depend-v2-0-c5fa4faab924@christina-quast.de/
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | rust: phy: add read-only device field accessorsrust/ | +41 | 0 replies | |
| 2/5 | rust: phy: add paged register access and bit manipulation helpersrust/ | +43 | 0 replies | |
| 3/5 | rust: phy: add config_init, read_page, and write_page callbacksrust/ | +83 | 0 replies | |
| 4/5 | rust: phy: add interrupt supportrust/ | +90 | 0 replies | |
| 5/5 | net: phy: realtek: add Rust RTL8211F PHY driverdrivers/ drivers/ drivers/ | +140 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH net-next v2 0/5] rust: phy: extend abstractions for real-world PHY drivers
This series extends the Rust PHY abstractions in rust/kernel/net/phy.rs with features needed to write production-quality Rust PHY drivers, and adds a Realtek RTL8211F driver as the first user of these APIs.
Patches 1-4 add new Device accessors, register manipulation helpers, driver callbacks (config_init, read_page/write_page, config_intr, handle_interrupt), and interrupt support infrastructure.
Patch 5 adds a Rust RTL8211F Gigabit Ethernet PHY driver that exercises all the new abstractions. The driver implements RGMII delay configuration, PHY EEE disable, paged register access, and interrupt-driven link detection. ALDPS, CLKOUT, and WoL are omitted as they require per-device private data not yet available in the abstraction. PME interrupts are not handled for the same reason.
config_init was previously proposed in an RFC for the Rockchip PHY driver [1] but not merged at that time. This series re-introduces it in a form consistent with the existing vtable infrastructure.
Changes since v1:
- Added cover letter (Andrew)
- Fixed Subject prefix to net-next (Andrew)
- Added RTL8211F driver as API user (Andrew)
- Fixed rustfmt issues reported by kernel test robot
- Removed RGMII from interface() doc example (Andrew)
[1] https://lore.kernel.org/lkml/20240201-rockchip-rust-phy_depend-v2-0-c5fa4faab924@christina-quast.de/
Artem Lytkin (5):
rust: phy: add read-only device field accessors
rust: phy: add paged register access and bit manipulation helpers
rust: phy: add config_init, read_page, and write_page callbacks
rust: phy: add interrupt support
net: phy: realtek: add Rust RTL8211F PHY driver
drivers/net/phy/realtek/Kconfig | 12 ++ drivers/net/phy/realtek/Makefile | 1 + drivers/net/phy/realtek/rtl8211f_rust.rs | 140 +++++++++++++++++++ rust/kernel/net/phy.rs | 260 +++++++++++++++++++++++++++++++ 4 files changed, 413 insertions(+) create mode 100644 drivers/net/phy/realtek/rtl8211f_rust.rs