Files
s390-tools/zkey/utils.h
Ingo Franzki a84d1c5d58 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>
2019-09-18 12:55:17 +02:00

24 lines
528 B
C

/*
* zkey - Generate, re-encipher, and validate secure keys
*
* This header file defines the interface to the CCA host library.
*
* Copyright IBM Corp. 2019
*
* s390-tools is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/
#ifndef UTILS_H
#define UTILS_H
#include "lib/zt_common.h"
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