From 5adf16b49254ad0b95e315bc34cdc7577f07d026 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 1 Feb 2018 17:50:27 +0100 Subject: cns3xxx: remove linux 4.9 support - Remove kernel 4.9 support - Apply specific 4.14 changes directly to source - Refreshed all Signed-off-by: Koen Vandeputte --- .../drivers/net/ethernet/cavium/cns3xxx_eth.c | 38 ++++++---------------- 1 file changed, 10 insertions(+), 28 deletions(-) (limited to 'target/linux/cns3xxx/files/drivers') diff --git a/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c b/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c index 51b01876ef..07c9dbc048 100644 --- a/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c +++ b/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c @@ -712,26 +712,20 @@ static int eth_poll(struct napi_struct *napi, int budget) } rx_ring->cur_index = i; - if (!received) { - napi_complete(napi); - enable_irq(sw->rx_irq); - budget = 0; - /* If 1 or more frames came in during IRQ enable, re-schedule */ - if (rx_ring->desc[i].cown) - eth_schedule_poll(sw); + cns3xxx_alloc_rx_buf(sw, received); + wmb(); + enable_rx_dma(sw); + + if (received < budget && napi_complete_done(napi, received)) { + enable_irq(sw->rx_irq); } spin_lock_bh(&tx_lock); eth_complete_tx(sw); spin_unlock_bh(&tx_lock); - cns3xxx_alloc_rx_buf(sw, received); - - wmb(); - enable_rx_dma(sw); - - return budget; + return received; } static void eth_set_desc(struct sw *sw, struct _tx_ring *tx_ring, int index, @@ -856,18 +850,6 @@ static void cns3xxx_get_drvinfo(struct net_device *dev, strcpy(info->bus_info, "internal"); } -static int cns3xxx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) -{ - struct port *port = netdev_priv(dev); - return phy_ethtool_gset(port->phydev, cmd); -} - -static int cns3xxx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) -{ - struct port *port = netdev_priv(dev); - return phy_ethtool_sset(port->phydev, cmd); -} - static int cns3xxx_nway_reset(struct net_device *dev) { struct port *port = netdev_priv(dev); @@ -876,8 +858,8 @@ static int cns3xxx_nway_reset(struct net_device *dev) static struct ethtool_ops cns3xxx_ethtool_ops = { .get_drvinfo = cns3xxx_get_drvinfo, - .get_settings = cns3xxx_get_settings, - .set_settings = cns3xxx_set_settings, + .get_link_ksettings = phy_ethtool_get_link_ksettings, + .set_link_ksettings = phy_ethtool_set_link_ksettings, .nway_reset = cns3xxx_nway_reset, .get_link = ethtool_op_get_link, }; @@ -1177,7 +1159,7 @@ static int eth_init_one(struct platform_device *pdev) goto err_remove_mdio; } - strcpy(napi_dev->name, "switch%d"); + strcpy(napi_dev->name, "cns3xxx_eth"); napi_dev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_FRAGLIST; SET_NETDEV_DEV(napi_dev, &pdev->dev); -- cgit v1.2.3