net: dsa: propagate resolved link config via mac_link_up()
authorRussell King <rmk+kernel@armlinux.org.uk>
Wed, 26 Feb 2020 10:23:46 +0000 (10:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Feb 2020 20:02:14 +0000 (12:02 -0800)
Propagate the resolved link configuration down via DSA's
phylink_mac_link_up() operation to allow split PCS/MAC to work.

Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/b53/b53_priv.h
drivers/net/dsa/bcm_sf2.c
drivers/net/dsa/lantiq_gswip.c
drivers/net/dsa/mt7530.c
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/ocelot/felix.c
drivers/net/dsa/qca/ar9331.c
drivers/net/dsa/sja1105/sja1105_main.c
include/net/dsa.h
net/dsa/port.c

index 1a69286daa8d8adcc2b2e535c1bd4a02b380a1c0..ceafce446317b5ea0b9a43ea758160a4c245187c 100644 (file)
@@ -1289,7 +1289,9 @@ EXPORT_SYMBOL(b53_phylink_mac_link_down);
 void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
                             unsigned int mode,
                             phy_interface_t interface,
-                            struct phy_device *phydev)
+                            struct phy_device *phydev,
+                            int speed, int duplex,
+                            bool tx_pause, bool rx_pause)
 {
        struct b53_device *dev = ds->priv;
 
index 3c30f3a7eb29833f59a548d22d4df3f11187194f..3d42318bc3f128a4bfd56c7e788c6a880691ff72 100644 (file)
@@ -338,7 +338,9 @@ void b53_phylink_mac_link_down(struct dsa_switch *ds, int port,
 void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
                             unsigned int mode,
                             phy_interface_t interface,
-                            struct phy_device *phydev);
+                            struct phy_device *phydev,
+                            int speed, int duplex,
+                            bool tx_pause, bool rx_pause);
 int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering);
 int b53_vlan_prepare(struct dsa_switch *ds, int port,
                     const struct switchdev_obj_port_vlan *vlan);
index d1955543acd1d1d151d8292c9638c25de2267ae0..2daca9f0b8ca8299915f5491364287c20ff2225b 100644 (file)
@@ -649,7 +649,9 @@ static void bcm_sf2_sw_mac_link_down(struct dsa_switch *ds, int port,
 static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port,
                                   unsigned int mode,
                                   phy_interface_t interface,
-                                  struct phy_device *phydev)
+                                  struct phy_device *phydev,
+                                  int speed, int duplex,
+                                  bool tx_pause, bool rx_pause)
 {
        struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
        struct ethtool_eee *p = &priv->dev->ports[port].eee;
index 0369c22fe3e11a62914e2221a3edd985de554a29..cf6fa8fede33469acdf2d4233e45cd7939d6e23e 100644 (file)
@@ -1517,7 +1517,9 @@ static void gswip_phylink_mac_link_down(struct dsa_switch *ds, int port,
 static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port,
                                      unsigned int mode,
                                      phy_interface_t interface,
-                                     struct phy_device *phydev)
+                                     struct phy_device *phydev,
+                                     int speed, int duplex,
+                                     bool tx_pause, bool rx_pause)
 {
        struct gswip_priv *priv = ds->priv;
 
index 022466ca1c1964d0005b5554d6f30b6113d11032..86818ab3bb07124cd2a964c5576fdeb8402e78c7 100644 (file)
@@ -1482,7 +1482,9 @@ static void mt7530_phylink_mac_link_down(struct dsa_switch *ds, int port,
 static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port,
                                       unsigned int mode,
                                       phy_interface_t interface,
-                                      struct phy_device *phydev)
+                                      struct phy_device *phydev,
+                                      int speed, int duplex,
+                                      bool tx_pause, bool rx_pause)
 {
        struct mt7530_priv *priv = ds->priv;
 
index 705c118f6fdd62fd761fc20587b16036e87481f1..ebaaf21d7953b9c69876f34aa59b22f95c65ea1a 100644 (file)
@@ -655,7 +655,9 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port,
 
 static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
                                  unsigned int mode, phy_interface_t interface,
-                                 struct phy_device *phydev)
+                                 struct phy_device *phydev,
+                                 int speed, int duplex,
+                                 bool tx_pause, bool rx_pause)
 {
        if (mode == MLO_AN_FIXED)
                mv88e6xxx_mac_link_force(ds, port, LINK_FORCED_UP);
index 35124ef7e75bc0e4cd7598d625a379e5e1cd7ac5..7e66821b05b4a44316385da6e17a7d3eef4365a7 100644 (file)
@@ -263,7 +263,9 @@ static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port,
 static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port,
                                      unsigned int link_an_mode,
                                      phy_interface_t interface,
-                                     struct phy_device *phydev)
+                                     struct phy_device *phydev,
+                                     int speed, int duplex,
+                                     bool tx_pause, bool rx_pause)
 {
        struct ocelot *ocelot = ds->priv;
        struct ocelot_port *ocelot_port = ocelot->ports[port];
index de25f99e995ada04c75b34c9d2ebb9dbc7fd48c7..7c86056b9401db5d62ed548418983bc4c0a04bf2 100644 (file)
@@ -458,7 +458,9 @@ static void ar9331_sw_phylink_mac_link_down(struct dsa_switch *ds, int port,
 static void ar9331_sw_phylink_mac_link_up(struct dsa_switch *ds, int port,
                                          unsigned int mode,
                                          phy_interface_t interface,
-                                         struct phy_device *phydev)
+                                         struct phy_device *phydev,
+                                         int speed, int duplex,
+                                         bool tx_pause, bool rx_pause)
 {
        struct ar9331_sw_priv *priv = (struct ar9331_sw_priv *)ds->priv;
        struct regmap *regmap = priv->regmap;
index 03ba6d25f7fefb9b8b2d1dae8ea401ee23df13e5..c27cc7b374407e6ced06b578160e1b199b59ab11 100644 (file)
@@ -786,7 +786,9 @@ static void sja1105_mac_link_down(struct dsa_switch *ds, int port,
 static void sja1105_mac_link_up(struct dsa_switch *ds, int port,
                                unsigned int mode,
                                phy_interface_t interface,
-                               struct phy_device *phydev)
+                               struct phy_device *phydev,
+                               int speed, int duplex,
+                               bool tx_pause, bool rx_pause)
 {
        sja1105_inhibit_tx(ds->priv, BIT(port), false);
 }
index 63495e3443acd6add41368e56adbf4208102fce7..7d3d84f0ef42a6b365e9ecfea29bd0c4e4e9b1a1 100644 (file)
@@ -420,7 +420,9 @@ struct dsa_switch_ops {
        void    (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
                                       unsigned int mode,
                                       phy_interface_t interface,
-                                      struct phy_device *phydev);
+                                      struct phy_device *phydev,
+                                      int speed, int duplex,
+                                      bool tx_pause, bool rx_pause);
        void    (*phylink_fixed_state)(struct dsa_switch *ds, int port,
                                       struct phylink_link_state *state);
        /*
index b2f5262b35cf1ffc4490f117a4b0a6221bb17a2d..d4450a454249a046f8bee209cb3f83de0cab1fa8 100644 (file)
@@ -504,7 +504,8 @@ static void dsa_port_phylink_mac_link_up(struct phylink_config *config,
                return;
        }
 
-       ds->ops->phylink_mac_link_up(ds, dp->index, mode, interface, phydev);
+       ds->ops->phylink_mac_link_up(ds, dp->index, mode, interface, phydev,
+                                    speed, duplex, tx_pause, rx_pause);
 }
 
 const struct phylink_mac_ops dsa_port_phylink_mac_ops = {