linux/drivers/net/ethernet/renesas/ravb_main.c

// SPDX-License-Identifier: GPL-2.0
/* Renesas Ethernet AVB device driver
 *
 * Copyright (C) 2014-2019 Renesas Electronics Corporation
 * Copyright (C) 2015 Renesas Solutions Corp.
 * Copyright (C) 2015-2016 Cogent Embedded, Inc. <[email protected]>
 *
 * Based on the SuperH Ethernet driver
 */

#include <linux/cache.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
#include <linux/kernel.h>
#include <linux/list.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/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/reset.h>
#include <linux/math64.h>
#include <net/ip.h>
#include <net/page_pool/helpers.h>

#include "ravb.h"

#define RAVB_DEF_MSG_ENABLE

void ravb_modify(struct net_device *ndev, enum ravb_reg reg, u32 clear,
		 u32 set)
{}

int ravb_wait(struct net_device *ndev, enum ravb_reg reg, u32 mask, u32 value)
{}

static int ravb_set_opmode(struct net_device *ndev, u32 opmode)
{}

static void ravb_set_rate_gbeth(struct net_device *ndev)
{}

static void ravb_set_rate_rcar(struct net_device *ndev)
{}

/* Get MAC address from the MAC address registers
 *
 * Ethernet AVB device doesn't have ROM for MAC address.
 * This function gets the MAC address that was used by a bootloader.
 */
static void ravb_read_mac_address(struct device_node *np,
				  struct net_device *ndev)
{}

static void ravb_mdio_ctrl(struct mdiobb_ctrl *ctrl, u32 mask, int set)
{}

/* MDC pin control */
static void ravb_set_mdc(struct mdiobb_ctrl *ctrl, int level)
{}

/* Data I/O pin control */
static void ravb_set_mdio_dir(struct mdiobb_ctrl *ctrl, int output)
{}

/* Set data bit */
static void ravb_set_mdio_data(struct mdiobb_ctrl *ctrl, int value)
{}

/* Get data bit */
static int ravb_get_mdio_data(struct mdiobb_ctrl *ctrl)
{}

/* MDIO bus control struct */
static const struct mdiobb_ops bb_ops =;

static struct ravb_rx_desc *
ravb_rx_get_desc(struct ravb_private *priv, unsigned int q,
		 unsigned int i)
{}

/* Free TX skb function for AVB-IP */
static int ravb_tx_free(struct net_device *ndev, int q, bool free_txed_only)
{}

static void ravb_rx_ring_free(struct net_device *ndev, int q)
{}

/* Free skb's and DMA buffers for Ethernet AVB */
static void ravb_ring_free(struct net_device *ndev, int q)
{}

static int
ravb_alloc_rx_buffer(struct net_device *ndev, int q, u32 entry, gfp_t gfp_mask,
		     struct ravb_rx_desc *rx_desc)
{}

static u32
ravb_rx_ring_refill(struct net_device *ndev, int q, u32 count, gfp_t gfp_mask)
{}

/* Format skb and descriptor buffer for Ethernet AVB */
static void ravb_ring_format(struct net_device *ndev, int q)
{}

static void *ravb_alloc_rx_desc(struct net_device *ndev, int q)
{}

/* Init skb and descriptor buffer for Ethernet AVB */
static int ravb_ring_init(struct net_device *ndev, int q)
{}

static void ravb_csum_init_gbeth(struct net_device *ndev)
{}

static void ravb_emac_init_gbeth(struct net_device *ndev)
{}

static void ravb_emac_init_rcar(struct net_device *ndev)
{}

static void ravb_emac_init_rcar_gen4(struct net_device *ndev)
{}

/* E-MAC init function */
static void ravb_emac_init(struct net_device *ndev)
{}

static int ravb_dmac_init_gbeth(struct net_device *ndev)
{}

static int ravb_dmac_init_rcar(struct net_device *ndev)
{}

/* Device init function for Ethernet AVB */
static int ravb_dmac_init(struct net_device *ndev)
{}

static void ravb_get_tx_tstamp(struct net_device *ndev)
{}

static void ravb_rx_csum_gbeth(struct sk_buff *skb)
{}

static void ravb_rx_csum(struct sk_buff *skb)
{}

/* Packet receive function for Gigabit Ethernet */
static int ravb_rx_gbeth(struct net_device *ndev, int budget, int q)
{}

/* Packet receive function for Ethernet AVB */
static int ravb_rx_rcar(struct net_device *ndev, int budget, int q)
{}

/* Packet receive function for Ethernet AVB */
static int ravb_rx(struct net_device *ndev, int budget, int q)
{}

static void ravb_rcv_snd_disable(struct net_device *ndev)
{}

static void ravb_rcv_snd_enable(struct net_device *ndev)
{}

/* function for waiting dma process finished */
static int ravb_stop_dma(struct net_device *ndev)
{}

/* E-MAC interrupt handler */
static void ravb_emac_interrupt_unlocked(struct net_device *ndev)
{}

static irqreturn_t ravb_emac_interrupt(int irq, void *dev_id)
{}

/* Error interrupt handler */
static void ravb_error_interrupt(struct net_device *ndev)
{}

static bool ravb_queue_interrupt(struct net_device *ndev, int q)
{}

static bool ravb_timestamp_interrupt(struct net_device *ndev)
{}

static irqreturn_t ravb_interrupt(int irq, void *dev_id)
{}

/* Timestamp/Error/gPTP interrupt handler */
static irqreturn_t ravb_multi_interrupt(int irq, void *dev_id)
{}

static irqreturn_t ravb_dma_interrupt(int irq, void *dev_id, int q)
{}

static irqreturn_t ravb_be_interrupt(int irq, void *dev_id)
{}

static irqreturn_t ravb_nc_interrupt(int irq, void *dev_id)
{}

static int ravb_poll(struct napi_struct *napi, int budget)
{}

static void ravb_set_duplex_gbeth(struct net_device *ndev)
{}

/* PHY state control function */
static void ravb_adjust_link(struct net_device *ndev)
{}

/* PHY init function */
static int ravb_phy_init(struct net_device *ndev)
{}

/* PHY control start function */
static int ravb_phy_start(struct net_device *ndev)
{}

static u32 ravb_get_msglevel(struct net_device *ndev)
{}

static void ravb_set_msglevel(struct net_device *ndev, u32 value)
{}

static const char ravb_gstrings_stats_gbeth[][ETH_GSTRING_LEN] =;

static const char ravb_gstrings_stats[][ETH_GSTRING_LEN] =;

static int ravb_get_sset_count(struct net_device *netdev, int sset)
{}

static void ravb_get_ethtool_stats(struct net_device *ndev,
				   struct ethtool_stats *estats, u64 *data)
{}

static void ravb_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
{}

static void ravb_get_ringparam(struct net_device *ndev,
			       struct ethtool_ringparam *ring,
			       struct kernel_ethtool_ringparam *kernel_ring,
			       struct netlink_ext_ack *extack)
{}

static int ravb_set_ringparam(struct net_device *ndev,
			      struct ethtool_ringparam *ring,
			      struct kernel_ethtool_ringparam *kernel_ring,
			      struct netlink_ext_ack *extack)
{}

static int ravb_get_ts_info(struct net_device *ndev,
			    struct kernel_ethtool_ts_info *info)
{}

static void ravb_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
{}

static int ravb_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
{}

static const struct ethtool_ops ravb_ethtool_ops =;

static int ravb_set_config_mode(struct net_device *ndev)
{}

static void ravb_set_gti(struct net_device *ndev)
{}

static int ravb_compute_gti(struct net_device *ndev)
{}

/* Set tx and rx clock internal delay modes */
static void ravb_parse_delay_mode(struct device_node *np, struct net_device *ndev)
{}

static void ravb_set_delay_mode(struct net_device *ndev)
{}

/* Network device open function for Ethernet AVB */
static int ravb_open(struct net_device *ndev)
{}

/* Timeout function for Ethernet AVB */
static void ravb_tx_timeout(struct net_device *ndev, unsigned int txqueue)
{}

static void ravb_tx_timeout_work(struct work_struct *work)
{}

static bool ravb_can_tx_csum_gbeth(struct sk_buff *skb)
{}

/* Packet transmit function for Ethernet AVB */
static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{}

static u16 ravb_select_queue(struct net_device *ndev, struct sk_buff *skb,
			     struct net_device *sb_dev)
{}

static struct net_device_stats *ravb_get_stats(struct net_device *ndev)
{}

/* Update promiscuous bit */
static void ravb_set_rx_mode(struct net_device *ndev)
{}

/* Device close function for Ethernet AVB */
static int ravb_close(struct net_device *ndev)
{}

static int ravb_hwtstamp_get(struct net_device *ndev, struct ifreq *req)
{}

/* Control hardware time stamping */
static int ravb_hwtstamp_set(struct net_device *ndev, struct ifreq *req)
{}

/* ioctl to device function */
static int ravb_do_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
{}

static int ravb_change_mtu(struct net_device *ndev, int new_mtu)
{}

static void ravb_set_rx_csum(struct net_device *ndev, bool enable)
{}

static int ravb_endisable_csum_gbeth(struct net_device *ndev, enum ravb_reg reg,
				     u32 val, u32 mask)
{}

static int ravb_set_features_gbeth(struct net_device *ndev,
				   netdev_features_t features)
{}

static int ravb_set_features_rcar(struct net_device *ndev,
				  netdev_features_t features)
{}

static int ravb_set_features(struct net_device *ndev,
			     netdev_features_t features)
{}

static const struct net_device_ops ravb_netdev_ops =;

/* MDIO bus init function */
static int ravb_mdio_init(struct ravb_private *priv)
{}

/* MDIO bus release function */
static int ravb_mdio_release(struct ravb_private *priv)
{}

static const struct ravb_hw_info ravb_gen2_hw_info =;

static const struct ravb_hw_info ravb_gen3_hw_info =;

static const struct ravb_hw_info ravb_gen4_hw_info =;

static const struct ravb_hw_info ravb_rzv2m_hw_info =;

static const struct ravb_hw_info gbeth_hw_info =;

static const struct of_device_id ravb_match_table[] =;
MODULE_DEVICE_TABLE(of, ravb_match_table);

static int ravb_setup_irq(struct ravb_private *priv, const char *irq_name,
			  const char *ch, int *irq, irq_handler_t handler)
{}

static int ravb_setup_irqs(struct ravb_private *priv)
{}

static int ravb_probe(struct platform_device *pdev)
{}

static void ravb_remove(struct platform_device *pdev)
{}

static int ravb_wol_setup(struct net_device *ndev)
{}

static int ravb_wol_restore(struct net_device *ndev)
{}

static int ravb_suspend(struct device *dev)
{}

static int ravb_resume(struct device *dev)
{}

static int ravb_runtime_suspend(struct device *dev)
{}

static int ravb_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops ravb_dev_pm_ops =;

static struct platform_driver ravb_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();