aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorINAGAKI Hiroshi <musashino.open@gmail.com>2021-05-06 23:22:19 +0900
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2021-09-26 00:32:18 +0200
commit9a4b8d6c306cef4dcdb442d541aaff6e3761da53 (patch)
tree88f6fe571bbb879c43e9890511d8ee26c1719ccc /target/linux
parent3069fffe60941d0848a8e7917132506bd6fa0b6d (diff)
downloadupstream-9a4b8d6c306cef4dcdb442d541aaff6e3761da53.tar.gz
upstream-9a4b8d6c306cef4dcdb442d541aaff6e3761da53.tar.bz2
upstream-9a4b8d6c306cef4dcdb442d541aaff6e3761da53.zip
realtek: fix compile errors in rtl838x_eth.c for 5.10
this patch fixes the following errors when compiling: - "unsigned int txqueue" is added as an additional parameter of ndo_tx_timeout in net_device_ops (include/linux/netdevice.h) - "mac_link_state" in phylink_mac_ops (include/linux/phylink.h) is renamed to "mac_pcs_get_state" and changed the return value to void from int - several parameters are added to "mac_link_up" in phylink_mac_ops (include/linux/phylink.h) and the order of the parameters is changed added: - int speed - int duplex - bool tx_pause - bool rx_pause - a parameter "phy_interface_t *interface" is added to of_get_phy_mode (drivers/of/of_net.c) and returns the state instead of phy mode Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c
index 3f98e3bf81..ce3574b902 100644
--- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c
@@ -1094,7 +1094,7 @@ static void rtl931x_eth_set_multicast_list(struct net_device *ndev)
}
}
-static void rtl838x_eth_tx_timeout(struct net_device *ndev)
+static void rtl838x_eth_tx_timeout(struct net_device *ndev, unsigned int txqueue)
{
unsigned long flags;
struct rtl838x_eth_priv *priv = netdev_priv(ndev);
@@ -1436,7 +1436,7 @@ static void rtl838x_mac_an_restart(struct phylink_config *config)
sw_w32(0x6192F, priv->r->mac_force_mode_ctrl + priv->cpu_port * 4);
}
-static int rtl838x_mac_pcs_get_state(struct phylink_config *config,
+static void rtl838x_mac_pcs_get_state(struct phylink_config *config,
struct phylink_link_state *state)
{
u32 speed;
@@ -1470,8 +1470,6 @@ static int rtl838x_mac_pcs_get_state(struct phylink_config *config,
state->pause |= MLO_PAUSE_RX;
if (priv->r->get_mac_tx_pause_sts(port))
state->pause |= MLO_PAUSE_TX;
-
- return 1;
}
static void rtl838x_mac_link_down(struct phylink_config *config,
@@ -1486,9 +1484,10 @@ static void rtl838x_mac_link_down(struct phylink_config *config,
sw_w32_mask(0x03, 0, priv->r->mac_port_ctrl(priv->cpu_port));
}
-static void rtl838x_mac_link_up(struct phylink_config *config, unsigned int mode,
- phy_interface_t interface,
- struct phy_device *phy)
+static void rtl838x_mac_link_up(struct phylink_config *config,
+ struct phy_device *phy, unsigned int mode,
+ phy_interface_t interface, int speed, int duplex,
+ bool tx_pause, bool rx_pause)
{
struct net_device *dev = container_of(config->dev, struct net_device, dev);
struct rtl838x_eth_priv *priv = netdev_priv(dev);
@@ -1950,7 +1949,7 @@ static const struct net_device_ops rtl931x_eth_netdev_ops = {
static const struct phylink_mac_ops rtl838x_phylink_ops = {
.validate = rtl838x_validate,
- .mac_link_state = rtl838x_mac_pcs_get_state,
+ .mac_pcs_get_state = rtl838x_mac_pcs_get_state,
.mac_an_restart = rtl838x_mac_an_restart,
.mac_config = rtl838x_mac_config,
.mac_link_down = rtl838x_mac_link_down,
@@ -2131,8 +2130,9 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dev);
- phy_mode = of_get_phy_mode(dn);
- if (phy_mode < 0) {
+ phy_mode = PHY_INTERFACE_MODE_NA;
+ err = of_get_phy_mode(dn, &phy_mode);
+ if (err < 0) {
dev_err(&pdev->dev, "incorrect phy-mode\n");
err = -EINVAL;
goto err_free;