2
0

0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. From: Russell King <[email protected]>
  2. Date: Wed, 26 Feb 2020 10:23:46 +0000
  3. Subject: [PATCH] net: dsa: propagate resolved link config via mac_link_up()
  4. Propagate the resolved link configuration down via DSA's
  5. phylink_mac_link_up() operation to allow split PCS/MAC to work.
  6. Tested-by: Vladimir Oltean <[email protected]>
  7. Signed-off-by: Russell King <[email protected]>
  8. Signed-off-by: David S. Miller <[email protected]>
  9. ---
  10. --- a/drivers/net/dsa/b53/b53_common.c
  11. +++ b/drivers/net/dsa/b53/b53_common.c
  12. @@ -1284,7 +1284,9 @@ EXPORT_SYMBOL(b53_phylink_mac_link_down)
  13. void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
  14. unsigned int mode,
  15. phy_interface_t interface,
  16. - struct phy_device *phydev)
  17. + struct phy_device *phydev,
  18. + int speed, int duplex,
  19. + bool tx_pause, bool rx_pause)
  20. {
  21. struct b53_device *dev = ds->priv;
  22. --- a/drivers/net/dsa/b53/b53_priv.h
  23. +++ b/drivers/net/dsa/b53/b53_priv.h
  24. @@ -337,7 +337,9 @@ void b53_phylink_mac_link_down(struct ds
  25. void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
  26. unsigned int mode,
  27. phy_interface_t interface,
  28. - struct phy_device *phydev);
  29. + struct phy_device *phydev,
  30. + int speed, int duplex,
  31. + bool tx_pause, bool rx_pause);
  32. int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering);
  33. int b53_vlan_prepare(struct dsa_switch *ds, int port,
  34. const struct switchdev_obj_port_vlan *vlan);
  35. --- a/drivers/net/dsa/bcm_sf2.c
  36. +++ b/drivers/net/dsa/bcm_sf2.c
  37. @@ -636,7 +636,9 @@ static void bcm_sf2_sw_mac_link_down(str
  38. static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port,
  39. unsigned int mode,
  40. phy_interface_t interface,
  41. - struct phy_device *phydev)
  42. + struct phy_device *phydev,
  43. + int speed, int duplex,
  44. + bool tx_pause, bool rx_pause)
  45. {
  46. struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
  47. struct ethtool_eee *p = &priv->dev->ports[port].eee;
  48. --- a/drivers/net/dsa/lantiq_gswip.c
  49. +++ b/drivers/net/dsa/lantiq_gswip.c
  50. @@ -1508,7 +1508,9 @@ static void gswip_phylink_mac_link_down(
  51. static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port,
  52. unsigned int mode,
  53. phy_interface_t interface,
  54. - struct phy_device *phydev)
  55. + struct phy_device *phydev,
  56. + int speed, int duplex,
  57. + bool tx_pause, bool rx_pause)
  58. {
  59. struct gswip_priv *priv = ds->priv;
  60. --- a/drivers/net/dsa/mt7530.c
  61. +++ b/drivers/net/dsa/mt7530.c
  62. @@ -1450,7 +1450,9 @@ static void mt7530_phylink_mac_link_down
  63. static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port,
  64. unsigned int mode,
  65. phy_interface_t interface,
  66. - struct phy_device *phydev)
  67. + struct phy_device *phydev,
  68. + int speed, int duplex,
  69. + bool tx_pause, bool rx_pause)
  70. {
  71. struct mt7530_priv *priv = ds->priv;
  72. --- a/drivers/net/dsa/mv88e6xxx/chip.c
  73. +++ b/drivers/net/dsa/mv88e6xxx/chip.c
  74. @@ -652,7 +652,9 @@ static void mv88e6xxx_mac_link_down(stru
  75. static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
  76. unsigned int mode, phy_interface_t interface,
  77. - struct phy_device *phydev)
  78. + struct phy_device *phydev,
  79. + int speed, int duplex,
  80. + bool tx_pause, bool rx_pause)
  81. {
  82. if (mode == MLO_AN_FIXED)
  83. mv88e6xxx_mac_link_force(ds, port, LINK_FORCED_UP);
  84. --- a/drivers/net/dsa/sja1105/sja1105_main.c
  85. +++ b/drivers/net/dsa/sja1105/sja1105_main.c
  86. @@ -830,7 +830,9 @@ static void sja1105_mac_link_down(struct
  87. static void sja1105_mac_link_up(struct dsa_switch *ds, int port,
  88. unsigned int mode,
  89. phy_interface_t interface,
  90. - struct phy_device *phydev)
  91. + struct phy_device *phydev,
  92. + int speed, int duplex,
  93. + bool tx_pause, bool rx_pause)
  94. {
  95. sja1105_inhibit_tx(ds->priv, BIT(port), false);
  96. }
  97. --- a/include/net/dsa.h
  98. +++ b/include/net/dsa.h
  99. @@ -406,7 +406,9 @@ struct dsa_switch_ops {
  100. void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
  101. unsigned int mode,
  102. phy_interface_t interface,
  103. - struct phy_device *phydev);
  104. + struct phy_device *phydev,
  105. + int speed, int duplex,
  106. + bool tx_pause, bool rx_pause);
  107. void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
  108. struct phylink_link_state *state);
  109. /*
  110. --- a/net/dsa/port.c
  111. +++ b/net/dsa/port.c
  112. @@ -544,7 +544,8 @@ void dsa_port_phylink_mac_link_up(struct
  113. return;
  114. }
  115. - ds->ops->phylink_mac_link_up(ds, dp->index, mode, interface, phydev);
  116. + ds->ops->phylink_mac_link_up(ds, dp->index, mode, interface, phydev,
  117. + speed, duplex, tx_pause, rx_pause);
  118. }
  119. EXPORT_SYMBOL_GPL(dsa_port_phylink_mac_link_up);
  120. --- a/net/dsa/dsa_priv.h
  121. +++ b/net/dsa/dsa_priv.h
  122. @@ -192,9 +192,11 @@ void dsa_port_phylink_mac_link_down(stru
  123. unsigned int mode,
  124. phy_interface_t interface);
  125. void dsa_port_phylink_mac_link_up(struct phylink_config *config,
  126. + struct phy_device *phydev,
  127. unsigned int mode,
  128. phy_interface_t interface,
  129. - struct phy_device *phydev);
  130. + int speed, int duplex,
  131. + bool tx_pause, bool rx_pause);
  132. extern const struct phylink_mac_ops dsa_port_phylink_mac_ops;
  133. /* slave.c */