History log of /linux-6.15/rust/kernel/net/phy.rs (Results 1 – 18 of 18)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6
# 38559da6 09-Mar-2025 Guilherme Giacomo Simoes <[email protected]>

rust: module: introduce `authors` key

In the `module!` macro, the `author` field is currently of type `String`.

Since modules can have multiple authors, this limitation prevents
specifying more tha

rust: module: introduce `authors` key

In the `module!` macro, the `author` field is currently of type `String`.

Since modules can have multiple authors, this limitation prevents
specifying more than one.

Add an `authors` field as `Option<Vec<String>>` to allow creating
modules with multiple authors, and change the documentation and all
current users to use it. Eventually, the single `author` field may
be removed.

[ The `modinfo` key needs to still be `author`; otherwise, tooling
may not work properly, e.g.:

$ modinfo --author samples/rust/rust_print.ko
Rust for Linux Contributors

I have also kept the original `author` field (undocumented), so
that we can drop it more easily in a kernel cycle or two.

- Miguel ]

Suggested-by: Miguel Ojeda <[email protected]>
Link: https://github.com/Rust-for-Linux/linux/issues/244
Reviewed-by: Charalampos Mitrodimas <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Andreas Hindborg <[email protected]>
Signed-off-by: Guilherme Giacomo Simoes <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Fixed `modinfo` key. Kept `author` field. Reworded message
accordingly. Updated my email. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>

show more ...


Revision tags: v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1
# 4401565f 23-Nov-2024 Miguel Ojeda <[email protected]>

rust: add `build_error!` to the prelude

The sibling `build_assert!` is already in the prelude, it makes sense
that a "core"/"language" facility like this is part of the prelude and
users should not

rust: add `build_error!` to the prelude

The sibling `build_assert!` is already in the prelude, it makes sense
that a "core"/"language" facility like this is part of the prelude and
users should not be defining their own one (thus there should be no risk
of future name collisions and we would want to be aware of them anyway).

Thus add `build_error!` into the prelude.

Reviewed-by: Alice Ryhl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Applied the change to the new miscdevice cases. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>

show more ...


# 15f2f931 23-Nov-2024 Miguel Ojeda <[email protected]>

rust: use the `build_error!` macro, not the hidden function

Code and some examples were using the function, rather than the macro. The
macro is what is documented.

Thus move users to the macro.

Re

rust: use the `build_error!` macro, not the hidden function

Code and some examples were using the function, rather than the macro. The
macro is what is documented.

Thus move users to the macro.

Reviewed-by: Alice Ryhl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Applied the change to the new miscdevice cases. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>

show more ...


# d22f955c 14-Dec-2024 Rahul Rameshbabu <[email protected]>

rust: net::phy scope ThisModule usage in the module_phy_driver macro

Similar to the use of $crate::Module, ThisModule should be referred to as
$crate::ThisModule in the macro evaluation. The reason

rust: net::phy scope ThisModule usage in the module_phy_driver macro

Similar to the use of $crate::Module, ThisModule should be referred to as
$crate::ThisModule in the macro evaluation. The reason the macro previously
did not cause any errors is because all the users of the macro would use
kernel::prelude::*, bringing ThisModule into scope.

Signed-off-by: Rahul Rameshbabu <[email protected]>
Reviewed-by: FUJITA Tomonori <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>

show more ...


# 94901b7a 12-Dec-2024 FUJITA Tomonori <[email protected]>

rust: net::phy fix module autoloading

The alias symbol name was renamed. Adjust module_phy_driver macro to
create the proper symbol name to fix module autoloading.

Fixes: 054a9cd395a7 ("modpost: re

rust: net::phy fix module autoloading

The alias symbol name was renamed. Adjust module_phy_driver macro to
create the proper symbol name to fix module autoloading.

Fixes: 054a9cd395a7 ("modpost: rename alias symbol for MODULE_DEVICE_TABLE()")
Signed-off-by: FUJITA Tomonori <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>

show more ...


Revision tags: v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11
# d072acda 13-Sep-2024 Gary Guo <[email protected]>

rust: use custom FFI integer types

Currently FFI integer types are defined in libcore. This commit creates
the `ffi` crate and asks bindgen to use that crate for FFI integer types
instead of `core::

rust: use custom FFI integer types

Currently FFI integer types are defined in libcore. This commit creates
the `ffi` crate and asks bindgen to use that crate for FFI integer types
instead of `core::ffi`.

This commit is preparatory and no type changes are made in this commit
yet.

Signed-off-by: Gary Guo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Added `rustdoc`, `rusttest` and KUnit tests support. Rebased on top of
`rust-next` (e.g. migrated more `core::ffi` cases). Reworded crate
docs slightly and formatted. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>

show more ...


# 3ed8d344 30-Sep-2024 FUJITA Tomonori <[email protected]>

rust: net::phy always define device_table in module_phy_driver macro

device_table in module_phy_driver macro is defined only when the
driver is built as a module. So a PHY driver imports phy::Device

rust: net::phy always define device_table in module_phy_driver macro

device_table in module_phy_driver macro is defined only when the
driver is built as a module. So a PHY driver imports phy::DeviceId
module in the following way then hits `unused import` warning when
it's compiled as built-in:

use kernel::net::phy::DeviceId;

kernel::module_phy_driver! {
drivers: [PhyQT2025],
device_table: [
DeviceId::new_with_driver::<PhyQT2025>(),
],

Put device_table in a const. It's not included in the kernel image if
unused (when the driver is compiled as built-in), and the compiler
doesn't complain.

Signed-off-by: FUJITA Tomonori <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>

show more ...


Revision tags: v6.11-rc7, v6.11-rc6
# 5114e05a 28-Aug-2024 FUJITA Tomonori <[email protected]>

rust: net::phy unified genphy_read_status function for C22 and C45 registers

Add unified genphy_read_status function for C22 and C45
registers. Instead of having genphy_c22 and genphy_c45 methods, t

rust: net::phy unified genphy_read_status function for C22 and C45 registers

Add unified genphy_read_status function for C22 and C45
registers. Instead of having genphy_c22 and genphy_c45 methods, this
unifies genphy_read_status functions for C22 and C45.

Reviewed-by: Trevor Gross <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: FUJITA Tomonori <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

show more ...


# b2e47002 28-Aug-2024 FUJITA Tomonori <[email protected]>

rust: net::phy unified read/write API for C22 and C45 registers

Add the unified read/write API for C22 and C45 registers. The
abstractions support access to only C22 registers now. Instead of
adding

rust: net::phy unified read/write API for C22 and C45 registers

Add the unified read/write API for C22 and C45 registers. The
abstractions support access to only C22 registers now. Instead of
adding read/write_c45 methods specifically for C45, a new reg module
supports the unified API to access C22 and C45 registers with trait,
by calling an appropriate phylib functions.

Reviewed-by: Trevor Gross <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: FUJITA Tomonori <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

show more ...


# 7909892a 28-Aug-2024 FUJITA Tomonori <[email protected]>

rust: net::phy implement AsRef<kernel::device::Device> trait

Implement AsRef<kernel::device::Device> trait for Device. A PHY driver
needs a reference to device::Device to call the firmware API.

Rev

rust: net::phy implement AsRef<kernel::device::Device> trait

Implement AsRef<kernel::device::Device> trait for Device. A PHY driver
needs a reference to device::Device to call the firmware API.

Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Reviewed-by: Trevor Gross <[email protected]>
Signed-off-by: FUJITA Tomonori <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

show more ...


# ffd2747d 28-Aug-2024 FUJITA Tomonori <[email protected]>

rust: net::phy support probe callback

Support phy_driver probe callback, used to set up device-specific
structures.

Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Andrew Lunn <andrew@l

rust: net::phy support probe callback

Support phy_driver probe callback, used to set up device-specific
structures.

Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Reviewed-by: Trevor Gross <[email protected]>
Signed-off-by: FUJITA Tomonori <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

show more ...


Revision tags: v6.11-rc5
# 0ff8f3f0 19-Aug-2024 Michael Vetter <[email protected]>

rust: kernel: fix typos in code comments

Fix spelling mistakes in code comments.

Signed-off-by: Michael Vetter <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Benno

rust: kernel: fix typos in code comments

Fix spelling mistakes in code comments.

Signed-off-by: Michael Vetter <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>

show more ...


Revision tags: v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3
# 00280272 01-Apr-2024 Miguel Ojeda <[email protected]>

rust: kernel: remove redundant imports

Rust's `unused_imports` lint covers both unused and redundant imports.
In the upcoming 1.78.0, the lint detects more cases of redundant imports
[1], e.g.:

rust: kernel: remove redundant imports

Rust's `unused_imports` lint covers both unused and redundant imports.
In the upcoming 1.78.0, the lint detects more cases of redundant imports
[1], e.g.:

error: the item `bindings` is imported redundantly
--> rust/kernel/print.rs:38:9
|
38 | use crate::bindings;
| ^^^^^^^^^^^^^^^ the item `bindings` is already defined by prelude

Most cases are `use crate::bindings`, plus a few other items like `Box`.
Thus clean them up.

Note that, in the `bindings` case, the message "defined by prelude"
above means the extern prelude, i.e. the `--extern` flags we pass.

Link: https://github.com/rust-lang/rust/pull/117772 [1]
Reviewed-by: Alice Ryhl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Miguel Ojeda <[email protected]>

show more ...


Revision tags: v6.9-rc2
# df70d04d 28-Mar-2024 Wedson Almeida Filho <[email protected]>

rust: phy: implement `Send` for `Registration`

In preparation for requiring `Send` for `Module` implementations in the
next patch.

Cc: FUJITA Tomonori <[email protected]>
Cc: Trevor Gross <

rust: phy: implement `Send` for `Registration`

In preparation for requiring `Send` for `Module` implementations in the
next patch.

Cc: FUJITA Tomonori <[email protected]>
Cc: Trevor Gross <[email protected]>
Cc: [email protected]
Signed-off-by: Wedson Almeida Filho <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Miguel Ojeda <[email protected]>

show more ...


Revision tags: v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2
# 599b75a3 25-Jan-2024 FUJITA Tomonori <[email protected]>

rust: phy: use VTABLE_DEFAULT_ERROR

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 patc

rust: phy: use VTABLE_DEFAULT_ERROR

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]>

show more ...


# 1d4046b5 25-Jan-2024 FUJITA Tomonori <[email protected]>

rust: phy: use `srctree`-relative links

The relative paths like the following are bothersome and don't work
with `O=` builds:

//! C headers: [`include/linux/phy.h`](../../../../../../../include/lin

rust: phy: use `srctree`-relative links

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]>

show more ...


Revision tags: v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6
# 2fe11d5a 13-Dec-2023 FUJITA Tomonori <[email protected]>

rust: net::phy add module_phy_driver macro

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 embe

rust: net::phy add module_phy_driver macro

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]>

show more ...


# f20fd544 13-Dec-2023 FUJITA Tomonori <[email protected]>

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_drive

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 <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

show more ...