#include <crypto/engine.h>
#include <crypto/hmac.h>
#include <crypto/internal/hash.h>
#include <crypto/scatterwalk.h>
#include <crypto/sha2.h>
#include <crypto/sm3.h>
#include <linux/completion.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/string.h>
#include "ocs-hcu.h"
#define DRV_NAME …
#define REQ_FINAL …
#define REQ_FLAGS_HMAC …
#define REQ_FLAGS_HMAC_HW …
#define REQ_FLAGS_HMAC_SW …
struct ocs_hcu_ctx { … };
struct ocs_hcu_rctx { … };
struct ocs_hcu_drv { … };
static struct ocs_hcu_drv ocs_hcu = …;
static inline unsigned int kmb_get_total_data(struct ocs_hcu_rctx *rctx)
{ … }
static int flush_sg_to_ocs_buffer(struct ocs_hcu_rctx *rctx)
{ … }
static struct ocs_hcu_dev *kmb_ocs_hcu_find_dev(struct ahash_request *req)
{ … }
static void kmb_ocs_hcu_dma_cleanup(struct ahash_request *req,
struct ocs_hcu_rctx *rctx)
{ … }
static int kmb_ocs_dma_prepare(struct ahash_request *req)
{ … }
static void kmb_ocs_hcu_secure_cleanup(struct ahash_request *req)
{ … }
static int kmb_ocs_hcu_handle_queue(struct ahash_request *req)
{ … }
static int prepare_ipad(struct ahash_request *req)
{ … }
static int kmb_ocs_hcu_do_one_request(struct crypto_engine *engine, void *areq)
{ … }
static int kmb_ocs_hcu_init(struct ahash_request *req)
{ … }
static int kmb_ocs_hcu_update(struct ahash_request *req)
{ … }
static int kmb_ocs_hcu_fin_common(struct ahash_request *req)
{ … }
static int kmb_ocs_hcu_final(struct ahash_request *req)
{ … }
static int kmb_ocs_hcu_finup(struct ahash_request *req)
{ … }
static int kmb_ocs_hcu_digest(struct ahash_request *req)
{ … }
static int kmb_ocs_hcu_export(struct ahash_request *req, void *out)
{ … }
static int kmb_ocs_hcu_import(struct ahash_request *req, const void *in)
{ … }
static int kmb_ocs_hcu_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{ … }
static void __cra_init(struct crypto_tfm *tfm, struct ocs_hcu_ctx *ctx)
{ … }
static int kmb_ocs_hcu_sha_cra_init(struct crypto_tfm *tfm)
{ … }
static int kmb_ocs_hcu_sm3_cra_init(struct crypto_tfm *tfm)
{ … }
static int kmb_ocs_hcu_hmac_sm3_cra_init(struct crypto_tfm *tfm)
{ … }
static int kmb_ocs_hcu_hmac_cra_init(struct crypto_tfm *tfm)
{ … }
static void kmb_ocs_hcu_hmac_cra_exit(struct crypto_tfm *tfm)
{ … }
static struct ahash_engine_alg ocs_hcu_algs[] = …;
static const struct of_device_id kmb_ocs_hcu_of_match[] = …;
MODULE_DEVICE_TABLE(of, kmb_ocs_hcu_of_match);
static void kmb_ocs_hcu_remove(struct platform_device *pdev)
{ … }
static int kmb_ocs_hcu_probe(struct platform_device *pdev)
{ … }
static struct platform_driver kmb_ocs_hcu_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;