Subject: Re: [PATCH ethtool] ethtool: Add register dump support for MICROCHIP LAN78xx

From: Andrew Lunn <[email-masked]>
Date: Thu, 5 Apr 2018 14:37:22 +0200

On Thu, Apr 05, 2018 at 11:41:28AM +0530, Raghuram Chary J wrote:
Hi Raghuram

> +	fprintf(stdout, "PHY Registers:\n");
> +	fprintf(stdout, "--------------\n");
> +	fprintf(stdout, "Mode Control = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "Mode Status  = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "Device identifier1   = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "Device identifier2   = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "Auto-Neg Advertisement         = 0x%04X\n",
> +		*lan78xx_reg++);
> +	fprintf(stdout, "Auto-Neg Link Partner Ability  = 0x%04X\n",
> +		*lan78xx_reg++);
> +	fprintf(stdout, "Auto-Neg Expansion      = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "Auto-Neg Next Page TX   = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "Auto-Neg Link Partner Next Page RX  = 0x%04X\n",
> +		*lan78xx_reg++);
> +	fprintf(stdout, "1000BASE-T Control  = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "1000BASE-T Status   = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "Reserved  = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "Reserved  = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "MMD Access Control       = 0x%04X\n", *lan78xx_reg++);
> +	fprintf(stdout, "MMD Access Address/Data  = 0x%04X\n", *lan78xx_reg++);

Do the above registers conform to the normal MII definitions? Have you
looked at the code in netsemi.c? Maybe a generic helper can be defined
which dumps standard PHY registers?

      Andrew