1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright IBM Corp. 2019
4 * Author(s): Harald Freudenberger <freude@linux.ibm.com>
6 * Collection of EP11 misc functions used by zcrypt and pkey
9 #ifndef _ZCRYPT_EP11MISC_H_
10 #define _ZCRYPT_EP11MISC_H_
12 #include <asm/zcrypt.h>
15 /* EP11 card info struct */
16 struct ep11_card_info {
17 u32 API_ord_nr; /* API ordinal number */
18 u16 FW_version; /* Firmware major and minor version */
19 char serial[16]; /* serial number string (16 ascii, no 0x00 !) */
20 u64 op_mode; /* card operational mode(s) */
23 /* EP11 domain info struct */
24 struct ep11_domain_info {
25 char cur_wk_state; /* '0' invalid, '1' valid */
26 char new_wk_state; /* '0' empty, '1' uncommitted, '2' committed */
27 u8 cur_wkvp[32]; /* current wrapping key verification pattern */
28 u8 new_wkvp[32]; /* new wrapping key verification pattern */
29 u64 op_mode; /* domain operational mode(s) */
33 * Provide information about an EP11 card.
35 int ep11_get_card_info(u16 card, struct ep11_card_info *info, int verify);
38 * Provide information about a domain within an EP11 card.
40 int ep11_get_domain_info(u16 card, u16 domain, struct ep11_domain_info *info);
42 void zcrypt_ep11misc_exit(void);
44 #endif /* _ZCRYPT_EP11MISC_H_ */