#include <linux/atomic.h>
#include <linux/delay.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mii.h>
#include <linux/mdio/mdio-regmap.h>
#include <linux/netdevice.h>
#include <linux/of.h>
#include <linux/of_mdio.h>
#include <linux/of_net.h>
#include <linux/pcs-lynx.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/skbuff.h>
#include <asm/cacheflush.h>
#include "altera_utils.h"
#include "altera_tse.h"
#include "altera_sgdma.h"
#include "altera_msgdma.h"
static atomic_t instance_count = …;
static int debug = …;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
static const u32 default_msg_level = …;
#define RX_DESCRIPTORS …
static int dma_rx_num = …;
module_param(dma_rx_num, int, 0644);
MODULE_PARM_DESC(…) …;
#define TX_DESCRIPTORS …
static int dma_tx_num = …;
module_param(dma_tx_num, int, 0644);
MODULE_PARM_DESC(…) …;
#define POLL_PHY …
#define ALTERA_RXDMABUFFER_SIZE …
#define TSE_TX_THRESH(x) …
#define TXQUEUESTOP_THRESHHOLD …
static inline u32 tse_tx_avail(struct altera_tse_private *priv)
{ … }
static int altera_tse_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
{ … }
static int altera_tse_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
u16 value)
{ … }
static int altera_tse_mdio_create(struct net_device *dev, unsigned int id)
{ … }
static void altera_tse_mdio_destroy(struct net_device *dev)
{ … }
static int tse_init_rx_buffer(struct altera_tse_private *priv,
struct tse_buffer *rxbuffer, int len)
{ … }
static void tse_free_rx_buffer(struct altera_tse_private *priv,
struct tse_buffer *rxbuffer)
{ … }
static void tse_free_tx_buffer(struct altera_tse_private *priv,
struct tse_buffer *buffer)
{ … }
static int alloc_init_skbufs(struct altera_tse_private *priv)
{ … }
static void free_skbufs(struct net_device *dev)
{ … }
static inline void tse_rx_refill(struct altera_tse_private *priv)
{ … }
static inline void tse_rx_vlan(struct net_device *dev, struct sk_buff *skb)
{ … }
static int tse_rx(struct altera_tse_private *priv, int limit)
{ … }
static int tse_tx_complete(struct altera_tse_private *priv)
{ … }
static int tse_poll(struct napi_struct *napi, int budget)
{ … }
static irqreturn_t altera_isr(int irq, void *dev_id)
{ … }
static netdev_tx_t tse_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ … }
static int altera_tse_phy_get_addr_mdio_create(struct net_device *dev)
{ … }
static void tse_update_mac_addr(struct altera_tse_private *priv, const u8 *addr)
{ … }
static int reset_mac(struct altera_tse_private *priv)
{ … }
static int init_mac(struct altera_tse_private *priv)
{ … }
static void tse_set_mac(struct altera_tse_private *priv, bool enable)
{ … }
static int tse_change_mtu(struct net_device *dev, int new_mtu)
{ … }
static void altera_tse_set_mcfilter(struct net_device *dev)
{ … }
static void altera_tse_set_mcfilterall(struct net_device *dev)
{ … }
static void tse_set_rx_mode_hashfilter(struct net_device *dev)
{ … }
static void tse_set_rx_mode(struct net_device *dev)
{ … }
static int tse_open(struct net_device *dev)
{ … }
static int tse_shutdown(struct net_device *dev)
{ … }
static struct net_device_ops altera_tse_netdev_ops = …;
static void alt_tse_mac_config(struct phylink_config *config, unsigned int mode,
const struct phylink_link_state *state)
{ … }
static void alt_tse_mac_link_down(struct phylink_config *config,
unsigned int mode, phy_interface_t interface)
{ … }
static void alt_tse_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)
{ … }
static struct phylink_pcs *alt_tse_select_pcs(struct phylink_config *config,
phy_interface_t interface)
{ … }
static const struct phylink_mac_ops alt_tse_phylink_ops = …;
static int request_and_map(struct platform_device *pdev, const char *name,
struct resource **res, void __iomem **ptr)
{ … }
static int altera_tse_probe(struct platform_device *pdev)
{ … }
static void altera_tse_remove(struct platform_device *pdev)
{ … }
static const struct altera_dmaops altera_dtype_sgdma = …;
static const struct altera_dmaops altera_dtype_msgdma = …;
static const struct of_device_id altera_tse_ids[] = …;
MODULE_DEVICE_TABLE(of, altera_tse_ids);
static struct platform_driver altera_tse_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;