struct mvneta_bm *bm_priv;
struct mvneta_bm_pool *pool_long;
-@@ -1240,44 +1242,6 @@ static void mvneta_set_other_mcast_table
+@@ -1177,10 +1179,6 @@ static void mvneta_port_disable(struct m
+ val &= ~MVNETA_GMAC0_PORT_ENABLE;
+ mvreg_write(pp, MVNETA_GMAC_CTRL_0, val);
+
+- pp->link = 0;
+- pp->duplex = -1;
+- pp->speed = 0;
+-
+ udelay(200);
+ }
+
+@@ -1240,44 +1238,6 @@ static void mvneta_set_other_mcast_table
mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
}
static void mvneta_percpu_unmask_interrupt(void *arg)
{
struct mvneta_port *pp = arg;
-@@ -1425,7 +1389,6 @@ static void mvneta_defaults_set(struct m
+@@ -1425,7 +1385,6 @@ static void mvneta_defaults_set(struct m
val &= ~MVNETA_PHY_POLLING_ENABLE;
mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
mvneta_set_ucast_table(pp, -1);
mvneta_set_special_mcast_table(pp, -1);
mvneta_set_other_mcast_table(pp, -1);
-@@ -2618,26 +2581,11 @@ static irqreturn_t mvneta_isr(int irq, v
+@@ -2618,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v
return IRQ_HANDLED;
}
}
/* NAPI handler
-@@ -2666,12 +2614,11 @@ static int mvneta_poll(struct napi_struc
+@@ -2666,12 +2610,11 @@ static int mvneta_poll(struct napi_struc
u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE);
mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
}
/* Release Tx descriptors */
-@@ -2987,7 +2934,7 @@ static void mvneta_start_dev(struct mvne
+@@ -2987,7 +2930,7 @@ static void mvneta_start_dev(struct mvne
MVNETA_CAUSE_LINK_CHANGE |
MVNETA_CAUSE_PSC_SYNC_CHANGE);
netif_tx_start_all_queues(pp->dev);
}
-@@ -2995,7 +2942,7 @@ static void mvneta_stop_dev(struct mvnet
+@@ -2995,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet
{
unsigned int cpu;
for_each_online_cpu(cpu) {
struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
-@@ -3165,99 +3112,219 @@ static int mvneta_set_mac_addr(struct ne
+@@ -3165,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne
return 0;
}
- struct phy_device *phy_dev;
+ struct mvneta_port *pp = netdev_priv(ndev);
+ u32 val;
-+
-+ if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
-+ val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
-+ val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
-+ val |= MVNETA_GMAC_FORCE_LINK_PASS;
-+ mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
-+ }
- phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0,
- pp->phy_interface);
- pp->link = 0;
- pp->duplex = 0;
- pp->speed = 0;
-+ mvneta_port_up(pp);
-+}
++ if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) {
++ val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
++ val &= ~MVNETA_GMAC_FORCE_LINK_DOWN;
++ val |= MVNETA_GMAC_FORCE_LINK_PASS;
++ mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
++ }
- return 0;
++ mvneta_port_up(pp);
++}
++
+static const struct phylink_mac_ops mvneta_phylink_ops = {
+ .mac_get_support = mvneta_mac_support,
+ .mac_link_state = mvneta_mac_link_state,
}
/* Electing a CPU must be done in an atomic way: it should be done
-@@ -3505,10 +3572,7 @@ static int mvneta_ioctl(struct net_devic
+@@ -3505,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic
{
struct mvneta_port *pp = netdev_priv(dev);
}
/* Ethtool methods */
-@@ -3518,54 +3582,15 @@ int mvneta_ethtool_get_settings(struct n
+@@ -3518,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n
{
struct mvneta_port *pp = netdev_priv(dev);
}
/* Set interrupt coalescing for ethtools */
-@@ -3673,7 +3698,8 @@ static void mvneta_ethtool_update_stats(
+@@ -3673,7 +3694,8 @@ static void mvneta_ethtool_update_stats(
{
const struct mvneta_statistic *s;
void __iomem *base = pp->base;
u64 val64;
int i;
-@@ -3968,14 +3994,13 @@ static int mvneta_probe(struct platform_
+@@ -3968,14 +3990,13 @@ static int mvneta_probe(struct platform_
const struct mbus_dram_target_info *dram_target_info;
struct resource *res;
struct device_node *dn = pdev->dev.of_node;
int tx_csum_limit;
int phy_mode;
int err;
-@@ -3991,31 +4016,11 @@ static int mvneta_probe(struct platform_
+@@ -3991,31 +4012,11 @@ static int mvneta_probe(struct platform_
goto err_free_netdev;
}
}
dev->tx_queue_len = MVNETA_MAX_TXD;
-@@ -4026,12 +4031,7 @@ static int mvneta_probe(struct platform_
+@@ -4026,12 +4027,7 @@ static int mvneta_probe(struct platform_
pp = netdev_priv(dev);
spin_lock_init(&pp->lock);
pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;
pp->rxq_def = rxq_def;
-@@ -4041,7 +4041,7 @@ static int mvneta_probe(struct platform_
+@@ -4041,7 +4037,7 @@ static int mvneta_probe(struct platform_
pp->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pp->clk)) {
err = PTR_ERR(pp->clk);
}
clk_prepare_enable(pp->clk);
-@@ -4144,6 +4144,14 @@ static int mvneta_probe(struct platform_
+@@ -4144,6 +4140,14 @@ static int mvneta_probe(struct platform_
dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
err = register_netdev(dev);
if (err < 0) {
dev_err(&pdev->dev, "failed to register\n");
-@@ -4155,13 +4163,6 @@ static int mvneta_probe(struct platform_
+@@ -4155,13 +4159,6 @@ static int mvneta_probe(struct platform_
platform_set_drvdata(pdev, pp->dev);
return 0;
-@@ -4173,13 +4174,13 @@ err_netdev:
+@@ -4173,13 +4170,13 @@ err_netdev:
1 << pp->id);
}
err_free_stats:
err_free_irq:
irq_dispose_mapping(dev->irq);
err_free_netdev:
-@@ -4198,7 +4199,7 @@ static int mvneta_remove(struct platform
+@@ -4198,7 +4195,7 @@ static int mvneta_remove(struct platform
free_percpu(pp->ports);
free_percpu(pp->stats);
irq_dispose_mapping(dev->irq);
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3593,6 +3593,13 @@ int mvneta_ethtool_set_settings(struct n
+@@ -3589,6 +3589,13 @@ int mvneta_ethtool_set_settings(struct n
return phylink_ethtool_set_settings(pp->phylink, cmd);
}
/* Set interrupt coalescing for ethtools */
static int mvneta_ethtool_set_coalesce(struct net_device *dev,
struct ethtool_coalesce *c)
-@@ -3857,6 +3864,7 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3853,6 +3860,7 @@ const struct ethtool_ops mvneta_eth_tool
.get_link = ethtool_op_get_link,
.get_settings = mvneta_ethtool_get_settings,
.set_settings = mvneta_ethtool_set_settings,
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3212,6 +3212,8 @@ static void mvneta_mac_config(struct net
+@@ -3208,6 +3208,8 @@ static void mvneta_mac_config(struct net
if (state->advertising & ADVERTISED_Pause)
new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
switch (mode) {
case MLO_AN_SGMII:
-@@ -3236,7 +3238,7 @@ static void mvneta_mac_config(struct net
+@@ -3232,7 +3234,7 @@ static void mvneta_mac_config(struct net
/* The MAC only supports FD mode */
MVNETA_GMAC_CONFIG_FULL_DUPLEX;
new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN;
break;
-@@ -3689,6 +3691,22 @@ static int mvneta_ethtool_set_ringparam(
+@@ -3685,6 +3687,22 @@ static int mvneta_ethtool_set_ringparam(
return 0;
}
static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
u8 *data)
{
-@@ -3870,6 +3888,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3866,6 +3884,8 @@ const struct ethtool_ops mvneta_eth_tool
.get_drvinfo = mvneta_ethtool_get_drvinfo,
.get_ringparam = mvneta_ethtool_get_ringparam,
.set_ringparam = mvneta_ethtool_set_ringparam,
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3131,12 +3131,14 @@ static int mvneta_mac_support(struct net
+@@ -3127,12 +3127,14 @@ static int mvneta_mac_support(struct net
state->supported = PHY_10BT_FEATURES |
PHY_100BT_FEATURES |
SUPPORTED_1000baseT_Full |
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3118,9 +3118,9 @@ static int mvneta_mac_support(struct net
+@@ -3114,9 +3114,9 @@ static int mvneta_mac_support(struct net
switch (mode) {
case MLO_AN_8023Z:
state->supported = SUPPORTED_1000baseT_Full |
state->an_enabled = 1;
break;
-@@ -3131,18 +3131,21 @@ static int mvneta_mac_support(struct net
+@@ -3127,18 +3127,21 @@ static int mvneta_mac_support(struct net
state->supported = PHY_10BT_FEATURES |
PHY_100BT_FEATURES |
SUPPORTED_1000baseT_Full |
u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
u32 indir[MVNETA_RSS_LU_TABLE_SIZE];
-@@ -3280,6 +3297,18 @@ static void mvneta_mac_config(struct net
+@@ -3276,6 +3293,18 @@ static void mvneta_mac_config(struct net
mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an);
}
static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode)
{
struct mvneta_port *pp = netdev_priv(ndev);
-@@ -3293,6 +3322,9 @@ static void mvneta_mac_link_down(struct
+@@ -3289,6 +3318,9 @@ static void mvneta_mac_link_down(struct
val |= MVNETA_GMAC_FORCE_LINK_DOWN;
mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
}
}
static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode,
-@@ -3309,6 +3341,11 @@ static void mvneta_mac_link_up(struct ne
+@@ -3305,6 +3337,11 @@ static void mvneta_mac_link_up(struct ne
}
mvneta_port_up(pp);
}
static const struct phylink_mac_ops mvneta_phylink_ops = {
-@@ -3748,6 +3785,13 @@ static void mvneta_ethtool_update_stats(
+@@ -3744,6 +3781,13 @@ static void mvneta_ethtool_update_stats(
val64 = (u64)high << 32 | low;
pp->ethtool_stats[i] += val64;
break;
}
}
}
-@@ -3871,6 +3915,47 @@ static int mvneta_ethtool_get_rxfh(struc
+@@ -3867,6 +3911,47 @@ static int mvneta_ethtool_get_rxfh(struc
return 0;
}
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
-@@ -3902,6 +3987,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3898,6 +3983,8 @@ const struct ethtool_ops mvneta_eth_tool
.get_rxnfc = mvneta_ethtool_get_rxnfc,
.get_rxfh = mvneta_ethtool_get_rxfh,
.set_rxfh = mvneta_ethtool_set_rxfh,
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3915,6 +3915,22 @@ static int mvneta_ethtool_get_rxfh(struc
+@@ -3911,6 +3911,22 @@ static int mvneta_ethtool_get_rxfh(struc
return 0;
}
static int mvneta_ethtool_get_eee(struct net_device *dev,
struct ethtool_eee *eee)
{
-@@ -3987,6 +4003,8 @@ const struct ethtool_ops mvneta_eth_tool
+@@ -3983,6 +3999,8 @@ const struct ethtool_ops mvneta_eth_tool
.get_rxnfc = mvneta_ethtool_get_rxnfc,
.get_rxfh = mvneta_ethtool_get_rxfh,
.set_rxfh = mvneta_ethtool_set_rxfh,
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -1699,8 +1699,10 @@ static struct mvneta_tx_queue *mvneta_tx
+@@ -1695,8 +1695,10 @@ static struct mvneta_tx_queue *mvneta_tx
/* Free tx queue skbuffs */
static void mvneta_txq_bufs_free(struct mvneta_port *pp,
int i;
for (i = 0; i < num; i++) {
-@@ -1708,6 +1710,11 @@ static void mvneta_txq_bufs_free(struct
+@@ -1704,6 +1706,11 @@ static void mvneta_txq_bufs_free(struct
txq->txq_get_index;
struct sk_buff *skb = txq->tx_skb[txq->txq_get_index];
mvneta_txq_inc_get(txq);
if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr))
-@@ -1718,6 +1725,8 @@ static void mvneta_txq_bufs_free(struct
+@@ -1714,6 +1721,8 @@ static void mvneta_txq_bufs_free(struct
continue;
dev_kfree_skb_any(skb);
}
}
/* Handle end of transmission */
-@@ -1731,7 +1740,7 @@ static void mvneta_txq_done(struct mvnet
+@@ -1727,7 +1736,7 @@ static void mvneta_txq_done(struct mvnet
if (!tx_done)
return;
txq->count -= tx_done;
-@@ -2338,6 +2347,8 @@ out:
+@@ -2334,6 +2343,8 @@ out:
struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats);
struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id);
txq->count += frags;
mvneta_txq_pend_desc_add(pp, txq, frags);
-@@ -2362,9 +2373,10 @@ static void mvneta_txq_done_force(struct
+@@ -2358,9 +2369,10 @@ static void mvneta_txq_done_force(struct
struct mvneta_tx_queue *txq)
{
/* reset txq */
txq->count = 0;
-@@ -2845,6 +2857,8 @@ static int mvneta_txq_init(struct mvneta
+@@ -2841,6 +2853,8 @@ static int mvneta_txq_init(struct mvneta
static void mvneta_txq_deinit(struct mvneta_port *pp,
struct mvneta_tx_queue *txq)
{
kfree(txq->tx_skb);
if (txq->tso_hdrs)
-@@ -2856,6 +2870,8 @@ static void mvneta_txq_deinit(struct mvn
+@@ -2852,6 +2866,8 @@ static void mvneta_txq_deinit(struct mvn
txq->size * MVNETA_DESC_ALIGNED_SIZE,
txq->descs, txq->descs_phys);
---
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
-@@ -3988,6 +3988,16 @@ static int mvneta_ethtool_set_eee(struct
+@@ -3984,6 +3984,16 @@ static int mvneta_ethtool_set_eee(struct
return phylink_ethtool_set_eee(pp->phylink, eee);
}
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
-@@ -3998,6 +4008,7 @@ static const struct net_device_ops mvnet
+@@ -3994,6 +4004,7 @@ static const struct net_device_ops mvnet
.ndo_fix_features = mvneta_fix_features,
.ndo_get_stats64 = mvneta_get_stats64,
.ndo_do_ioctl = mvneta_ioctl,