linux/drivers/net/ethernet/mediatek/mtk_wed.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2021 Felix Fietkau <[email protected]> */

#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/bitfield.h>
#include <linux/dma-mapping.h>
#include <linux/skbuff.h>
#include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/of_reserved_mem.h>
#include <linux/mfd/syscon.h>
#include <linux/debugfs.h>
#include <linux/soc/mediatek/mtk_wed.h>
#include <net/flow_offload.h>
#include <net/pkt_cls.h>
#include "mtk_eth_soc.h"
#include "mtk_wed.h"
#include "mtk_ppe.h"
#include "mtk_wed_wo.h"

#define MTK_PCIE_BASE(n)

#define MTK_WED_PKT_SIZE
#define MTK_WED_BUF_SIZE
#define MTK_WED_PAGE_BUF_SIZE
#define MTK_WED_BUF_PER_PAGE
#define MTK_WED_RX_BUF_PER_PAGE
#define MTK_WED_RX_RING_SIZE
#define MTK_WED_RX_PG_BM_CNT
#define MTK_WED_AMSDU_BUF_SIZE
#define MTK_WED_AMSDU_NPAGES

#define MTK_WED_TX_RING_SIZE
#define MTK_WED_WDMA_RING_SIZE
#define MTK_WED_MAX_GROUP_SIZE
#define MTK_WED_VLD_GROUP_SIZE
#define MTK_WED_PER_GROUP_PKT

#define MTK_WED_FBUF_SIZE
#define MTK_WED_MIOD_CNT
#define MTK_WED_FB_CMD_CNT
#define MTK_WED_RRO_QUE_CNT
#define MTK_WED_MIOD_ENTRY_CNT

#define MTK_WED_TX_BM_DMA_SIZE
#define MTK_WED_TX_BM_PKT_CNT

static struct mtk_wed_hw *hw_list[3];
static DEFINE_MUTEX(hw_lock);

struct mtk_wed_flow_block_priv {};

static const struct mtk_wed_soc_data mt7622_data =;

static const struct mtk_wed_soc_data mt7986_data =;

static const struct mtk_wed_soc_data mt7988_data =;

static void
wed_m32(struct mtk_wed_device *dev, u32 reg, u32 mask, u32 val)
{}

static void
wed_set(struct mtk_wed_device *dev, u32 reg, u32 mask)
{}

static void
wed_clr(struct mtk_wed_device *dev, u32 reg, u32 mask)
{}

static void
wdma_m32(struct mtk_wed_device *dev, u32 reg, u32 mask, u32 val)
{}

static void
wdma_set(struct mtk_wed_device *dev, u32 reg, u32 mask)
{}

static void
wdma_clr(struct mtk_wed_device *dev, u32 reg, u32 mask)
{}

static u32
wifi_r32(struct mtk_wed_device *dev, u32 reg)
{}

static void
wifi_w32(struct mtk_wed_device *dev, u32 reg, u32 val)
{}

static u32
mtk_wed_read_reset(struct mtk_wed_device *dev)
{}

static u32
mtk_wdma_read_reset(struct mtk_wed_device *dev)
{}

static void
mtk_wdma_v3_rx_reset(struct mtk_wed_device *dev)
{}

static int
mtk_wdma_rx_reset(struct mtk_wed_device *dev)
{}

static u32
mtk_wed_check_busy(struct mtk_wed_device *dev, u32 reg, u32 mask)
{}

static int
mtk_wed_poll_busy(struct mtk_wed_device *dev, u32 reg, u32 mask)
{}

static void
mtk_wdma_v3_tx_reset(struct mtk_wed_device *dev)
{}

static void
mtk_wdma_tx_reset(struct mtk_wed_device *dev)
{}

static void
mtk_wed_reset(struct mtk_wed_device *dev, u32 mask)
{}

static u32
mtk_wed_wo_read_status(struct mtk_wed_device *dev)
{}

static void
mtk_wed_wo_reset(struct mtk_wed_device *dev)
{}

void mtk_wed_fe_reset(void)
{}

void mtk_wed_fe_reset_complete(void)
{}

static struct mtk_wed_hw *
mtk_wed_assign(struct mtk_wed_device *dev)
{}

static int
mtk_wed_amsdu_buffer_alloc(struct mtk_wed_device *dev)
{}

static void
mtk_wed_amsdu_free_buffer(struct mtk_wed_device *dev)
{}

static int
mtk_wed_amsdu_init(struct mtk_wed_device *dev)
{}

static int
mtk_wed_tx_buffer_alloc(struct mtk_wed_device *dev)
{}

static void
mtk_wed_free_tx_buffer(struct mtk_wed_device *dev)
{}

static int
mtk_wed_hwrro_buffer_alloc(struct mtk_wed_device *dev)
{}

static int
mtk_wed_rx_buffer_alloc(struct mtk_wed_device *dev)
{}

static void
mtk_wed_hwrro_free_buffer(struct mtk_wed_device *dev)
{}

static void
mtk_wed_free_rx_buffer(struct mtk_wed_device *dev)
{}

static void
mtk_wed_hwrro_init(struct mtk_wed_device *dev)
{}

static void
mtk_wed_rx_buffer_hw_init(struct mtk_wed_device *dev)
{}

static void
mtk_wed_free_ring(struct mtk_wed_device *dev, struct mtk_wed_ring *ring)
{}

static void
mtk_wed_free_rx_rings(struct mtk_wed_device *dev)
{}

static void
mtk_wed_free_tx_rings(struct mtk_wed_device *dev)
{}

static void
mtk_wed_set_ext_int(struct mtk_wed_device *dev, bool en)
{}

static void
mtk_wed_set_512_support(struct mtk_wed_device *dev, bool enable)
{}

static int
mtk_wed_check_wfdma_rx_fill(struct mtk_wed_device *dev,
			    struct mtk_wed_ring *ring)
{}

static void
mtk_wed_dma_disable(struct mtk_wed_device *dev)
{}

static void
mtk_wed_stop(struct mtk_wed_device *dev)
{}

static void
mtk_wed_deinit(struct mtk_wed_device *dev)
{}

static void
__mtk_wed_detach(struct mtk_wed_device *dev)
{}

static void
mtk_wed_detach(struct mtk_wed_device *dev)
{}

static void
mtk_wed_bus_init(struct mtk_wed_device *dev)
{}

static void
mtk_wed_set_wpdma(struct mtk_wed_device *dev)
{}

static void
mtk_wed_hw_init_early(struct mtk_wed_device *dev)
{}

static int
mtk_wed_rro_ring_alloc(struct mtk_wed_device *dev, struct mtk_wed_ring *ring,
		       int size)
{}

#define MTK_WED_MIOD_COUNT
static int
mtk_wed_rro_alloc(struct mtk_wed_device *dev)
{}

static int
mtk_wed_rro_cfg(struct mtk_wed_device *dev)
{}

static void
mtk_wed_rro_hw_init(struct mtk_wed_device *dev)
{}

static void
mtk_wed_route_qm_hw_init(struct mtk_wed_device *dev)
{}

static void
mtk_wed_hw_init(struct mtk_wed_device *dev)
{}

static void
mtk_wed_ring_reset(struct mtk_wed_ring *ring, int size, bool tx)
{}

static int
mtk_wed_rx_reset(struct mtk_wed_device *dev)
{}

static void
mtk_wed_reset_dma(struct mtk_wed_device *dev)
{}

static int
mtk_wed_ring_alloc(struct mtk_wed_device *dev, struct mtk_wed_ring *ring,
		   int size, u32 desc_size, bool tx)
{}

static int
mtk_wed_wdma_rx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
			   bool reset)
{}

static int
mtk_wed_wdma_tx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
			   bool reset)
{}

static void
mtk_wed_ppe_check(struct mtk_wed_device *dev, struct sk_buff *skb,
		  u32 reason, u32 hash)
{}

static void
mtk_wed_configure_irq(struct mtk_wed_device *dev, u32 irq_mask)
{}

#define MTK_WFMDA_RX_DMA_EN
static void
mtk_wed_dma_enable(struct mtk_wed_device *dev)
{}

static void
mtk_wed_start_hw_rro(struct mtk_wed_device *dev, u32 irq_mask, bool reset)
{}

static void
mtk_wed_rro_rx_ring_setup(struct mtk_wed_device *dev, int idx,
			  void __iomem *regs)
{}

static void
mtk_wed_msdu_pg_rx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs)
{}

static int
mtk_wed_ind_rx_ring_setup(struct mtk_wed_device *dev, void __iomem *regs)
{}

static void
mtk_wed_start(struct mtk_wed_device *dev, u32 irq_mask)
{}

static int
mtk_wed_attach(struct mtk_wed_device *dev)
	__releases(RCU)
{}

static int
mtk_wed_tx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs,
		      bool reset)
{}

static int
mtk_wed_txfree_ring_setup(struct mtk_wed_device *dev, void __iomem *regs)
{}

static int
mtk_wed_rx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs,
		      bool reset)
{}

static u32
mtk_wed_irq_get(struct mtk_wed_device *dev, u32 mask)
{}

static void
mtk_wed_irq_set_mask(struct mtk_wed_device *dev, u32 mask)
{}

int mtk_wed_flow_add(int index)
{}

void mtk_wed_flow_remove(int index)
{}

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

static int
mtk_wed_setup_tc_block(struct mtk_wed_hw *hw, struct net_device *dev,
		       struct flow_block_offload *f)
{}

static int
mtk_wed_setup_tc(struct mtk_wed_device *wed, struct net_device *dev,
		 enum tc_setup_type type, void *type_data)
{}

void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
		    void __iomem *wdma, phys_addr_t wdma_phy,
		    int index)
{}

void mtk_wed_exit(void)
{}