]>
Commit | Line | Data |
---|---|---|
16609980 GBY |
1 | /* |
2 | * Copyright (C) 2012-2017 ARM Limited or its affiliates. | |
c8f17865 | 3 | * |
16609980 GBY |
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. | |
c8f17865 | 7 | * |
16609980 GBY |
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. | |
c8f17865 | 12 | * |
16609980 GBY |
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 | ||
16609980 | 17 | /************************************************************** |
3a82eb63 DR |
18 | * This file defines the driver FIPS APIs * |
19 | **************************************************************/ | |
16609980 GBY |
20 | |
21 | #include <linux/module.h> | |
22 | #include "ssi_fips.h" | |
23 | ||
dff5e61e | 24 | extern int ssi_fips_ext_get_state(enum cc_fips_state_t *p_state); |
8422f112 | 25 | extern int ssi_fips_ext_get_error(enum cc_fips_error *p_err); |
16609980 GBY |
26 | |
27 | /* | |
3a82eb63 DR |
28 | * This function returns the REE FIPS state. |
29 | * It should be called by kernel module. | |
30 | */ | |
dff5e61e | 31 | int ssi_fips_get_state(enum cc_fips_state_t *p_state) |
16609980 | 32 | { |
ad645be8 | 33 | int rc = 0; |
16609980 | 34 | |
6191eb1d | 35 | if (!p_state) |
16609980 | 36 | return -EINVAL; |
16609980 GBY |
37 | |
38 | rc = ssi_fips_ext_get_state(p_state); | |
39 | ||
40 | return rc; | |
41 | } | |
42 | ||
43 | EXPORT_SYMBOL(ssi_fips_get_state); | |
44 | ||
45 | /* | |
3a82eb63 DR |
46 | * This function returns the REE FIPS error. |
47 | * It should be called by kernel module. | |
48 | */ | |
8422f112 | 49 | int ssi_fips_get_error(enum cc_fips_error *p_err) |
16609980 | 50 | { |
ad645be8 | 51 | int rc = 0; |
16609980 | 52 | |
6191eb1d | 53 | if (!p_err) |
16609980 | 54 | return -EINVAL; |
16609980 GBY |
55 | |
56 | rc = ssi_fips_ext_get_error(p_err); | |
57 | ||
58 | return rc; | |
59 | } | |
60 | ||
61 | EXPORT_SYMBOL(ssi_fips_get_error); |