diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2023-12-13 03:42:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-12-15 12:35:50 +0300 |
commit | f20fd5449ada3872dcd67aca397f0e27ca2e8ad6 (patch) | |
tree | ce100e10c10a5cb53d0eabc8b07fe63601c893f8 /drivers/net/phy | |
parent | f3c2caacee824ce4a331cdafb0b8dc8e987f105e (diff) | |
download | linux-f20fd5449ada3872dcd67aca397f0e27ca2e8ad6.tar.xz |
rust: core abstractions for network PHY drivers
This patch adds abstractions to implement network PHY drivers; the
driver registration and bindings for some of callback functions in
struct phy_driver and many genphy_ functions.
This feature is enabled with CONFIG_RUST_PHYLIB_ABSTRACTIONS=y.
This patch enables unstable const_maybe_uninit_zeroed feature for
kernel crate to enable unsafe code to handle a constant value with
uninitialized data. With the feature, the abstractions can initialize
a phy_driver structure with zero easily; instead of initializing all
the members by hand. It's supposed to be stable in the not so distant
future.
Link: https://github.com/rust-lang/rust/pull/116218
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/Kconfig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 098d17d2d3f7..6e1f5e1b6f24 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -60,6 +60,14 @@ config FIXED_PHY Currently tested with mpc866ads and mpc8349e-mitx. +config RUST_PHYLIB_ABSTRACTIONS + bool "Rust PHYLIB abstractions support" + depends on RUST + depends on PHYLIB=y + help + Adds support needed for PHY drivers written in Rust. It provides + a wrapper around the C phylib core. + config SFP tristate "SFP cage support" depends on I2C && PHYLINK |