linux/drivers/crypto/ccp/ccp-dmaengine.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * AMD Cryptographic Coprocessor (CCP) driver
 *
 * Copyright (C) 2016,2019 Advanced Micro Devices, Inc.
 *
 * Author: Gary R Hook <[email protected]>
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/ccp.h>

#include "ccp-dev.h"
#include "../../dma/dmaengine.h"

#define CCP_DMA_WIDTH(_mask)

/* The CCP as a DMA provider can be configured for public or private
 * channels. Default is specified in the vdata for the device (PCI ID).
 * This module parameter will override for all channels on all devices:
 *   dma_chan_attr = 0x2 to force all channels public
 *                 = 0x1 to force all channels private
 *                 = 0x0 to defer to the vdata setting
 *                 = any other value: warning, revert to 0x0
 */
static unsigned int dma_chan_attr =;
module_param(dma_chan_attr, uint, 0444);
MODULE_PARM_DESC();

static unsigned int dmaengine =;
module_param(dmaengine, uint, 0444);
MODULE_PARM_DESC();

static unsigned int ccp_get_dma_chan_attr(struct ccp_device *ccp)
{}

static void ccp_free_cmd_resources(struct ccp_device *ccp,
				   struct list_head *list)
{}

static void ccp_free_desc_resources(struct ccp_device *ccp,
				    struct list_head *list)
{}

static void ccp_free_chan_resources(struct dma_chan *dma_chan)
{}

static void ccp_cleanup_desc_resources(struct ccp_device *ccp,
				       struct list_head *list)
{}

static void ccp_do_cleanup(unsigned long data)
{}

static int ccp_issue_next_cmd(struct ccp_dma_desc *desc)
{}

static void ccp_free_active_cmd(struct ccp_dma_desc *desc)
{}

static struct ccp_dma_desc *__ccp_next_dma_desc(struct ccp_dma_chan *chan,
						struct ccp_dma_desc *desc)
{}

static struct ccp_dma_desc *ccp_handle_active_desc(struct ccp_dma_chan *chan,
						   struct ccp_dma_desc *desc)
{}

static struct ccp_dma_desc *__ccp_pending_to_active(struct ccp_dma_chan *chan)
{}

static void ccp_cmd_callback(void *data, int err)
{}

static dma_cookie_t ccp_tx_submit(struct dma_async_tx_descriptor *tx_desc)
{}

static struct ccp_dma_cmd *ccp_alloc_dma_cmd(struct ccp_dma_chan *chan)
{}

static struct ccp_dma_desc *ccp_alloc_dma_desc(struct ccp_dma_chan *chan,
					       unsigned long flags)
{}

static struct ccp_dma_desc *ccp_create_desc(struct dma_chan *dma_chan,
					    struct scatterlist *dst_sg,
					    unsigned int dst_nents,
					    struct scatterlist *src_sg,
					    unsigned int src_nents,
					    unsigned long flags)
{}

static struct dma_async_tx_descriptor *ccp_prep_dma_memcpy(
	struct dma_chan *dma_chan, dma_addr_t dst, dma_addr_t src, size_t len,
	unsigned long flags)
{}

static struct dma_async_tx_descriptor *ccp_prep_dma_interrupt(
	struct dma_chan *dma_chan, unsigned long flags)
{}

static void ccp_issue_pending(struct dma_chan *dma_chan)
{}

static enum dma_status ccp_tx_status(struct dma_chan *dma_chan,
				     dma_cookie_t cookie,
				     struct dma_tx_state *state)
{}

static int ccp_pause(struct dma_chan *dma_chan)
{}

static int ccp_resume(struct dma_chan *dma_chan)
{}

static int ccp_terminate_all(struct dma_chan *dma_chan)
{}

static void ccp_dma_release(struct ccp_device *ccp)
{}

static void ccp_dma_release_channels(struct ccp_device *ccp)
{}

int ccp_dmaengine_register(struct ccp_device *ccp)
{}

void ccp_dmaengine_unregister(struct ccp_device *ccp)
{}