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

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

#ifndef __MTK_WED_PRIV_H
#define __MTK_WED_PRIV_H

#include <linux/soc/mediatek/mtk_wed.h>
#include <linux/debugfs.h>
#include <linux/regmap.h>
#include <linux/netdevice.h>

#include "mtk_wed_regs.h"

struct mtk_eth;
struct mtk_wed_wo;

struct mtk_wed_soc_data {};

struct mtk_wed_amsdu {};

struct mtk_wed_hw {};

struct mtk_wdma_info {};

#ifdef CONFIG_NET_MEDIATEK_SOC_WED
static inline bool mtk_wed_is_v1(struct mtk_wed_hw *hw)
{}

static inline bool mtk_wed_is_v2(struct mtk_wed_hw *hw)
{}

static inline bool mtk_wed_is_v3(struct mtk_wed_hw *hw)
{}

static inline bool mtk_wed_is_v3_or_greater(struct mtk_wed_hw *hw)
{}

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

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

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

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

static inline u32
wpdma_tx_r32(struct mtk_wed_device *dev, int ring, u32 reg)
{}

static inline void
wpdma_tx_w32(struct mtk_wed_device *dev, int ring, u32 reg, u32 val)
{}

static inline u32
wpdma_rx_r32(struct mtk_wed_device *dev, int ring, u32 reg)
{}

static inline void
wpdma_rx_w32(struct mtk_wed_device *dev, int ring, u32 reg, u32 val)
{}

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

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

static inline u32 mtk_wed_get_pcie_base(struct mtk_wed_device *dev)
{}

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);
int mtk_wed_flow_add(int index);
void mtk_wed_flow_remove(int index);
void mtk_wed_fe_reset(void);
void mtk_wed_fe_reset_complete(void);
#else
static inline void
mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
	       void __iomem *wdma, phys_addr_t wdma_phy,
	       int index)
{
}
static inline void
mtk_wed_exit(void)
{
}
static inline int mtk_wed_flow_add(int index)
{
	return -EINVAL;
}
static inline void mtk_wed_flow_remove(int index)
{
}

static inline void mtk_wed_fe_reset(void)
{
}

static inline void mtk_wed_fe_reset_complete(void)
{
}
#endif

#ifdef CONFIG_DEBUG_FS
void mtk_wed_hw_add_debugfs(struct mtk_wed_hw *hw);
#else
static inline void mtk_wed_hw_add_debugfs(struct mtk_wed_hw *hw)
{
}
#endif

#endif