diff options
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 |