]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/staging/ccree/ssi_ivgen.h
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / drivers / staging / ccree / ssi_ivgen.h
1 /*
2  * Copyright (C) 2012-2017 ARM Limited or its affiliates.
3  * 
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.
7  * 
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.
12  * 
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/>.
15  */
16
17 #ifndef __SSI_IVGEN_H__
18 #define __SSI_IVGEN_H__
19
20 #include "cc_hw_queue_defs.h"
21
22
23 #define SSI_IVPOOL_SEQ_LEN 8
24
25 /*!
26  * Allocates iv-pool and maps resources. 
27  * This function generates the first IV pool.  
28  * 
29  * \param drvdata Driver's private context
30  * 
31  * \return int Zero for success, negative value otherwise.
32  */
33 int ssi_ivgen_init(struct ssi_drvdata *drvdata);
34
35 /*!
36  * Free iv-pool and ivgen context.
37  *  
38  * \param drvdata 
39  */
40 void ssi_ivgen_fini(struct ssi_drvdata *drvdata);
41
42 /*!
43  * Generates the initial pool in SRAM. 
44  * This function should be invoked when resuming DX driver. 
45  * 
46  * \param drvdata 
47  *  
48  * \return int Zero for success, negative value otherwise.
49  */
50 int ssi_ivgen_init_sram_pool(struct ssi_drvdata *drvdata);
51
52 /*!
53  * Acquires 16 Bytes IV from the iv-pool
54  * 
55  * \param drvdata Driver private context
56  * \param iv_out_dma Array of physical IV out addresses
57  * \param iv_out_dma_len Length of iv_out_dma array (additional elements of iv_out_dma array are ignore)
58  * \param iv_out_size May be 8 or 16 bytes long 
59  * \param iv_seq IN/OUT array to the descriptors sequence
60  * \param iv_seq_len IN/OUT pointer to the sequence length 
61  *  
62  * \return int Zero for success, negative value otherwise. 
63  */
64 int ssi_ivgen_getiv(
65         struct ssi_drvdata *drvdata,
66         dma_addr_t iv_out_dma[],
67         unsigned int iv_out_dma_len,
68         unsigned int iv_out_size,
69         HwDesc_s iv_seq[],
70         unsigned int *iv_seq_len);
71
72 #endif /*__SSI_IVGEN_H__*/