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

// SPDX-License-Identifier: GPL-2.0-only
/*
 * AMD Cryptographic Coprocessor (CCP) crypto API support
 *
 * Copyright (C) 2013,2017 Advanced Micro Devices, Inc.
 *
 * Author: Tom Lendacky <[email protected]>
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/ccp.h>
#include <linux/scatterlist.h>
#include <crypto/internal/hash.h>
#include <crypto/internal/akcipher.h>

#include "ccp-crypto.h"

MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_VERSION();
MODULE_DESCRIPTION();

static unsigned int aes_disable;
module_param(aes_disable, uint, 0444);
MODULE_PARM_DESC();

static unsigned int sha_disable;
module_param(sha_disable, uint, 0444);
MODULE_PARM_DESC();

static unsigned int des3_disable;
module_param(des3_disable, uint, 0444);
MODULE_PARM_DESC();

static unsigned int rsa_disable;
module_param(rsa_disable, uint, 0444);
MODULE_PARM_DESC();

/* List heads for the supported algorithms */
static LIST_HEAD(hash_algs);
static LIST_HEAD(skcipher_algs);
static LIST_HEAD(aead_algs);
static LIST_HEAD(akcipher_algs);

/* For any tfm, requests for that tfm must be returned on the order
 * received.  With multiple queues available, the CCP can process more
 * than one cmd at a time.  Therefore we must maintain a cmd list to insure
 * the proper ordering of requests on a given tfm.
 */
struct ccp_crypto_queue {};

#define CCP_CRYPTO_MAX_QLEN

static struct ccp_crypto_queue req_queue;
static DEFINE_SPINLOCK(req_queue_lock);

struct ccp_crypto_cmd {};

static inline bool ccp_crypto_success(int err)
{}

static struct ccp_crypto_cmd *ccp_crypto_cmd_complete(
	struct ccp_crypto_cmd *crypto_cmd, struct ccp_crypto_cmd **backlog)
{}

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

static int ccp_crypto_enqueue_cmd(struct ccp_crypto_cmd *crypto_cmd)
{}

/**
 * ccp_crypto_enqueue_request - queue an crypto async request for processing
 *				by the CCP
 *
 * @req: crypto_async_request struct to be processed
 * @cmd: ccp_cmd struct to be sent to the CCP
 */
int ccp_crypto_enqueue_request(struct crypto_async_request *req,
			       struct ccp_cmd *cmd)
{}

struct scatterlist *ccp_crypto_sg_table_add(struct sg_table *table,
					    struct scatterlist *sg_add)
{}

static int ccp_register_algs(void)
{}

static void ccp_unregister_algs(void)
{}

static int __init ccp_crypto_init(void)
{}

static void __exit ccp_crypto_exit(void)
{}

module_init();
module_exit(ccp_crypto_exit);