| 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
| 2 | #ifndef _PAPR_PHYSICAL_ATTESTATION_H_ |
| 3 | #define _PAPR_PHYSICAL_ATTESTATION_H_ |
| 4 | |
| 5 | #include <linux/types.h> |
| 6 | #include <asm/ioctl.h> |
| 7 | #include <asm/papr-miscdev.h> |
| 8 | |
| 9 | #define PAPR_PHYATTEST_MAX_INPUT 4084 /* Max 4K buffer: 4K-12 */ |
| 10 | |
| 11 | /* |
| 12 | * Defined in PAPR 2.13+ 21.6 Attestation Command Structures. |
| 13 | * User space pass this struct and the max size should be 4K. |
| 14 | */ |
| 15 | struct papr_phy_attest_io_block { |
| 16 | 	__u8 version; |
| 17 | 	__u8 command; |
| 18 | 	__u8 TCG_major_ver; |
| 19 | 	__u8 TCG_minor_ver; |
| 20 | 	__be32 length; |
| 21 | 	__be32 correlator; |
| 22 | 	__u8 payload[PAPR_PHYATTEST_MAX_INPUT]; |
| 23 | }; |
| 24 | |
| 25 | /* |
| 26 | * ioctl for /dev/papr-physical-attestation. Returns a attestation |
| 27 | * command fd handle |
| 28 | */ |
| 29 | #define PAPR_PHY_ATTEST_IOC_HANDLE _IOW(PAPR_MISCDEV_IOC_ID, 8, struct papr_phy_attest_io_block) |
| 30 | |
| 31 | #endif /* _PAPR_PHYSICAL_ATTESTATION_H_ */ |