diff options
author | Kyle K <kylek389@gmail.com> | 2013-02-01 09:46:37 -0600 |
---|---|---|
committer | Kyle Kaminski <kyle@kkaminsk.com> | 2013-02-01 09:46:37 -0600 |
commit | 5d414a8b60c907307d501bd6ee65c7a8a2f8c587 (patch) | |
tree | 511fa1829ce03f1df83347806e5faf171eeabf6a /main.h | |
parent | 2a64bd55f015dde0b32c752377d5820d9d280873 (diff) | |
download | kernelhello-master.tar.gz kernelhello-master.tar.bz2 kernelhello-master.zip |
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |