Subject: Re: [PATCH net-next,V2] Add LAN9352 Ethernet Driver

From: Andrew Lunn <[email-masked]>
Date: Fri, 12 Feb 2016 18:11:13 +0100

On Fri, Feb 12, 2016 at 04:51:49PM +0000, [email-masked] wrote:
> Hi Andrew,
> 
> Sorry I still did not make this clear. And I'm not sure I understand your question so I'll try to explain again, but please give me feedback if it's still not clear.
> 
> Also you can reference Figure 2-1 for an Internal Block Diagram on page 9 of
> http://ww1.microchip.com/downloads/en/DeviceDoc/00001923A.pdf
> 
> Conceptually I think it's easier to ignore the switch all together, since the driver really doesn't touch it.
> 
> Imagine we have two separate components
> 	1) LAN9218 (which is a 10/100 Ethernet Controller)
> 	2) An external 3 port switch (which is actually embedded)
> 
> This driver only operates on the Ethernet Controller, whose phy is in reality just a virtual phy.

> That virtual phy is connected directly to the embedded switch
> fabric, which has the two physical phys that you are asking
> about. Since this driver only operates on the Ethernet controller
> and its virtual phy. I makes no sense to talk about phy-modes for
> the physical phys on the switch.

So the code implements an MDIO bus and registers it with the MDIO
framework. It then finds the first phy and connects it to the netdev.
When doing this, it passes the phy-mode.

My assumption is, the first PHY on the MDIO bus is the PHY connected
to port 0 of the switch. So you are setting the phy-mode of this port.
This is a real phy, not a virtual phy.

     Andrew