diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c index a3abf30c71c..92cf0ef717d 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c @@ -125,8 +125,15 @@ out_get_link: return ethtool_op_get_link(dev); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) +static int fe_set_ringparam(struct net_device *dev, + struct ethtool_ringparam *ring, + struct kernel_ethtool_ringparam *kernel_rp, + struct netlink_ext_ack *extack) +#else static int fe_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) +#endif { struct fe_priv *priv = netdev_priv(dev); @@ -146,8 +153,15 @@ static int fe_set_ringparam(struct net_device *dev, return 0; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) +static void fe_get_ringparam(struct net_device *dev, + struct ethtool_ringparam *ring, + struct kernel_ethtool_ringparam *kernel_rp, + struct netlink_ext_ack *extack) +#else static void fe_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) +#endif { struct fe_priv *priv = netdev_priv(dev); diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index 03e65a0c8a6..35a3113804e 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -1365,10 +1365,8 @@ static int __init fe_init(struct net_device *dev) fe_reset_phy(priv); - of_get_mac_address(priv->dev->of_node, dev->dev_addr); - - /* If the mac address is invalid, use random mac address */ - if (!is_valid_ether_addr(dev->dev_addr)) { + /* Set the MAC address if it is correct, if not use a random MAC address */ + if (of_get_ethdev_address(priv->dev->of_node, dev)) { eth_hw_addr_random(dev); dev_err(priv->dev, "generated random MAC address %pM\n", dev->dev_addr); @@ -1638,7 +1636,11 @@ static int fe_probe(struct platform_device *pdev) priv->tx_ring.tx_ring_size *= 4; priv->rx_ring.rx_ring_size *= 4; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) + netif_napi_add_weight(netdev, &priv->rx_napi, fe_poll, napi_weight); +#else netif_napi_add(netdev, &priv->rx_napi, fe_poll, napi_weight); +#endif fe_set_ethtool_ops(netdev); err = register_netdev(netdev);