Re: [PATCH v2 3/3] net: phy: add Rust Asix PHY driver
From: FUJITA Tomonori <fujita.tomonori@gmail.com>
Date: 2023-10-06 13:53:32
Also in:
rust-for-linux
On Fri, 6 Oct 2023 12:31:59 +0200 Greg KH [off-list ref] wrote:
On Fri, Oct 06, 2023 at 06:49:11PM +0900, FUJITA Tomonori wrote:quoted
+config AX88796B_RUST_PHY + bool "Rust reference driver" + depends on RUST && AX88796B_PHY + default nNit, "n" is always the default, there is no need for this line.
Understood, I'll remove this line.
quoted
+ help + Uses the Rust version driver for Asix PHYs.You need more text here please. Provide a better description of what hardware is supported and the name of the module if it is built aas a module. Also that if you select this one, the C driver will not be built (which is not expressed in the Kconfig language, why not?
Because the way to load a PHY driver module can't handle multiple modules with the same phy id (a NIC driver loads a PHY driver module). There is no machinism to specify which PHY driver module should be loaded when multiple PHY modules have the same phy id (as far as I know). The Kconfig file would be like the following. AX88796B_RUST_PHY depends on AX88796B_PHY so the description of AX88796B_PHY is enough? I'll add the name of the module. config AX88796B_PHY tristate "Asix PHYs" help Currently supports the Asix Electronics PHY found in the X-Surf 100 AX88796B package. config AX88796B_RUST_PHY bool "Rust reference driver" depends on RUST && AX88796B_PHY default n help Uses the Rust version driver for Asix PHYs.
quoted
+ config BROADCOM_PHY tristate "Broadcom 54XX PHYs" select BCM_NET_PHYLIBdiff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index c945ed9bd14b..58d7dfb095ab 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile@@ -41,7 +41,11 @@ aquantia-objs += aquantia_hwmon.o endif obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o obj-$(CONFIG_AT803X_PHY) += at803x.o -obj-$(CONFIG_AX88796B_PHY) += ax88796b.o +ifdef CONFIG_AX88796B_RUST_PHY + obj-$(CONFIG_AX88796B_PHY) += ax88796b_rust.o +else + obj-$(CONFIG_AX88796B_PHY) += ax88796b.o +endifThis can be expressed in Kconfig, no need to put this here, right?
Not sure. Is it possible? If we allow both modules to be built, I guess it's possible though.
quoted
obj-$(CONFIG_BCM54140_PHY) += bcm54140.o obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o obj-$(CONFIG_BCM7XXX_PHY) += bcm7xxx.odiff --git a/drivers/net/phy/ax88796b_rust.rs b/drivers/net/phy/ax88796b_rust.rs new file mode 100644 index 000000000000..d11c82a9e847 --- /dev/null +++ b/drivers/net/phy/ax88796b_rust.rs@@ -0,0 +1,129 @@ +// SPDX-License-Identifier: GPL-2.0No copyright line? Are you sure?
Ah, I'll add.