#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/mfd/syscon.h>
#include <linux/mii.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/of_mdio.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/types.h>
#include <linux/u64_stats_sync.h>
#define AVE_IDR …
#define AVE_VR …
#define AVE_GRR …
#define AVE_CFGR …
#define AVE_GIMR …
#define AVE_GISR …
#define AVE_TXCR …
#define AVE_RXCR …
#define AVE_RXMAC1R …
#define AVE_RXMAC2R …
#define AVE_MDIOCTR …
#define AVE_MDIOAR …
#define AVE_MDIOWDR …
#define AVE_MDIOSR …
#define AVE_MDIORDR …
#define AVE_DESCC …
#define AVE_TXDC …
#define AVE_RXDC0 …
#define AVE_IIRQC …
#define AVE_PKTF_BASE …
#define AVE_PFMBYTE_BASE …
#define AVE_PFMBIT_BASE …
#define AVE_PFSEL_BASE …
#define AVE_PFEN …
#define AVE_PKTF(ent) …
#define AVE_PFMBYTE(ent) …
#define AVE_PFMBIT(ent) …
#define AVE_PFSEL(ent) …
#define AVE_DESC_SIZE_64 …
#define AVE_TXDM_64 …
#define AVE_RXDM_64 …
#define AVE_TXDM_SIZE_64 …
#define AVE_RXDM_SIZE_64 …
#define AVE_DESC_SIZE_32 …
#define AVE_TXDM_32 …
#define AVE_RXDM_32 …
#define AVE_TXDM_SIZE_32 …
#define AVE_RXDM_SIZE_32 …
#define AVE_RSTCTRL …
#define AVE_RSTCTRL_RMIIRST …
#define AVE_LINKSEL …
#define AVE_LINKSEL_100M …
#define AVE_GRR_RXFFR …
#define AVE_GRR_PHYRST …
#define AVE_GRR_GRST …
#define AVE_CFGR_FLE …
#define AVE_CFGR_CHE …
#define AVE_CFGR_MII …
#define AVE_CFGR_IPFCEN …
#define AVE_GI_PHY …
#define AVE_GI_TX …
#define AVE_GI_RXERR …
#define AVE_GI_RXOVF …
#define AVE_GI_RXDROP …
#define AVE_GI_RXIINT …
#define AVE_TXCR_FLOCTR …
#define AVE_TXCR_TXSPD_1G …
#define AVE_TXCR_TXSPD_100 …
#define AVE_RXCR_RXEN …
#define AVE_RXCR_FDUPEN …
#define AVE_RXCR_FLOCTR …
#define AVE_RXCR_AFEN …
#define AVE_RXCR_DRPEN …
#define AVE_RXCR_MPSIZ_MASK …
#define AVE_MDIOCTR_RREQ …
#define AVE_MDIOCTR_WREQ …
#define AVE_MDIOSR_STS …
#define AVE_DESCC_STATUS_MASK …
#define AVE_DESCC_RD0 …
#define AVE_DESCC_RDSTP …
#define AVE_DESCC_TD …
#define AVE_TXDC_SIZE …
#define AVE_TXDC_ADDR …
#define AVE_TXDC_ADDR_START …
#define AVE_RXDC0_SIZE …
#define AVE_RXDC0_ADDR …
#define AVE_RXDC0_ADDR_START …
#define AVE_IIRQC_EN0 …
#define AVE_IIRQC_BSCK …
#define AVE_STS_OWN …
#define AVE_STS_INTR …
#define AVE_STS_OK …
#define AVE_STS_NOCSUM …
#define AVE_STS_1ST …
#define AVE_STS_LAST …
#define AVE_STS_OWC …
#define AVE_STS_EC …
#define AVE_STS_PKTLEN_TX_MASK …
#define AVE_STS_CSSV …
#define AVE_STS_CSER …
#define AVE_STS_PKTLEN_RX_MASK …
#define AVE_PFMBYTE_MASK0 …
#define AVE_PFMBYTE_MASK1 …
#define AVE_PFMBIT_MASK …
#define AVE_PF_SIZE …
#define AVE_PF_MULTICAST_SIZE …
#define AVE_PFNUM_FILTER …
#define AVE_PFNUM_UNICAST …
#define AVE_PFNUM_BROADCAST …
#define AVE_PFNUM_MULTICAST …
#define AVE_DEFAULT_MSG_ENABLE …
#define AVE_NR_TXDESC …
#define AVE_NR_RXDESC …
#define AVE_DESC_OFS_CMDSTS …
#define AVE_DESC_OFS_ADDRL …
#define AVE_DESC_OFS_ADDRU …
#define AVE_MAX_ETHFRAME …
#define AVE_FRAME_HEADROOM …
#define AVE_INTM_COUNT …
#define AVE_FORCE_TXINTCNT …
#define SG_ETPINMODE …
#define SG_ETPINMODE_EXTPHY …
#define SG_ETPINMODE_RMII(ins) …
#define IS_DESC_64BIT(p) …
#define AVE_MAX_CLKS …
#define AVE_MAX_RSTS …
enum desc_id { … };
enum desc_state { … };
struct ave_desc { … };
struct ave_desc_info { … };
struct ave_stats { … };
struct ave_private { … };
struct ave_soc_data { … };
static u32 ave_desc_read(struct net_device *ndev, enum desc_id id, int entry,
int offset)
{ … }
static u32 ave_desc_read_cmdsts(struct net_device *ndev, enum desc_id id,
int entry)
{ … }
static void ave_desc_write(struct net_device *ndev, enum desc_id id,
int entry, int offset, u32 val)
{ … }
static void ave_desc_write_cmdsts(struct net_device *ndev, enum desc_id id,
int entry, u32 val)
{ … }
static void ave_desc_write_addr(struct net_device *ndev, enum desc_id id,
int entry, dma_addr_t paddr)
{ … }
static u32 ave_irq_disable_all(struct net_device *ndev)
{ … }
static void ave_irq_restore(struct net_device *ndev, u32 val)
{ … }
static void ave_irq_enable(struct net_device *ndev, u32 bitflag)
{ … }
static void ave_hw_write_macaddr(struct net_device *ndev,
const unsigned char *mac_addr,
int reg1, int reg2)
{ … }
static void ave_hw_read_version(struct net_device *ndev, char *buf, int len)
{ … }
static void ave_ethtool_get_drvinfo(struct net_device *ndev,
struct ethtool_drvinfo *info)
{ … }
static u32 ave_ethtool_get_msglevel(struct net_device *ndev)
{ … }
static void ave_ethtool_set_msglevel(struct net_device *ndev, u32 val)
{ … }
static void ave_ethtool_get_wol(struct net_device *ndev,
struct ethtool_wolinfo *wol)
{ … }
static int __ave_ethtool_set_wol(struct net_device *ndev,
struct ethtool_wolinfo *wol)
{ … }
static int ave_ethtool_set_wol(struct net_device *ndev,
struct ethtool_wolinfo *wol)
{ … }
static void ave_ethtool_get_pauseparam(struct net_device *ndev,
struct ethtool_pauseparam *pause)
{ … }
static int ave_ethtool_set_pauseparam(struct net_device *ndev,
struct ethtool_pauseparam *pause)
{ … }
static const struct ethtool_ops ave_ethtool_ops = …;
static int ave_mdiobus_read(struct mii_bus *bus, int phyid, int regnum)
{ … }
static int ave_mdiobus_write(struct mii_bus *bus, int phyid, int regnum,
u16 val)
{ … }
static int ave_dma_map(struct net_device *ndev, struct ave_desc *desc,
void *ptr, size_t len, enum dma_data_direction dir,
dma_addr_t *paddr)
{ … }
static void ave_dma_unmap(struct net_device *ndev, struct ave_desc *desc,
enum dma_data_direction dir)
{ … }
static int ave_rxdesc_prepare(struct net_device *ndev, int entry)
{ … }
static int ave_desc_switch(struct net_device *ndev, enum desc_state state)
{ … }
static int ave_tx_complete(struct net_device *ndev)
{ … }
static int ave_rx_receive(struct net_device *ndev, int num)
{ … }
static int ave_napi_poll_rx(struct napi_struct *napi, int budget)
{ … }
static int ave_napi_poll_tx(struct napi_struct *napi, int budget)
{ … }
static void ave_global_reset(struct net_device *ndev)
{ … }
static void ave_rxfifo_reset(struct net_device *ndev)
{ … }
static irqreturn_t ave_irq_handler(int irq, void *netdev)
{ … }
static int ave_pfsel_start(struct net_device *ndev, unsigned int entry)
{ … }
static int ave_pfsel_stop(struct net_device *ndev, unsigned int entry)
{ … }
static int ave_pfsel_set_macaddr(struct net_device *ndev,
unsigned int entry,
const unsigned char *mac_addr,
unsigned int set_size)
{ … }
static void ave_pfsel_set_promisc(struct net_device *ndev,
unsigned int entry, u32 rxring)
{ … }
static void ave_pfsel_init(struct net_device *ndev)
{ … }
static void ave_phy_adjust_link(struct net_device *ndev)
{ … }
static void ave_macaddr_init(struct net_device *ndev)
{ … }
static int ave_init(struct net_device *ndev)
{ … }
static void ave_uninit(struct net_device *ndev)
{ … }
static int ave_open(struct net_device *ndev)
{ … }
static int ave_stop(struct net_device *ndev)
{ … }
static netdev_tx_t ave_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{ … }
static int ave_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)
{ … }
static const u8 v4multi_macadr[] = …;
static const u8 v6multi_macadr[] = …;
static void ave_set_rx_mode(struct net_device *ndev)
{ … }
static void ave_get_stats64(struct net_device *ndev,
struct rtnl_link_stats64 *stats)
{ … }
static int ave_set_mac_address(struct net_device *ndev, void *p)
{ … }
static const struct net_device_ops ave_netdev_ops = …;
static int ave_probe(struct platform_device *pdev)
{ … }
static void ave_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int ave_suspend(struct device *dev)
{ … }
static int ave_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(ave_pm_ops, ave_suspend, ave_resume);
#define AVE_PM_OPS …
#else
#define AVE_PM_OPS …
#endif
static int ave_pro4_get_pinmode(struct ave_private *priv,
phy_interface_t phy_mode, u32 arg)
{ … }
static int ave_ld11_get_pinmode(struct ave_private *priv,
phy_interface_t phy_mode, u32 arg)
{ … }
static int ave_ld20_get_pinmode(struct ave_private *priv,
phy_interface_t phy_mode, u32 arg)
{ … }
static int ave_pxs3_get_pinmode(struct ave_private *priv,
phy_interface_t phy_mode, u32 arg)
{ … }
static const struct ave_soc_data ave_pro4_data = …;
static const struct ave_soc_data ave_pxs2_data = …;
static const struct ave_soc_data ave_ld11_data = …;
static const struct ave_soc_data ave_ld20_data = …;
static const struct ave_soc_data ave_pxs3_data = …;
static const struct ave_soc_data ave_nx1_data = …;
static const struct of_device_id of_ave_match[] = …;
MODULE_DEVICE_TABLE(of, of_ave_match);
static struct platform_driver ave_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;