Merge tag 'wberr-v4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton...
[sfrench/cifs-2.6.git] / drivers / staging / ccree / ssi_fips.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_FIPS_H__
18 #define __SSI_FIPS_H__
19
20 #ifdef CONFIG_CRYPTO_FIPS
21
22 enum cc_fips_status {
23         CC_FIPS_SYNC_MODULE_OK = 0x0,
24         CC_FIPS_SYNC_MODULE_ERROR = 0x1,
25         CC_FIPS_SYNC_REE_STATUS = 0x4,
26         CC_FIPS_SYNC_TEE_STATUS = 0x8,
27         CC_FIPS_SYNC_STATUS_RESERVE32B = S32_MAX
28 };
29
30 int ssi_fips_init(struct ssi_drvdata *p_drvdata);
31 void ssi_fips_fini(struct ssi_drvdata *drvdata);
32 void fips_handler(struct ssi_drvdata *drvdata);
33 void cc_set_ree_fips_status(struct ssi_drvdata *drvdata, bool ok);
34
35 #else  /* CONFIG_CRYPTO_FIPS */
36
37 static inline int ssi_fips_init(struct ssi_drvdata *p_drvdata)
38 {
39         return 0;
40 }
41
42 static inline void ssi_fips_fini(struct ssi_drvdata *drvdata) {}
43 void cc_set_ree_fips_status(struct ssi_drvdata *drvdata, bool ok) {}
44 void fips_handler(struct ssi_drvdata *drvdata) {}
45
46 #endif /* CONFIG_CRYPTO_FIPS */
47
48 #endif  /*__SSI_FIPS_H__*/
49