#include <linux/circ_buf.h>
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/etherdevice.h>
#include <linux/of_mdio.h>
#include <linux/of_net.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/reset.h>
#include "owl-emac.h"
#define OWL_EMAC_DEFAULT_MSG_ENABLE …
static u32 owl_emac_reg_read(struct owl_emac_priv *priv, u32 reg)
{ … }
static void owl_emac_reg_write(struct owl_emac_priv *priv, u32 reg, u32 data)
{ … }
static u32 owl_emac_reg_update(struct owl_emac_priv *priv,
u32 reg, u32 mask, u32 val)
{ … }
static void owl_emac_reg_set(struct owl_emac_priv *priv, u32 reg, u32 bits)
{ … }
static void owl_emac_reg_clear(struct owl_emac_priv *priv, u32 reg, u32 bits)
{ … }
static struct device *owl_emac_get_dev(struct owl_emac_priv *priv)
{ … }
static void owl_emac_irq_enable(struct owl_emac_priv *priv)
{ … }
static void owl_emac_irq_disable(struct owl_emac_priv *priv)
{ … }
static u32 owl_emac_irq_status(struct owl_emac_priv *priv)
{ … }
static u32 owl_emac_irq_clear(struct owl_emac_priv *priv)
{ … }
static dma_addr_t owl_emac_dma_map_rx(struct owl_emac_priv *priv,
struct sk_buff *skb)
{ … }
static void owl_emac_dma_unmap_rx(struct owl_emac_priv *priv,
struct sk_buff *skb, dma_addr_t dma_addr)
{ … }
static dma_addr_t owl_emac_dma_map_tx(struct owl_emac_priv *priv,
struct sk_buff *skb)
{ … }
static void owl_emac_dma_unmap_tx(struct owl_emac_priv *priv,
struct sk_buff *skb, dma_addr_t dma_addr)
{ … }
static unsigned int owl_emac_ring_num_unused(struct owl_emac_ring *ring)
{ … }
static unsigned int owl_emac_ring_get_next(struct owl_emac_ring *ring,
unsigned int cur)
{ … }
static void owl_emac_ring_push_head(struct owl_emac_ring *ring)
{ … }
static void owl_emac_ring_pop_tail(struct owl_emac_ring *ring)
{ … }
static struct sk_buff *owl_emac_alloc_skb(struct net_device *netdev)
{ … }
static int owl_emac_ring_prepare_rx(struct owl_emac_priv *priv)
{ … }
static void owl_emac_ring_prepare_tx(struct owl_emac_priv *priv)
{ … }
static void owl_emac_ring_unprepare_rx(struct owl_emac_priv *priv)
{ … }
static void owl_emac_ring_unprepare_tx(struct owl_emac_priv *priv)
{ … }
static int owl_emac_ring_alloc(struct device *dev, struct owl_emac_ring *ring,
unsigned int size)
{ … }
static void owl_emac_dma_cmd_resume_rx(struct owl_emac_priv *priv)
{ … }
static void owl_emac_dma_cmd_resume_tx(struct owl_emac_priv *priv)
{ … }
static u32 owl_emac_dma_cmd_set_tx(struct owl_emac_priv *priv, u32 status)
{ … }
static u32 owl_emac_dma_cmd_start_tx(struct owl_emac_priv *priv)
{ … }
static u32 owl_emac_dma_cmd_set(struct owl_emac_priv *priv, u32 status)
{ … }
static u32 owl_emac_dma_cmd_start(struct owl_emac_priv *priv)
{ … }
static u32 owl_emac_dma_cmd_stop(struct owl_emac_priv *priv)
{ … }
static void owl_emac_set_hw_mac_addr(struct net_device *netdev)
{ … }
static void owl_emac_update_link_state(struct owl_emac_priv *priv)
{ … }
static void owl_emac_adjust_link(struct net_device *netdev)
{ … }
static irqreturn_t owl_emac_handle_irq(int irq, void *data)
{ … }
static void owl_emac_ether_addr_push(u8 **dst, const u8 *src)
{ … }
static void
owl_emac_setup_frame_prepare(struct owl_emac_priv *priv, struct sk_buff *skb)
{ … }
static int owl_emac_setup_frame_xmit(struct owl_emac_priv *priv)
{ … }
static netdev_tx_t owl_emac_ndo_start_xmit(struct sk_buff *skb,
struct net_device *netdev)
{ … }
static bool owl_emac_tx_complete_tail(struct owl_emac_priv *priv)
{ … }
static void owl_emac_tx_complete(struct owl_emac_priv *priv)
{ … }
static int owl_emac_rx_process(struct owl_emac_priv *priv, int budget)
{ … }
static int owl_emac_poll(struct napi_struct *napi, int budget)
{ … }
static void owl_emac_mdio_clock_enable(struct owl_emac_priv *priv)
{ … }
static void owl_emac_core_hw_reset(struct owl_emac_priv *priv)
{ … }
static int owl_emac_core_sw_reset(struct owl_emac_priv *priv)
{ … }
static int owl_emac_enable(struct net_device *netdev, bool start_phy)
{ … }
static void owl_emac_disable(struct net_device *netdev, bool stop_phy)
{ … }
static int owl_emac_ndo_open(struct net_device *netdev)
{ … }
static int owl_emac_ndo_stop(struct net_device *netdev)
{ … }
static void owl_emac_set_multicast(struct net_device *netdev, int count)
{ … }
static void owl_emac_ndo_set_rx_mode(struct net_device *netdev)
{ … }
static int owl_emac_ndo_set_mac_addr(struct net_device *netdev, void *addr)
{ … }
static int owl_emac_ndo_eth_ioctl(struct net_device *netdev,
struct ifreq *req, int cmd)
{ … }
static void owl_emac_ndo_tx_timeout(struct net_device *netdev,
unsigned int txqueue)
{ … }
static void owl_emac_reset_task(struct work_struct *work)
{ … }
static struct net_device_stats *
owl_emac_ndo_get_stats(struct net_device *netdev)
{ … }
static const struct net_device_ops owl_emac_netdev_ops = …;
static void owl_emac_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{ … }
static u32 owl_emac_ethtool_get_msglevel(struct net_device *netdev)
{ … }
static void owl_emac_ethtool_set_msglevel(struct net_device *ndev, u32 val)
{ … }
static const struct ethtool_ops owl_emac_ethtool_ops = …;
static int owl_emac_mdio_wait(struct owl_emac_priv *priv)
{ … }
static int owl_emac_mdio_read(struct mii_bus *bus, int addr, int regnum)
{ … }
static int
owl_emac_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
{ … }
static int owl_emac_mdio_init(struct net_device *netdev)
{ … }
static int owl_emac_phy_init(struct net_device *netdev)
{ … }
static void owl_emac_get_mac_addr(struct net_device *netdev)
{ … }
static __maybe_unused int owl_emac_suspend(struct device *dev)
{ … }
static __maybe_unused int owl_emac_resume(struct device *dev)
{ … }
static void owl_emac_clk_disable_unprepare(void *data)
{ … }
static int owl_emac_clk_set_rate(struct owl_emac_priv *priv)
{ … }
static int owl_emac_probe(struct platform_device *pdev)
{ … }
static void owl_emac_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id owl_emac_of_match[] = …;
MODULE_DEVICE_TABLE(of, owl_emac_of_match);
static SIMPLE_DEV_PM_OPS(owl_emac_pm_ops,
owl_emac_suspend, owl_emac_resume);
static struct platform_driver owl_emac_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;