Re: [PATCH] net: ftgmac100: Get link speed and duplex for NC-SI

From: Simon Horman
Date: Fri Aug 02 2024 - 11:48:52 EST


On Fri, Aug 02, 2024 at 04:33:32PM +0800, Jacky Chou wrote:
> The ethtool of this driver uses the phy API of ethtool
> to get the link information from PHY driver.
> Because the NC-SI is forced on 100Mbps and full duplex,
> the driver connects a fixed-link phy driver for NC-SI.
> The ethtool will get the link information from the
> fixed-link phy driver.
>
> Signed-off-by: Jacky Chou <jacky_chou@xxxxxxxxxxxxxx>
> ---
> drivers/net/ethernet/faraday/ftgmac100.c | 37 ++++++++++++++----------
> 1 file changed, 21 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index fddfd1dd5070..0c820997ef88 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> @@ -26,6 +26,7 @@
> #include <linux/of_net.h>
> #include <net/ip.h>
> #include <net/ncsi.h>
> +#include <linux/phy_fixed.h>
>
> #include "ftgmac100.h"
>
> @@ -50,6 +51,15 @@
> #define FTGMAC_100MHZ 100000000
> #define FTGMAC_25MHZ 25000000
>
> +/* For NC-SI to register a fixed-link phy device */
> +struct fixed_phy_status ncsi_phy_status = {
> + .link = 1,
> + .speed = SPEED_100,
> + .duplex = DUPLEX_FULL,
> + .pause = 0,
> + .asym_pause = 0
> +};

nit: This structure is only used in this file, so it should be static

> +
> struct ftgmac100 {
> /* Registers */
> struct resource *res;

--
pw-bot: cr