On 5/22/2019 6:20 PM, Ioana Ciornei wrote:
> From: Vladimir Oltean <olte...@gmail.com>
>
> PHYLIB and PHYLINK handle fixed-link interfaces differently. PHYLIB
> wraps them in a software PHY ("pseudo fixed link") phydev construct such
> that .adjust_link driver callbacks see an unified API. Whereas PHYLINK
> simply creates a phylink_link_state structure and passes it to
> .mac_config.
>
> At the time the driver was introduced, DSA was using PHYLIB for the
> CPU/cascade ports (the ones with no net devices) and PHYLINK for
> everything else.
>
> As explained below:
>
> commit aab9c4067d2389d0adfc9c53806437df7b0fe3d5
> Author: Florian Fainelli <f.faine...@gmail.com>
> Date: Thu May 10 13:17:36 2018 -0700
>
> net: dsa: Plug in PHYLINK support
>
> Drivers that utilize fixed links for user-facing ports (e.g: bcm_sf2)
> will need to implement phylink_mac_ops from now on to preserve
> functionality, since PHYLINK *does not* create a phy_device instance
> for fixed links.
>
> In the above patch, DSA guards the .phylink_mac_config callback against
> a NULL phydev pointer. Therefore, .adjust_link is not called in case of
> a fixed-link user port.
>
> This patch fixes the situation by converting the driver from using
> .adjust_link to .phylink_mac_config. This can be done now in a unified
> fashion for both slave and CPU/cascade ports because DSA now uses
> PHYLINK for all ports.
>
> Signed-off-by: Vladimir Oltean <olte...@gmail.com>
> Signed-off-by: Ioana Ciornei <ioana.cior...@nxp.com>
Reviewed-by: Florian Fainelli <f.faine...@gmail.com>
--
Florian