Subject: Re: [PATCH v3 1/3] phylib: Convert MDIO and PHY Lib drivers to support 10G

From: David Daney <[email-masked]>
Date: Thu, 13 Oct 2011 09:18:18 -0700

On 10/13/2011 07:37 AM, Andy Fleming wrote:

>   /**
> + * is_10g_interface - Distinguishes 10G from 10/100/1000
> + * @interface: PHY interface type
> + *
> + * Returns true if the passed interface is capable of 10G,
> + * and therefore indicates the need for Clause-45-style
> + * MDIO transactions.
> + *
> + * For now, XGMII is the only 10G interface
> + */
> +static inline bool is_10g_interface(phy_interface_t interface)
> +{
> +	return interface == PHY_INTERFACE_MODE_XGMII;
> +}
> +

The packet interface to the PHY and the protocol used on its MDIO bus 
are two separate things.  This function conflates them.

Although it is not perfect, my alternate approach:

http://marc.info/?l=linux-netdev&m=131844284003871

Adds a flag bit to struct phy_device that indicates the MDIO bus 
protocol to be used.  Have you considered doing something like that instead?

David Daney