#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/module.h>
#include <linux/net_tstamp.h>
#include <linux/of.h>
#include <linux/of_mdio.h>
#include <linux/of_net.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
#include <linux/spinlock.h>
#include "rtsn.h"
#include "rcar_gen4_ptp.h"
struct rtsn_private { … };
static u32 rtsn_read(struct rtsn_private *priv, enum rtsn_reg reg)
{ … }
static void rtsn_write(struct rtsn_private *priv, enum rtsn_reg reg, u32 data)
{ … }
static void rtsn_modify(struct rtsn_private *priv, enum rtsn_reg reg,
u32 clear, u32 set)
{ … }
static int rtsn_reg_wait(struct rtsn_private *priv, enum rtsn_reg reg,
u32 mask, u32 expected)
{ … }
static void rtsn_ctrl_data_irq(struct rtsn_private *priv, bool enable)
{ … }
static void rtsn_get_timestamp(struct rtsn_private *priv, struct timespec64 *ts)
{ … }
static int rtsn_tx_free(struct net_device *ndev, bool free_txed_only)
{ … }
static int rtsn_rx(struct net_device *ndev, int budget)
{ … }
static int rtsn_poll(struct napi_struct *napi, int budget)
{ … }
static int rtsn_desc_alloc(struct rtsn_private *priv)
{ … }
static void rtsn_desc_free(struct rtsn_private *priv)
{ … }
static void rtsn_chain_free(struct rtsn_private *priv)
{ … }
static int rtsn_chain_init(struct rtsn_private *priv, int tx_size, int rx_size)
{ … }
static void rtsn_chain_format(struct rtsn_private *priv)
{ … }
static int rtsn_dmac_init(struct rtsn_private *priv)
{ … }
static enum rtsn_mode rtsn_read_mode(struct rtsn_private *priv)
{ … }
static int rtsn_wait_mode(struct rtsn_private *priv, enum rtsn_mode mode)
{ … }
static int rtsn_change_mode(struct rtsn_private *priv, enum rtsn_mode mode)
{ … }
static int rtsn_get_data_irq_status(struct rtsn_private *priv)
{ … }
static irqreturn_t rtsn_irq(int irq, void *dev_id)
{ … }
static int rtsn_request_irq(unsigned int irq, irq_handler_t handler,
unsigned long flags, struct rtsn_private *priv,
const char *ch)
{ … }
static void rtsn_free_irqs(struct rtsn_private *priv)
{ … }
static int rtsn_request_irqs(struct rtsn_private *priv)
{ … }
static int rtsn_reset(struct rtsn_private *priv)
{ … }
static int rtsn_axibmi_init(struct rtsn_private *priv)
{ … }
static void rtsn_mhd_init(struct rtsn_private *priv)
{ … }
static int rtsn_get_phy_params(struct rtsn_private *priv)
{ … }
static void rtsn_set_phy_interface(struct rtsn_private *priv)
{ … }
static void rtsn_set_rate(struct rtsn_private *priv)
{ … }
static int rtsn_rmac_init(struct rtsn_private *priv)
{ … }
static int rtsn_hw_init(struct rtsn_private *priv)
{ … }
static int rtsn_mii_access(struct mii_bus *bus, bool read, int phyad,
int regad, u16 data)
{ … }
static int rtsn_mii_read(struct mii_bus *bus, int addr, int regnum)
{ … }
static int rtsn_mii_write(struct mii_bus *bus, int addr, int regnum, u16 val)
{ … }
static int rtsn_mdio_alloc(struct rtsn_private *priv)
{ … }
static void rtsn_mdio_free(struct rtsn_private *priv)
{ … }
static void rtsn_adjust_link(struct net_device *ndev)
{ … }
static int rtsn_phy_init(struct rtsn_private *priv)
{ … }
static void rtsn_phy_deinit(struct rtsn_private *priv)
{ … }
static int rtsn_init(struct rtsn_private *priv)
{ … }
static void rtsn_deinit(struct rtsn_private *priv)
{ … }
static void rtsn_parse_mac_address(struct device_node *np,
struct net_device *ndev)
{ … }
static int rtsn_open(struct net_device *ndev)
{ … }
static int rtsn_stop(struct net_device *ndev)
{ … }
static netdev_tx_t rtsn_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{ … }
static void rtsn_get_stats64(struct net_device *ndev,
struct rtnl_link_stats64 *storage)
{ … }
static int rtsn_do_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)
{ … }
static int rtsn_hwtstamp_get(struct net_device *ndev,
struct kernel_hwtstamp_config *config)
{ … }
static int rtsn_hwtstamp_set(struct net_device *ndev,
struct kernel_hwtstamp_config *config,
struct netlink_ext_ack *extack)
{ … }
static const struct net_device_ops rtsn_netdev_ops = …;
static int rtsn_get_ts_info(struct net_device *ndev,
struct kernel_ethtool_ts_info *info)
{ … }
static const struct ethtool_ops rtsn_ethtool_ops = …;
static const struct of_device_id rtsn_match_table[] = …;
MODULE_DEVICE_TABLE(of, rtsn_match_table);
static int rtsn_probe(struct platform_device *pdev)
{ … }
static void rtsn_remove(struct platform_device *pdev)
{ … }
static struct platform_driver rtsn_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;