| 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
| 2 | #ifndef _PAPR_HVPIPE_H_ |
| 3 | #define _PAPR_HVPIPE_H_ |
| 4 | |
| 5 | #include <linux/types.h> |
| 6 | #include <asm/ioctl.h> |
| 7 | #include <asm/papr-miscdev.h> |
| 8 | |
| 9 | /* |
| 10 | * This header is included in payload between OS and the user |
| 11 | * space. |
| 12 | * flags: OS notifies the user space whether the hvpipe is |
| 13 | * closed or the buffer has the payload. |
| 14 | */ |
| 15 | struct papr_hvpipe_hdr { |
| 16 | 	__u8 version; |
| 17 | 	__u8 reserved[3]; |
| 18 | 	__u32 flags; |
| 19 | 	__u8 reserved2[40]; |
| 20 | }; |
| 21 | |
| 22 | /* |
| 23 | * ioctl for /dev/papr-hvpipe |
| 24 | */ |
| 25 | #define PAPR_HVPIPE_IOC_CREATE_HANDLE	_IOW(PAPR_MISCDEV_IOC_ID, 9, __u32) |
| 26 | |
| 27 | /* |
| 28 | * hvpipe_hdr flags used for read() |
| 29 | */ |
| 30 | #define HVPIPE_MSG_AVAILABLE	0x01 /* Payload is available */ |
| 31 | #define HVPIPE_LOST_CONNECTION	0x02 /* Pipe connection is closed/unavailable */ |
| 32 | |
| 33 | #endif /* _PAPR_HVPIPE_H_ */ |