linux/drivers/net/ethernet/ti/cpsw_priv.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Texas Instruments Ethernet Switch Driver
 *
 * Copyright (C) 2019 Texas Instruments
 */

#include <linux/bpf.h>
#include <linux/bpf_trace.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/kmemleak.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/net_tstamp.h>
#include <linux/of.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/skbuff.h>
#include <net/page_pool/helpers.h>
#include <net/pkt_cls.h>
#include <net/pkt_sched.h>

#include "cpsw.h"
#include "cpts.h"
#include "cpsw_ale.h"
#include "cpsw_priv.h"
#include "cpsw_sl.h"
#include "davinci_cpdma.h"

#define CPTS_N_ETX_TS

int (*cpsw_slave_index)(struct cpsw_common *cpsw, struct cpsw_priv *priv);

void cpsw_intr_enable(struct cpsw_common *cpsw)
{}

void cpsw_intr_disable(struct cpsw_common *cpsw)
{}

void cpsw_tx_handler(void *token, int len, int status)
{}

irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id)
{}

irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id)
{}

irqreturn_t cpsw_misc_interrupt(int irq, void *dev_id)
{}

int cpsw_tx_mq_poll(struct napi_struct *napi_tx, int budget)
{}

int cpsw_tx_poll(struct napi_struct *napi_tx, int budget)
{}

int cpsw_rx_mq_poll(struct napi_struct *napi_rx, int budget)
{}

int cpsw_rx_poll(struct napi_struct *napi_rx, int budget)
{}

void cpsw_rx_vlan_encap(struct sk_buff *skb)
{}

void cpsw_set_slave_mac(struct cpsw_slave *slave, struct cpsw_priv *priv)
{}

void soft_reset(const char *module, void __iomem *reg)
{}

void cpsw_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue)
{}

static int cpsw_get_common_speed(struct cpsw_common *cpsw)
{}

int cpsw_need_resplit(struct cpsw_common *cpsw)
{}

void cpsw_split_res(struct cpsw_common *cpsw)
{}

int cpsw_init_common(struct cpsw_common *cpsw, void __iomem *ss_regs,
		     int ale_ageout, phys_addr_t desc_mem_phys,
		     int descs_pool_size)
{}

#if IS_ENABLED(CONFIG_TI_CPTS)

static void cpsw_hwtstamp_v1(struct cpsw_priv *priv)
{}

static void cpsw_hwtstamp_v2(struct cpsw_priv *priv)
{}

static int cpsw_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
{}

static int cpsw_hwtstamp_get(struct net_device *dev, struct ifreq *ifr)
{}
#else
static int cpsw_hwtstamp_get(struct net_device *dev, struct ifreq *ifr)
{
	return -EOPNOTSUPP;
}

static int cpsw_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
{
	return -EOPNOTSUPP;
}
#endif /*CONFIG_TI_CPTS*/

int cpsw_ndo_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{}

int cpsw_ndo_set_tx_maxrate(struct net_device *ndev, int queue, u32 rate)
{}

static int cpsw_tc_to_fifo(int tc, int num_tc)
{}

bool cpsw_shp_is_off(struct cpsw_priv *priv)
{}

static void cpsw_fifo_shp_on(struct cpsw_priv *priv, int fifo, int on)
{}

static int cpsw_set_fifo_bw(struct cpsw_priv *priv, int fifo, int bw)
{}

static int cpsw_set_fifo_rlimit(struct cpsw_priv *priv, int fifo, int bw)
{}

/* Defaults:
 * class A - prio 3
 * class B - prio 2
 * shaping for class A should be set first
 */
static int cpsw_set_cbs(struct net_device *ndev,
			struct tc_cbs_qopt_offload *qopt)
{}

static int cpsw_set_mqprio(struct net_device *ndev, void *type_data)
{}

static int cpsw_qos_setup_tc_block(struct net_device *ndev, struct flow_block_offload *f);

int cpsw_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type,
		      void *type_data)
{}

void cpsw_cbs_resume(struct cpsw_slave *slave, struct cpsw_priv *priv)
{}

void cpsw_mqprio_resume(struct cpsw_slave *slave, struct cpsw_priv *priv)
{}

int cpsw_fill_rx_channels(struct cpsw_priv *priv)
{}

static struct page_pool *cpsw_create_page_pool(struct cpsw_common *cpsw,
					       int size)
{}

static int cpsw_create_rx_pool(struct cpsw_common *cpsw, int ch)
{}

static int cpsw_ndev_create_xdp_rxq(struct cpsw_priv *priv, int ch)
{}

static void cpsw_ndev_destroy_xdp_rxq(struct cpsw_priv *priv, int ch)
{}

void cpsw_destroy_xdp_rxqs(struct cpsw_common *cpsw)
{}

int cpsw_create_xdp_rxqs(struct cpsw_common *cpsw)
{}

static int cpsw_xdp_prog_setup(struct cpsw_priv *priv, struct netdev_bpf *bpf)
{}

int cpsw_ndo_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
{}

int cpsw_xdp_tx_frame(struct cpsw_priv *priv, struct xdp_frame *xdpf,
		      struct page *page, int port)
{}

int cpsw_run_xdp(struct cpsw_priv *priv, int ch, struct xdp_buff *xdp,
		 struct page *page, int port, int *len)
{}

static int cpsw_qos_clsflower_add_policer(struct cpsw_priv *priv,
					  struct netlink_ext_ack *extack,
					  struct flow_cls_offload *cls,
					  u64 rate_pkt_ps)
{}

static int cpsw_qos_clsflower_policer_validate(const struct flow_action *action,
					       const struct flow_action_entry *act,
					       struct netlink_ext_ack *extack)
{}

static int cpsw_qos_configure_clsflower(struct cpsw_priv *priv, struct flow_cls_offload *cls)
{}

static int cpsw_qos_delete_clsflower(struct cpsw_priv *priv, struct flow_cls_offload *cls)
{}

static int cpsw_qos_setup_tc_clsflower(struct cpsw_priv *priv, struct flow_cls_offload *cls_flower)
{}

static int cpsw_qos_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_priv)
{}

static LIST_HEAD(cpsw_qos_block_cb_list);

static int cpsw_qos_setup_tc_block(struct net_device *ndev, struct flow_block_offload *f)
{}

void cpsw_qos_clsflower_resume(struct cpsw_priv *priv)
{}