Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * OMAP Crypto driver common support routines.
0004  *
0005  * Copyright (c) 2017 Texas Instruments Incorporated
0006  *   Tero Kristo <t-kristo@ti.com>
0007  */
0008 
0009 #ifndef __CRYPTO_OMAP_CRYPTO_H
0010 #define __CRYPTO_OMAP_CRYPTO_H
0011 
0012 enum {
0013     OMAP_CRYPTO_NOT_ALIGNED = 1,
0014     OMAP_CRYPTO_BAD_DATA_LENGTH,
0015 };
0016 
0017 #define OMAP_CRYPTO_DATA_COPIED     BIT(0)
0018 #define OMAP_CRYPTO_SG_COPIED       BIT(1)
0019 
0020 #define OMAP_CRYPTO_COPY_MASK       0x3
0021 
0022 #define OMAP_CRYPTO_COPY_DATA       BIT(0)
0023 #define OMAP_CRYPTO_FORCE_COPY      BIT(1)
0024 #define OMAP_CRYPTO_ZERO_BUF        BIT(2)
0025 #define OMAP_CRYPTO_FORCE_SINGLE_ENTRY  BIT(3)
0026 
0027 int omap_crypto_align_sg(struct scatterlist **sg, int total, int bs,
0028              struct scatterlist *new_sg, u16 flags,
0029              u8 flags_shift, unsigned long *dd_flags);
0030 void omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig,
0031              int offset, int len, u8 flags_shift,
0032              unsigned long flags);
0033 
0034 #endif