]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/staging/ccree/ssi_fips_local.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_FIPS_LOCAL_H__
18 #define __SSI_FIPS_LOCAL_H__
20 #ifdef CONFIG_CCX7REE_FIPS_SUPPORT
25 #define CHECK_AND_RETURN_UPON_FIPS_ERROR() {\
26 if (ssi_fips_check_fips_error() != 0) {\
31 #define CHECK_AND_RETURN_VOID_UPON_FIPS_ERROR() {\
32 if (ssi_fips_check_fips_error() != 0) {\
37 #define SSI_FIPS_INIT(p_drvData) (ssi_fips_init(p_drvData))
38 #define SSI_FIPS_FINI(p_drvData) (ssi_fips_fini(p_drvData))
40 #define FIPS_LOG(...) SSI_LOG(KERN_INFO, __VA_ARGS__)
41 #define FIPS_DBG(...) //SSI_LOG(KERN_INFO, __VA_ARGS__)
44 int ssi_fips_init(struct ssi_drvdata
*p_drvdata
);
45 void ssi_fips_fini(struct ssi_drvdata
*drvdata
);
46 int ssi_fips_check_fips_error(void);
47 int ssi_fips_set_error(struct ssi_drvdata
*p_drvdata
, enum cc_fips_error err
);
48 void fips_handler(struct ssi_drvdata
*drvdata
);
50 #else /* CONFIG_CC7XXREE_FIPS_SUPPORT */
52 #define CHECK_AND_RETURN_UPON_FIPS_ERROR()
53 #define CHECK_AND_RETURN_VOID_UPON_FIPS_ERROR()
55 static inline int ssi_fips_init(struct ssi_drvdata
*p_drvdata
)
60 static inline void ssi_fips_fini(struct ssi_drvdata
*drvdata
) {}
62 void fips_handler(struct ssi_drvdata
*drvdata
);
64 #endif /* CONFIG_CC7XXREE_FIPS_SUPPORT */
66 #endif /*__SSI_FIPS_LOCAL_H__*/