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 /**************************************************************
18 * This file defines the driver FIPS functions that should be
19 * implemented by the driver user. Current implementation is sample code only.
20 ***************************************************************/
22 #include <linux/module.h>
23 #include "ssi_fips_local.h"
24 #include "ssi_driver.h"
27 static bool tee_error;
28 module_param(tee_error, bool, 0644);
29 MODULE_PARM_DESC(tee_error, "Simulate TEE library failure flag: 0 - no error (default), 1 - TEE error occured ");
31 static ssi_fips_state_t fips_state = CC_FIPS_STATE_NOT_SUPPORTED;
32 static ssi_fips_error_t fips_error = CC_REE_FIPS_ERROR_OK;
35 * This function returns the FIPS REE state.
36 * The function should be implemented by the driver user, depends on where
37 * the state value is stored.
38 * The reference code uses global variable.
40 int ssi_fips_ext_get_state(ssi_fips_state_t *p_state)
47 *p_state = fips_state;
53 * This function returns the FIPS REE error.
54 * The function should be implemented by the driver user, depends on where
55 * the error value is stored.
56 * The reference code uses global variable.
58 int ssi_fips_ext_get_error(ssi_fips_error_t *p_err)
71 * This function sets the FIPS REE state.
72 * The function should be implemented by the driver user, depends on where
73 * the state value is stored.
74 * The reference code uses global variable.
76 int ssi_fips_ext_set_state(ssi_fips_state_t state)
83 * This function sets the FIPS REE error.
84 * The function should be implemented by the driver user, depends on where
85 * the error value is stored.
86 * The reference code uses global variable.
88 int ssi_fips_ext_set_error(ssi_fips_error_t err)