#include <linux/align.h>
#include <linux/bitops.h>
#include <linux/dmapool.h>
#include <linux/dsa/ocelot.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include "ocelot_fdma.h"
#include "ocelot_qs.h"
DEFINE_STATIC_KEY_FALSE(ocelot_fdma_enabled);
static void ocelot_fdma_writel(struct ocelot *ocelot, u32 reg, u32 data)
{ … }
static u32 ocelot_fdma_readl(struct ocelot *ocelot, u32 reg)
{ … }
static dma_addr_t ocelot_fdma_idx_dma(dma_addr_t base, u16 idx)
{ … }
static u16 ocelot_fdma_dma_idx(dma_addr_t base, dma_addr_t dma)
{ … }
static u16 ocelot_fdma_idx_next(u16 idx, u16 ring_sz)
{ … }
static u16 ocelot_fdma_idx_prev(u16 idx, u16 ring_sz)
{ … }
static int ocelot_fdma_rx_ring_free(struct ocelot_fdma *fdma)
{ … }
static int ocelot_fdma_tx_ring_free(struct ocelot_fdma *fdma)
{ … }
static bool ocelot_fdma_tx_ring_empty(struct ocelot_fdma *fdma)
{ … }
static void ocelot_fdma_activate_chan(struct ocelot *ocelot, dma_addr_t dma,
int chan)
{ … }
static u32 ocelot_fdma_read_ch_safe(struct ocelot *ocelot)
{ … }
static int ocelot_fdma_wait_chan_safe(struct ocelot *ocelot, int chan)
{ … }
static void ocelot_fdma_dcb_set_data(struct ocelot_fdma_dcb *dcb,
dma_addr_t dma_addr,
size_t size)
{ … }
static bool ocelot_fdma_rx_alloc_page(struct ocelot *ocelot,
struct ocelot_fdma_rx_buf *rxb)
{ … }
static int ocelot_fdma_alloc_rx_buffs(struct ocelot *ocelot, u16 alloc_cnt)
{ … }
static bool ocelot_fdma_tx_dcb_set_skb(struct ocelot *ocelot,
struct ocelot_fdma_tx_buf *tx_buf,
struct ocelot_fdma_dcb *dcb,
struct sk_buff *skb)
{ … }
static bool ocelot_fdma_check_stop_rx(struct ocelot *ocelot)
{ … }
static void ocelot_fdma_rx_set_llp(struct ocelot_fdma_rx_ring *rx_ring)
{ … }
static void ocelot_fdma_rx_restart(struct ocelot *ocelot)
{ … }
static bool ocelot_fdma_add_rx_frag(struct ocelot_fdma_rx_buf *rxb, u32 stat,
struct sk_buff *skb, bool first)
{ … }
static void ocelot_fdma_reuse_rx_page(struct ocelot *ocelot,
struct ocelot_fdma_rx_buf *old_rxb)
{ … }
static struct sk_buff *ocelot_fdma_get_skb(struct ocelot *ocelot, u32 stat,
struct ocelot_fdma_rx_buf *rxb,
struct sk_buff *skb)
{ … }
static bool ocelot_fdma_receive_skb(struct ocelot *ocelot, struct sk_buff *skb)
{ … }
static int ocelot_fdma_rx_get(struct ocelot *ocelot, int budget)
{ … }
static void ocelot_fdma_wakeup_netdev(struct ocelot *ocelot)
{ … }
static void ocelot_fdma_tx_cleanup(struct ocelot *ocelot, int budget)
{ … }
static int ocelot_fdma_napi_poll(struct napi_struct *napi, int budget)
{ … }
static irqreturn_t ocelot_fdma_interrupt(int irq, void *dev_id)
{ … }
static void ocelot_fdma_send_skb(struct ocelot *ocelot,
struct ocelot_fdma *fdma, struct sk_buff *skb)
{ … }
static int ocelot_fdma_prepare_skb(struct ocelot *ocelot, int port, u32 rew_op,
struct sk_buff *skb, struct net_device *dev)
{ … }
int ocelot_fdma_inject_frame(struct ocelot *ocelot, int port, u32 rew_op,
struct sk_buff *skb, struct net_device *dev)
{ … }
static void ocelot_fdma_free_rx_ring(struct ocelot *ocelot)
{ … }
static void ocelot_fdma_free_tx_ring(struct ocelot *ocelot)
{ … }
static int ocelot_fdma_rings_alloc(struct ocelot *ocelot)
{ … }
void ocelot_fdma_netdev_init(struct ocelot *ocelot, struct net_device *dev)
{ … }
void ocelot_fdma_netdev_deinit(struct ocelot *ocelot, struct net_device *dev)
{ … }
void ocelot_fdma_init(struct platform_device *pdev, struct ocelot *ocelot)
{ … }
void ocelot_fdma_start(struct ocelot *ocelot)
{ … }
void ocelot_fdma_deinit(struct ocelot *ocelot)
{ … }