#include <linux/list.h>
#include "altera_utils.h"
#include "altera_tse.h"
#include "altera_sgdmahw.h"
#include "altera_sgdma.h"
static void sgdma_setup_descrip(struct sgdma_descrip __iomem *desc,
struct sgdma_descrip __iomem *ndesc,
dma_addr_t ndesc_phys,
dma_addr_t raddr,
dma_addr_t waddr,
u16 length,
int generate_eop,
int rfixed,
int wfixed);
static int sgdma_async_write(struct altera_tse_private *priv,
struct sgdma_descrip __iomem *desc);
static int sgdma_async_read(struct altera_tse_private *priv);
static dma_addr_t
sgdma_txphysaddr(struct altera_tse_private *priv,
struct sgdma_descrip __iomem *desc);
static dma_addr_t
sgdma_rxphysaddr(struct altera_tse_private *priv,
struct sgdma_descrip __iomem *desc);
static int sgdma_txbusy(struct altera_tse_private *priv);
static int sgdma_rxbusy(struct altera_tse_private *priv);
static void
queue_tx(struct altera_tse_private *priv, struct tse_buffer *buffer);
static void
queue_rx(struct altera_tse_private *priv, struct tse_buffer *buffer);
static struct tse_buffer *
dequeue_tx(struct altera_tse_private *priv);
static struct tse_buffer *
dequeue_rx(struct altera_tse_private *priv);
static struct tse_buffer *
queue_rx_peekhead(struct altera_tse_private *priv);
int sgdma_initialize(struct altera_tse_private *priv)
{ … }
void sgdma_uninitialize(struct altera_tse_private *priv)
{ … }
void sgdma_reset(struct altera_tse_private *priv)
{ … }
void sgdma_enable_rxirq(struct altera_tse_private *priv)
{ … }
void sgdma_enable_txirq(struct altera_tse_private *priv)
{ … }
void sgdma_disable_rxirq(struct altera_tse_private *priv)
{ … }
void sgdma_disable_txirq(struct altera_tse_private *priv)
{ … }
void sgdma_clear_rxirq(struct altera_tse_private *priv)
{ … }
void sgdma_clear_txirq(struct altera_tse_private *priv)
{ … }
int sgdma_tx_buffer(struct altera_tse_private *priv, struct tse_buffer *buffer)
{ … }
u32 sgdma_tx_completions(struct altera_tse_private *priv)
{ … }
void sgdma_start_rxdma(struct altera_tse_private *priv)
{ … }
void sgdma_add_rx_desc(struct altera_tse_private *priv,
struct tse_buffer *rxbuffer)
{ … }
u32 sgdma_rx_status(struct altera_tse_private *priv)
{ … }
static void sgdma_setup_descrip(struct sgdma_descrip __iomem *desc,
struct sgdma_descrip __iomem *ndesc,
dma_addr_t ndesc_phys,
dma_addr_t raddr,
dma_addr_t waddr,
u16 length,
int generate_eop,
int rfixed,
int wfixed)
{ … }
static int sgdma_async_read(struct altera_tse_private *priv)
{ … }
static int sgdma_async_write(struct altera_tse_private *priv,
struct sgdma_descrip __iomem *desc)
{ … }
static dma_addr_t
sgdma_txphysaddr(struct altera_tse_private *priv,
struct sgdma_descrip __iomem *desc)
{ … }
static dma_addr_t
sgdma_rxphysaddr(struct altera_tse_private *priv,
struct sgdma_descrip __iomem *desc)
{ … }
#define list_remove_head(list, entry, type, member) …
#define list_peek_head(list, entry, type, member) …
static void
queue_tx(struct altera_tse_private *priv, struct tse_buffer *buffer)
{ … }
static void
queue_rx(struct altera_tse_private *priv, struct tse_buffer *buffer)
{ … }
static struct tse_buffer *
dequeue_tx(struct altera_tse_private *priv)
{ … }
static struct tse_buffer *
dequeue_rx(struct altera_tse_private *priv)
{ … }
static struct tse_buffer *
queue_rx_peekhead(struct altera_tse_private *priv)
{ … }
static int sgdma_rxbusy(struct altera_tse_private *priv)
{ … }
static int sgdma_txbusy(struct altera_tse_private *priv)
{ … }