rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v4 0/4] Rust abstractions for network PHY drivers
@ 2023-10-12 12:53 FUJITA Tomonori
  2023-10-12 12:53 ` [PATCH net-next v4 1/4] rust: core " FUJITA Tomonori
                   ` (3 more replies)
  0 siblings, 4 replies; 42+ messages in thread
From: FUJITA Tomonori @ 2023-10-12 12:53 UTC (permalink / raw)
  To: netdev
  Cc: rust-for-linux, andrew, miguel.ojeda.sandonis, tmgross,
	boqun.feng, wedsonaf, benno.lossin, greg

This patchset adds Rust abstractions for phylib. It doesn't fully
cover the C APIs yet but I think that it's already useful. I implement
two PHY drivers (Asix AX88772A PHYs and Realtek Generic FE-GE). Seems
they work well with real hardware.

The first patch introduces Rust bindings for phylib.

The second patch add a macro to declare a kernel module for PHYs
drivers.

The third patch updates the ETHERNET PHY LIBRARY entry in MAINTAINERS
file; adds the binding file and me as a maintainer of the Rust
bindings (as Andrew Lunn suggested).

The last patch introduces the Rust version of Asix PHY drivers,
drivers/net/phy/ax88796b.c. The features are equivalent to the C
version. You can choose C (by default) or Rust version on kernel
configuration.

v4:
  - split the core patch
  - making Device::from_raw() private
  - comment improvement with code update
  - commit message improvement
  - avoiding using bindings::phy_driver in public functions
  - using an anonymous constant in module_phy_driver macro
v3: https://lore.kernel.org/netdev/20231011.231607.1747074555988728415.fujita.tomonori@gmail.com/T/
  - changes the base tree to net-next from rust-next
  - makes this feature optional; only enabled with CONFIG_RUST_PHYLIB_BINDINGS=y
  - cosmetic code and comment improvement
  - adds copyright
v2: https://lore.kernel.org/netdev/20231006094911.3305152-2-fujita.tomonori@gmail.com/T/
  - build failure fix
  - function renaming
v1: https://lore.kernel.org/netdev/20231002085302.2274260-3-fujita.tomonori@gmail.com/T/


FUJITA Tomonori (4):
  rust: core abstractions for network PHY drivers
  rust: net::phy add module_phy_driver macro
  MAINTAINERS: add Rust PHY abstractions to the ETHERNET PHY LIBRARY
  net: phy: add Rust Asix PHY driver

 MAINTAINERS                      |   2 +
 drivers/net/phy/Kconfig          |   8 +
 drivers/net/phy/Makefile         |   6 +-
 drivers/net/phy/ax88796b_rust.rs | 129 +++++
 init/Kconfig                     |   8 +
 rust/Makefile                    |   1 +
 rust/bindings/bindings_helper.h  |   3 +
 rust/kernel/lib.rs               |   3 +
 rust/kernel/net.rs               |   6 +
 rust/kernel/net/phy.rs           | 813 +++++++++++++++++++++++++++++++
 rust/uapi/uapi_helper.h          |   2 +
 11 files changed, 980 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/phy/ax88796b_rust.rs
 create mode 100644 rust/kernel/net.rs
 create mode 100644 rust/kernel/net/phy.rs


base-commit: 21b2e2624d2ec69b831cd2edd202ca30ac6beae1
-- 
2.34.1


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2023-10-17 16:16 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12 12:53 [PATCH net-next v4 0/4] Rust abstractions for network PHY drivers FUJITA Tomonori
2023-10-12 12:53 ` [PATCH net-next v4 1/4] rust: core " FUJITA Tomonori
2023-10-13 21:31   ` Benno Lossin
2023-10-14  2:12     ` Andrew Lunn
2023-10-14  4:50       ` FUJITA Tomonori
2023-10-14 17:00       ` Miguel Ojeda
2023-10-14 23:18         ` FUJITA Tomonori
2023-10-15 15:47           ` Andrew Lunn
2023-10-14  7:22     ` FUJITA Tomonori
2023-10-14  8:07       ` Benno Lossin
2023-10-14 10:32         ` FUJITA Tomonori
2023-10-14 14:54           ` Benno Lossin
2023-10-14 15:53             ` Boqun Feng
2023-10-14 16:15             ` FUJITA Tomonori
2023-10-14 17:07               ` Benno Lossin
2023-10-14 21:18                 ` Andrew Lunn
2023-10-14 22:39                 ` FUJITA Tomonori
2023-10-17  7:06                   ` Benno Lossin
2023-10-17  7:32                     ` FUJITA Tomonori
2023-10-17  7:41                       ` Benno Lossin
2023-10-17 11:32                         ` FUJITA Tomonori
2023-10-17 12:38                     ` Andrew Lunn
2023-10-17 14:04                       ` Benno Lossin
2023-10-17 14:21                         ` Greg KH
2023-10-17 14:32                           ` Benno Lossin
2023-10-17 15:17                             ` Miguel Ojeda
2023-10-17 16:15                               ` Greg KH
2023-10-17 16:13                             ` Boqun Feng
2023-10-17 15:03                           ` Miguel Ojeda
2023-10-14 12:00       ` Miguel Ojeda
2023-10-12 12:53 ` [PATCH net-next v4 2/4] rust: net::phy add module_phy_driver macro FUJITA Tomonori
2023-10-12 12:53 ` [PATCH net-next v4 3/4] MAINTAINERS: add Rust PHY abstractions to the ETHERNET PHY LIBRARY FUJITA Tomonori
2023-10-13 14:34   ` Boqun Feng
2023-10-13 15:24     ` FUJITA Tomonori
2023-10-13 16:10       ` Boqun Feng
2023-10-13 16:17     ` Trevor Gross
2023-10-13 18:43       ` Miguel Ojeda
2023-10-13 18:49         ` Andrew Lunn
2023-10-14  5:15           ` FUJITA Tomonori
2023-10-14 18:18             ` Miguel Ojeda
2023-10-12 12:53 ` [PATCH net-next v4 4/4] net: phy: add Rust Asix PHY driver FUJITA Tomonori
2023-10-14  6:01   ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).