]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/staging/ccree/ssi_ivgen.h
2 * Copyright (C) 2012-2017 ARM Limited or its affiliates.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 #ifndef __SSI_IVGEN_H__
18 #define __SSI_IVGEN_H__
20 #include "cc_hw_queue_defs.h"
22 #define SSI_IVPOOL_SEQ_LEN 8
25 * Allocates iv-pool and maps resources.
26 * This function generates the first IV pool.
28 * \param drvdata Driver's private context
30 * \return int Zero for success, negative value otherwise.
32 int ssi_ivgen_init(struct ssi_drvdata
*drvdata
);
35 * Free iv-pool and ivgen context.
39 void ssi_ivgen_fini(struct ssi_drvdata
*drvdata
);
42 * Generates the initial pool in SRAM.
43 * This function should be invoked when resuming DX driver.
47 * \return int Zero for success, negative value otherwise.
49 int ssi_ivgen_init_sram_pool(struct ssi_drvdata
*drvdata
);
52 * Acquires 16 Bytes IV from the iv-pool
54 * \param drvdata Driver private context
55 * \param iv_out_dma Array of physical IV out addresses
56 * \param iv_out_dma_len Length of iv_out_dma array (additional elements of iv_out_dma array are ignore)
57 * \param iv_out_size May be 8 or 16 bytes long
58 * \param iv_seq IN/OUT array to the descriptors sequence
59 * \param iv_seq_len IN/OUT pointer to the sequence length
61 * \return int Zero for success, negative value otherwise.
64 struct ssi_drvdata
*drvdata
,
65 dma_addr_t iv_out_dma
[],
66 unsigned int iv_out_dma_len
,
67 unsigned int iv_out_size
,
68 struct cc_hw_desc iv_seq
[],
69 unsigned int *iv_seq_len
);
71 #endif /*__SSI_IVGEN_H__*/