#include <linux/debugfs.h>
#include <linux/dma-mapping.h>
#include <linux/if_ether.h>
+#include <linux/platform_device.h>
#include <linux/of_platform.h>
#include <linux/seq_file.h>
#include <linux/tcp.h>
int ret = -ENOMEM;
u32 i;
- pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV | PP_FLAG_PAGE_FRAG;
+ pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
pp_params.pool_size = DMA_RX_SIZE;
pp_params.order = 0;
pp_params.max_len = PAGE_SIZE;
}
-netdev_tx_t xgmac_dma_xmit(struct sk_buff *skb, struct xgmac_dma_priv *priv)
+static netdev_tx_t xgmac_dma_xmit(struct sk_buff *skb, struct xgmac_dma_priv *priv)
{
u16 queue = skb_get_queue_mapping(skb);
u16 channel = queue;
MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Ethernet DMA driver for SF21A6826/SF21H8898 SoC");
\ No newline at end of file
+MODULE_DESCRIPTION("Ethernet DMA driver for SF21A6826/SF21H8898 SoC");
#include <linux/if.h>
#include <linux/if_vlan.h>
#include <linux/crc32.h>
+#include <linux/platform_device.h>
+#include <linux/phylink.h>
+#include <linux/reset.h>
#include "dma.h"
#include "eth.h"
.ndo_change_mtu = xgmac_change_mtu,
};
-static void xgmac_validate(struct phylink_config *config,
- unsigned long *supported,
- struct phylink_link_state *state)
-{
- __ETHTOOL_DECLARE_LINK_MODE_MASK(mac_supported) = {};
-
- phylink_set(mac_supported, 10baseT_Half);
- phylink_set(mac_supported, 10baseT_Full);
- phylink_set(mac_supported, 100baseT_Half);
- phylink_set(mac_supported, 100baseT_Full);
- phylink_set(mac_supported, 1000baseT_Full);
- phylink_set(mac_supported, 1000baseX_Full);
- phylink_set(mac_supported, 1000baseKX_Full);
- phylink_set(mac_supported, 2500baseT_Full);
- phylink_set(mac_supported, 2500baseX_Full);
-
- phylink_set(mac_supported, Autoneg);
- phylink_set(mac_supported, Pause);
- phylink_set(mac_supported, Asym_Pause);
- phylink_set_port_modes(mac_supported);
-
- linkmode_and(supported, supported, mac_supported);
- linkmode_and(state->advertising, state->advertising, mac_supported);
-}
-
static struct xgmac_priv *sfxgmac_phylink_to_port(struct phylink_config *config)
{
return container_of(config, struct xgmac_priv, phylink_config);
}
static const struct phylink_mac_ops xgmac_phylink_mac_ops = {
- .validate = xgmac_validate,
.mac_select_pcs = xgmac_mac_selct_pcs,
.mac_config = xgmac_mac_config,
.mac_link_down = xgmac_mac_link_down,
return phylink_ethtool_ksettings_get(priv->phylink, cmd);
}
-static int xgmac_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *e)
+static int xgmac_ethtool_get_eee(struct net_device *dev, struct ethtool_keee *eee)
{
struct xgmac_priv *priv = netdev_priv(dev);
int ret;
- ret = phylink_ethtool_get_eee(priv->phylink, e);
+ ret = phylink_ethtool_get_eee(priv->phylink, eee);
if (ret)
return ret;
- e->tx_lpi_enabled = priv->tx_lpi_enabled;
- e->tx_lpi_timer = reg_read(priv, XGMAC_LPI_AUTO_EN);
+ eee->tx_lpi_enabled = priv->tx_lpi_enabled;
+ eee->tx_lpi_timer = reg_read(priv, XGMAC_LPI_AUTO_EN);
return 0;
}
-static int xgmac_ethtool_set_eee(struct net_device *dev, struct ethtool_eee *e)
+static int xgmac_ethtool_set_eee(struct net_device *dev, struct ethtool_keee *eee)
{
struct xgmac_priv *priv = netdev_priv(dev);
int ret;
- if (e->tx_lpi_timer > XGMAC_LPI_AUTO_EN_MAX)
+ if (eee->tx_lpi_timer > XGMAC_LPI_AUTO_EN_MAX)
return -EINVAL;
- ret = phylink_ethtool_set_eee(priv->phylink, e);
+ ret = phylink_ethtool_set_eee(priv->phylink, eee);
if (ret)
return ret;
- priv->tx_lpi_enabled = e->tx_lpi_enabled;
+ priv->tx_lpi_enabled = eee->tx_lpi_enabled;
xgmac_toggle_tx_lpi(priv);
- reg_write(priv, XGMAC_LPI_AUTO_EN, e->tx_lpi_timer);
+ reg_write(priv, XGMAC_LPI_AUTO_EN, eee->tx_lpi_timer);
return 0;
}
ndev->netdev_ops = &xgmac_netdev_ops;
ndev->ethtool_ops = &xgmac_ethtool_ops;
ndev->features = NETIF_F_RXHASH | NETIF_F_RXCSUM | NETIF_F_GRO |
- NETIF_F_SG | NETIF_F_LLTX | NETIF_F_HW_TC |
+ NETIF_F_SG | NETIF_F_HW_TC |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_TSO |
NETIF_F_TSO6;
ndev->hw_features = (ndev->features & ~NETIF_F_RXHASH) |
MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Ethernet XGMAC driver for SF21A6826/SF21H8898 SoC");
\ No newline at end of file
+MODULE_DESCRIPTION("Ethernet XGMAC driver for SF21A6826/SF21H8898 SoC");