aboutsummaryrefslogtreecommitdiff
path: root/rust/kernel/net/phy.rs
AgeCommit message (Collapse)AuthorFilesLines
2024-01-27rust: phy: use VTABLE_DEFAULT_ERRORFUJITA Tomonori1-8/+8
Since 6.8-rc1, using VTABLE_DEFAULT_ERROR for optional functions (never called) in #[vtable] is the recommended way. Note that no functional changes in this patch. Signed-off-by: FUJITA Tomonori <[email protected]> Reviewed-by: Trevor Gross <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-01-27rust: phy: use `srctree`-relative linksFUJITA Tomonori1-4/+4
The relative paths like the following are bothersome and don't work with `O=` builds: //! C headers: [`include/linux/phy.h`](../../../../../../../include/linux/phy.h). This updates such links by using the `srctree`-relative link feature introduced in 6.8-rc1 like: //! C headers: [`include/linux/phy.h`](srctree/include/linux/phy.h). Signed-off-by: FUJITA Tomonori <[email protected]> Reviewed-by: Trevor Gross <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2023-12-15rust: net::phy add module_phy_driver macroFUJITA Tomonori1-0/+146
This macro creates an array of kernel's `struct phy_driver` and registers it. This also corresponds to the kernel's `MODULE_DEVICE_TABLE` macro, which embeds the information for module loading into the module binary file. A PHY driver should use this macro. Signed-off-by: FUJITA Tomonori <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Trevor Gross <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2023-12-15rust: core abstractions for network PHY driversFUJITA Tomonori1-0/+755
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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Signed-off-by: David S. Miller <[email protected]>