linux/drivers/rapidio/devices/tsi721_dma.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * DMA Engine support for Tsi721 PCIExpress-to-SRIO bridge
 *
 * Copyright (c) 2011-2014 Integrated Device Technology, Inc.
 * Alexandre Bounine <[email protected]>
 */

#include <linux/io.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/rio.h>
#include <linux/rio_drv.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/kfifo.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include "../../dma/dmaengine.h"

#include "tsi721.h"

#ifdef CONFIG_PCI_MSI
static irqreturn_t tsi721_bdma_msix(int irq, void *ptr);
#endif
static int tsi721_submit_sg(struct tsi721_tx_desc *desc);

static unsigned int dma_desc_per_channel =;
module_param(dma_desc_per_channel, uint, S_IRUGO);
MODULE_PARM_DESC();

static unsigned int dma_txqueue_sz =;
module_param(dma_txqueue_sz, uint, S_IRUGO);
MODULE_PARM_DESC();

static u8 dma_sel =;
module_param(dma_sel, byte, S_IRUGO);
MODULE_PARM_DESC();

static inline struct tsi721_bdma_chan *to_tsi721_chan(struct dma_chan *chan)
{}

static inline struct tsi721_device *to_tsi721(struct dma_device *ddev)
{}

static inline
struct tsi721_tx_desc *to_tsi721_desc(struct dma_async_tx_descriptor *txd)
{}

static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
{}

static int tsi721_bdma_ch_free(struct tsi721_bdma_chan *bdma_chan)
{}

static void
tsi721_bdma_interrupt_enable(struct tsi721_bdma_chan *bdma_chan, int enable)
{}

static bool tsi721_dma_is_idle(struct tsi721_bdma_chan *bdma_chan)
{}

void tsi721_bdma_handler(struct tsi721_bdma_chan *bdma_chan)
{}

#ifdef CONFIG_PCI_MSI
/**
 * tsi721_bdma_msix - MSI-X interrupt handler for BDMA channels
 * @irq: Linux interrupt number
 * @ptr: Pointer to interrupt-specific data (BDMA channel structure)
 *
 * Handles BDMA channel interrupts signaled using MSI-X.
 *
 * Returns: %IRQ_HANDLED
 */
static irqreturn_t tsi721_bdma_msix(int irq, void *ptr)
{}
#endif /* CONFIG_PCI_MSI */

/* Must be called with the spinlock held */
static void tsi721_start_dma(struct tsi721_bdma_chan *bdma_chan)
{}

static int
tsi721_desc_fill_init(struct tsi721_tx_desc *desc,
		      struct tsi721_dma_desc *bd_ptr,
		      struct scatterlist *sg, u32 sys_size)
{}

static int
tsi721_desc_fill_end(struct tsi721_dma_desc *bd_ptr, u32 bcount, bool interrupt)
{}

static void tsi721_dma_tx_err(struct tsi721_bdma_chan *bdma_chan,
			      struct tsi721_tx_desc *desc)
{}

static void tsi721_clr_stat(struct tsi721_bdma_chan *bdma_chan)
{}

/* Must be called with the channel spinlock held */
static int tsi721_submit_sg(struct tsi721_tx_desc *desc)
{}

static void tsi721_advance_work(struct tsi721_bdma_chan *bdma_chan,
				struct tsi721_tx_desc *desc)
{}

static void tsi721_dma_tasklet(unsigned long data)
{}

static dma_cookie_t tsi721_tx_submit(struct dma_async_tx_descriptor *txd)
{}

static int tsi721_alloc_chan_resources(struct dma_chan *dchan)
{}

static void tsi721_sync_dma_irq(struct tsi721_bdma_chan *bdma_chan)
{}

static void tsi721_free_chan_resources(struct dma_chan *dchan)
{}

static
enum dma_status tsi721_tx_status(struct dma_chan *dchan, dma_cookie_t cookie,
				 struct dma_tx_state *txstate)
{}

static void tsi721_issue_pending(struct dma_chan *dchan)
{}

static
struct dma_async_tx_descriptor *tsi721_prep_rio_sg(struct dma_chan *dchan,
			struct scatterlist *sgl, unsigned int sg_len,
			enum dma_transfer_direction dir, unsigned long flags,
			void *tinfo)
{}

static int tsi721_terminate_all(struct dma_chan *dchan)
{}

static void tsi721_dma_stop(struct tsi721_bdma_chan *bdma_chan)
{}

void tsi721_dma_stop_all(struct tsi721_device *priv)
{}

int tsi721_register_dma(struct tsi721_device *priv)
{}

void tsi721_unregister_dma(struct tsi721_device *priv)
{}