[REFACTOR] swap_ioctl
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 3 Jul 2013 15:26:25 +0000 (19:26 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 3 Jul 2013 15:34:14 +0000 (19:34 +0400)
rename:
ioctl_commands.h --> swap_ioctl.h

add ioctl:
SWAP_DRIVER_MSG

delete ioctl:
SWAP_DRIVER_MSG_START,
SWAP_DRIVER_MSG_STOP,
SWAP_DRIVER_MSG_CONFIG,
SWAP_DRIVER_MSG_SWAP_INST_ADD,
SWAP_DRIVER_MSG_SWAP_INST_REMOVE

driver_new/device_driver.c
driver_new/ioctl_commands.h [deleted file]
driver_new/swap_ioctl.h [new file with mode: 0644]

index e467dcc..4140179 100644 (file)
@@ -14,7 +14,7 @@
 #include "device_driver.h"
 #include "swap_driver_errors.h"
 #include "driver_to_buffer.h"
-#include "ioctl_commands.h"
+#include "swap_ioctl.h"
 #include "driver_defs.h"
 #include "device_driver_to_driver_to_buffer.h"
 
diff --git a/driver_new/ioctl_commands.h b/driver_new/ioctl_commands.h
deleted file mode 100644 (file)
index f367734..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* SWAP Device ioctl commands */
-
-#include <linux/ioctl.h>
-
-#ifndef __SWAP_DRIVER_IOCTL_COMMANDS__
-#define __SWAP_DRIVER_IOCTL_COMMANDS__
-
-#define SWAP_DRIVER_IOC_MAGIC 0xAF
-
-// TODO Think about magic num
-
-struct buffer_initialize {
-    size_t size;
-    unsigned int count;
-};
-
-#define SWAP_DRIVER_BUFFER_INITIALIZE       _IOW(SWAP_DRIVER_IOC_MAGIC, 1, \
-                                                 struct buffer_initialize *)
-#define SWAP_DRIVER_BUFFER_UNINITIALIZE     _IO(SWAP_DRIVER_IOC_MAGIC, 2)
-#define SWAP_DRIVER_NEXT_BUFFER_TO_READ     _IO(SWAP_DRIVER_IOC_MAGIC, 3)
-#define SWAP_DRIVER_FLUSH_BUFFER            _IO(SWAP_DRIVER_IOC_MAGIC, 4)
-#define SWAP_DRIVER_MSG_START               _IOW(SWAP_DRIVER_IOC_MAGIC, 5, \
-                                                 void *)
-#define SWAP_DRIVER_MSG_STOP                _IO(SWAP_DRIVER_IOC_MAGIC, 6)
-#define SWAP_DRIVER_MSG_CONFIG              _IOW(SWAP_DRIVER_IOC_MAGIC, 7,\
-                                                 void *)
-#define SWAP_DRIVER_MSG_SWAP_INST_ADD       _IOW(SWAP_DRIVER_IOC_MAGIC, 8,\
-                                                 void *)
-#define SWAP_DRIVER_MSG_SWAP_INST_REMOVE    _IOW(SWAP_DRIVER_IOC_MAGIC, 9,\
-                                                 void *)
-
-#endif /* __SWAP_DRIVER_IOCTL_COMMANDS__ */
diff --git a/driver_new/swap_ioctl.h b/driver_new/swap_ioctl.h
new file mode 100644 (file)
index 0000000..ef64957
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _SWAP_IOCTL_H
+#define _SWAP_IOCTL_H
+
+#include <linux/ioctl.h>
+
+#define SWAP_DRIVER_IOC_MAGIC 0xAF
+
+/* TODO: Think about magic num */
+
+struct buffer_initialize {
+       size_t size;
+       unsigned int count;
+};
+
+/* SWAP Device ioctl commands */
+
+#define SWAP_DRIVER_BUFFER_INITIALIZE          _IOW(SWAP_DRIVER_IOC_MAGIC, 1, \
+                                                    struct buffer_initialize *)
+#define SWAP_DRIVER_BUFFER_UNINITIALIZE                _IO(SWAP_DRIVER_IOC_MAGIC, 2)
+#define SWAP_DRIVER_NEXT_BUFFER_TO_READ                _IO(SWAP_DRIVER_IOC_MAGIC, 3)
+#define SWAP_DRIVER_FLUSH_BUFFER               _IO(SWAP_DRIVER_IOC_MAGIC, 4)
+#define SWAP_DRIVER_MSG                                _IOW(SWAP_DRIVER_IOC_MAGIC, 5, \
+                                                    void *)
+
+#endif /* _SWAP_IOCTL_H */