linux/drivers/net/ethernet/marvell/prestera/prestera_rxtx.c

// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/* Copyright (c) 2019-2020 Marvell International Ltd. All rights reserved */

#include <linux/bitfield.h>
#include <linux/dmapool.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/platform_device.h>

#include "prestera_dsa.h"
#include "prestera.h"
#include "prestera_hw.h"
#include "prestera_rxtx.h"
#include "prestera_devlink.h"

#define PRESTERA_SDMA_WAIT_MUL

struct prestera_sdma_desc {} __packed __aligned();

#define PRESTERA_SDMA_BUFF_SIZE_MAX

#define PRESTERA_SDMA_RX_DESC_PKT_LEN(desc)

#define PRESTERA_SDMA_RX_DESC_OWNER(desc)

#define PRESTERA_SDMA_RX_DESC_IS_RCVD(desc)

#define PRESTERA_SDMA_RX_DESC_CPU_OWN
#define PRESTERA_SDMA_RX_DESC_DMA_OWN

#define PRESTERA_SDMA_RX_QUEUE_NUM

#define PRESTERA_SDMA_RX_DESC_PER_Q

#define PRESTERA_SDMA_TX_DESC_PER_Q
#define PRESTERA_SDMA_TX_MAX_BURST

#define PRESTERA_SDMA_TX_DESC_OWNER(desc)

#define PRESTERA_SDMA_TX_DESC_CPU_OWN
#define PRESTERA_SDMA_TX_DESC_DMA_OWN

#define PRESTERA_SDMA_TX_DESC_IS_SENT(desc)

#define PRESTERA_SDMA_TX_DESC_LAST
#define PRESTERA_SDMA_TX_DESC_FIRST
#define PRESTERA_SDMA_TX_DESC_CALC_CRC

#define PRESTERA_SDMA_TX_DESC_SINGLE

#define PRESTERA_SDMA_TX_DESC_INIT

#define PRESTERA_SDMA_RX_INTR_MASK_REG
#define PRESTERA_SDMA_RX_QUEUE_STATUS_REG
#define PRESTERA_SDMA_RX_QUEUE_DESC_REG(n)

#define PRESTERA_SDMA_TX_QUEUE_DESC_REG
#define PRESTERA_SDMA_TX_QUEUE_START_REG

struct prestera_sdma_buf {};

struct prestera_rx_ring {};

struct prestera_tx_ring {};

struct prestera_sdma {};

struct prestera_rxtx {};

static int prestera_sdma_buf_init(struct prestera_sdma *sdma,
				  struct prestera_sdma_buf *buf)
{}

static u32 prestera_sdma_map(struct prestera_sdma *sdma, dma_addr_t pa)
{}

static void prestera_sdma_rx_desc_init(struct prestera_sdma *sdma,
				       struct prestera_sdma_desc *desc,
				       dma_addr_t buf)
{}

static void prestera_sdma_rx_desc_set_next(struct prestera_sdma *sdma,
					   struct prestera_sdma_desc *desc,
					   dma_addr_t next)
{}

static int prestera_sdma_rx_skb_alloc(struct prestera_sdma *sdma,
				      struct prestera_sdma_buf *buf)
{}

static struct sk_buff *prestera_sdma_rx_skb_get(struct prestera_sdma *sdma,
						struct prestera_sdma_buf *buf)
{}

static int prestera_rxtx_process_skb(struct prestera_sdma *sdma,
				     struct sk_buff *skb)
{}

static int prestera_sdma_next_rx_buf_idx(int buf_idx)
{}

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

static void prestera_sdma_rx_fini(struct prestera_sdma *sdma)
{}

static int prestera_sdma_rx_init(struct prestera_sdma *sdma)
{}

static void prestera_sdma_tx_desc_init(struct prestera_sdma *sdma,
				       struct prestera_sdma_desc *desc)
{}

static void prestera_sdma_tx_desc_set_next(struct prestera_sdma *sdma,
					   struct prestera_sdma_desc *desc,
					   dma_addr_t next)
{}

static void prestera_sdma_tx_desc_set_buf(struct prestera_sdma *sdma,
					  struct prestera_sdma_desc *desc,
					  dma_addr_t buf, size_t len)
{}

static void prestera_sdma_tx_desc_xmit(struct prestera_sdma_desc *desc)
{}

static int prestera_sdma_tx_buf_map(struct prestera_sdma *sdma,
				    struct prestera_sdma_buf *buf,
				    struct sk_buff *skb)
{}

static void prestera_sdma_tx_buf_unmap(struct prestera_sdma *sdma,
				       struct prestera_sdma_buf *buf)
{}

static void prestera_sdma_tx_recycle_work_fn(struct work_struct *work)
{}

static int prestera_sdma_tx_init(struct prestera_sdma *sdma)
{}

static void prestera_sdma_tx_fini(struct prestera_sdma *sdma)
{}

static void prestera_rxtx_handle_event(struct prestera_switch *sw,
				       struct prestera_event *evt,
				       void *arg)
{}

static int prestera_sdma_switch_init(struct prestera_switch *sw)
{}

static void prestera_sdma_switch_fini(struct prestera_switch *sw)
{}

static bool prestera_sdma_is_ready(struct prestera_sdma *sdma)
{}

static int prestera_sdma_tx_wait(struct prestera_sdma *sdma,
				 struct prestera_tx_ring *tx_ring)
{}

static void prestera_sdma_tx_start(struct prestera_sdma *sdma)
{}

static netdev_tx_t prestera_sdma_xmit(struct prestera_sdma *sdma,
				      struct sk_buff *skb)
{}

int prestera_rxtx_switch_init(struct prestera_switch *sw)
{}

void prestera_rxtx_switch_fini(struct prestera_switch *sw)
{}

int prestera_rxtx_port_init(struct prestera_port *port)
{}

netdev_tx_t prestera_rxtx_xmit(struct prestera_port *port, struct sk_buff *skb)
{}