summaryrefslogtreecommitdiffstats
path: root/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'main.h')
-rw-r--r--main.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/main.h b/main.h
index e2727db..ecc20b6 100644
--- a/main.h
+++ b/main.h
@@ -55,5 +55,26 @@ struct hello_dev {
/* function prototypes */
int hello_debugfs(void);
+/*
+ * Ioctl definitions
+ */
+
+/* Use 'x' as magic number */
+#define HELLO_IOCTL_BASE 'x'
+
+#define HELLO_IO(nr) _IO(HELLO_IOCTL_BASE, nr)
+#define HELLO_IOR(nr, type) _IOR(HELLO_IOCTL_BASE, nr, type)
+#define HELLO_IOW(nr, type) _IOW(HELLO_IOCTL_BASE, nr, type)
+#define HELLO_IOWR(nr, type) _IOWR(HELLO_IOCTL_BASE, nr, type)
+
+#define HELLO_IOCTL_RESET HELLO_IO(0x00)
+
+#define HELLO_IOCTL_SCHUNK HELLO_IOW(0x01, int) /* write to kernel */
+#define HELLO_IOCTL_TCHUNK HELLO_IO(0x02)
+#define HELLO_IOCTL_GCHUNK HELLO_IOR(0x03, int) /* write to user */
+#define HELLO_IOCTL_QCHUNK HELLO_IO(0x04)
+
+#define HELLO_IOCTL_MAXNR 4
+
#endif