zkey: Add support for reading the firmware version sysfs attribute

EP11 cards provide the firmware version and API ordinal number as
a sysfs attribute on the crypto card level. Add a helper function
that obtains the firmware version and API ordinal number from there.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2019-11-19 14:39:26 +01:00
committed by Jan Höppner
parent 82c86fa8bd
commit 2ca442feed
2 changed files with 76 additions and 0 deletions
+9
View File
@@ -26,6 +26,15 @@ enum card_type sysfs_get_card_type(int card);
int sysfs_get_serialnr(int card, char serialnr[9], bool verbose);
struct fw_version {
unsigned int major;
unsigned int minor;
unsigned int api_ordinal;
};
int sysfs_get_firmware_version(int card, struct fw_version *fw_version,
bool verbose);
#define MK_STATE_EMPTY 0
#define MK_STATE_PARTIAL 1
#define MK_STATE_FULL 2