zkey: Add utility function to get the serial number of a crypto card

With recent changes in the zcrypt device driver, the serial number of
a crypto card can be obtained by reading the sysfs attribute 'serialnr'
of a crypto card device of type CCA-Coprocessor. The sysfs attribute
can be found under '/sys/devices/ap/cardnn/', where nn specifies the
card number in hex.

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-06-13 10:28:11 +02:00
committed by Jan Höppner
parent 696e8458f0
commit a84d1c5d58
2 changed files with 54 additions and 0 deletions
+2
View File
@@ -18,4 +18,6 @@ int sysfs_is_card_online(int card);
int sysfs_is_apqn_online(int card, int domain);
int sysfs_get_serialnr(int card, char serialnr[9], bool verbose);
#endif