Carl van Schaik | 6d7b2ff | 2018-07-06 22:00:55 +1000 | [diff] [blame] | 1 | /* |
| 2 | * vservices/ioctl.h - Interface to service character devices |
| 3 | * |
| 4 | * Copyright (c) 2016, Cog Systems Pty Ltd |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | */ |
| 10 | |
| 11 | #ifndef __LINUX_PUBLIC_VSERVICES_IOCTL_H__ |
| 12 | #define __LINUX_PUBLIC_VSERVICES_IOCTL_H__ |
| 13 | |
| 14 | #include <linux/types.h> |
| 15 | #include <linux/compiler.h> |
| 16 | |
| 17 | /* ioctls that work on any opened service device */ |
| 18 | #define IOCTL_VS_RESET_SERVICE _IO('4', 0) |
| 19 | #define IOCTL_VS_GET_NAME _IOR('4', 1, char[16]) |
| 20 | #define IOCTL_VS_GET_PROTOCOL _IOR('4', 2, char[32]) |
| 21 | |
| 22 | /* |
| 23 | * Claim a device for user I/O (if no kernel driver is attached). The claim |
| 24 | * persists until the char device is closed. |
| 25 | */ |
| 26 | struct vs_ioctl_bind { |
| 27 | __u32 send_quota; |
| 28 | __u32 recv_quota; |
| 29 | __u32 send_notify_bits; |
| 30 | __u32 recv_notify_bits; |
| 31 | size_t msg_size; |
| 32 | }; |
| 33 | #define IOCTL_VS_BIND_CLIENT _IOR('4', 3, struct vs_ioctl_bind) |
| 34 | #define IOCTL_VS_BIND_SERVER _IOWR('4', 4, struct vs_ioctl_bind) |
| 35 | |
| 36 | /* send and receive messages and notifications */ |
| 37 | #define IOCTL_VS_NOTIFY _IOW('4', 5, __u32) |
| 38 | struct vs_ioctl_iovec { |
| 39 | union { |
| 40 | __u32 iovcnt; /* input */ |
| 41 | __u32 notify_bits; /* output (recv only) */ |
| 42 | }; |
| 43 | struct iovec *iov; |
| 44 | }; |
| 45 | #define IOCTL_VS_SEND _IOW('4', 6, struct vs_ioctl_iovec) |
| 46 | #define IOCTL_VS_RECV _IOWR('4', 7, struct vs_ioctl_iovec) |
| 47 | |
| 48 | #endif /* __LINUX_PUBLIC_VSERVICES_IOCTL_H__ */ |