summaryrefslogtreecommitdiffstats
path: root/main.h
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2013-02-01 09:46:37 -0600
committerKyle Kaminski <kyle@kkaminsk.com>2013-02-01 09:46:37 -0600
commit5d414a8b60c907307d501bd6ee65c7a8a2f8c587 (patch)
tree511fa1829ce03f1df83347806e5faf171eeabf6a /main.h
parent2a64bd55f015dde0b32c752377d5820d9d280873 (diff)
downloadkernelhello-master.tar.gz
kernelhello-master.tar.bz2
kernelhello-master.zip
initial ioctlHEADmaster
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