[openwrt/openwrt] realtek: fix compile errors in dsa driver for 5.10

LEDE Commits lede-commits at lists.infradead.org
Sat Sep 25 15:37:39 PDT 2021


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a22602728c02e380ef4496b833271d5c760fe46f

commit a22602728c02e380ef4496b833271d5c760fe46f
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Fri May 7 00:38:22 2021 +0900

    realtek: fix compile errors in dsa driver for 5.10
    
    this patch fixes the following errors when compiling:
    
    - dsa_switch_alloc is removed[1]
    
    - a parameter "enum dsa_tag_protocol mprot" is added to dsa_tag_protocol
      in dsa_switch_ops (include/net/dsa.h)
    
    - several paramters are added to "phylink_mac_link_up" in dsa_switch_ops
      (include/net/dsa.h)
    
      added:
        - int speed
        - int duplex
        - bool tx_pause
        - bool rx_pause
    
    - a parameter "struct switchdev_trans *trans" is added to
      port_vlan_filtering in dsa_switch_ops (include/net/dsa.h)
    
    [1]: https://lore.kernel.org/lkml/20191020031941.3805884-17-vivien.didelot@gmail.com/
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 .../linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c |  2 +-
 target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c | 11 ++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c
index a380906b92..ad69debcc8 100644
--- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c
@@ -546,7 +546,7 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	priv->ds = dsa_switch_alloc(dev, DSA_MAX_PORTS);
+	priv->ds = devm_kzalloc(dev, sizeof(*priv->ds), GFP_KERNEL);
 
 	if (!priv->ds)
 		return -ENOMEM;
diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
index c2a230c4cb..6c0ed5ae00 100644
--- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
@@ -101,7 +101,9 @@ const struct rtl83xx_mib_desc rtl83xx_mib[] = {
 /* DSA callbacks */
 
 
-static enum dsa_tag_protocol rtl83xx_get_tag_protocol(struct dsa_switch *ds, int port)
+static enum dsa_tag_protocol rtl83xx_get_tag_protocol(struct dsa_switch *ds,
+						      int port,
+						      enum dsa_tag_protocol mprot)
 {
 	/* The switch does not tag the frames, instead internally the header
 	 * structure for each packet is tagged accordingly.
@@ -474,7 +476,9 @@ static void rtl83xx_phylink_mac_link_down(struct dsa_switch *ds, int port,
 static void rtl83xx_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 rtl838x_switch_priv *priv = ds->priv;
 	/* Restart TX/RX to port */
@@ -824,7 +828,8 @@ void rtl930x_fast_age(struct dsa_switch *ds, int port)
 }
 
 static int rtl83xx_vlan_filtering(struct dsa_switch *ds, int port,
-				  bool vlan_filtering)
+				  bool vlan_filtering,
+				  struct switchdev_trans *trans)
 {
 	struct rtl838x_switch_priv *priv = ds->priv;
 



More information about the lede-commits mailing list