[IMPROVE] Add wake up ioctl command
authorAlexander Aksenov <a.aksenov@samsung.com>
Thu, 26 Sep 2013 13:24:00 +0000 (17:24 +0400)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 26 Sep 2013 14:54:59 +0000 (14:54 +0000)
It should be given after chainging opened driver descriptor attributes to nonblock.

Change-Id: Iaf0c492d6ce668250934e5e5a7ffd7686efb185d
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
driver/device_driver.c
driver/swap_ioctl.h

index 50e1278..9ef5bb4 100644 (file)
@@ -322,8 +322,7 @@ static long swap_device_ioctl(struct file *filp, unsigned int cmd,
                {
                        result = driver_to_buffer_uninitialize();
                        if (result < 0)
-                       print_err("Buffer uninitialization failed %d\n", result);
-
+                               print_err("Buffer uninitialization failed %d\n", result);
                        break;
                }
                case SWAP_DRIVER_NEXT_BUFFER_TO_READ:
@@ -342,6 +341,7 @@ static long swap_device_ioctl(struct file *filp, unsigned int cmd,
                        break;
                }
                case SWAP_DRIVER_MSG:
+               {
                        if (msg_handler) {
                                result = msg_handler((void __user *)arg);
                        } else {
@@ -349,6 +349,13 @@ static long swap_device_ioctl(struct file *filp, unsigned int cmd,
                                result = -EINVAL;
                        }
                        break;
+               }
+               case SWAP_DRIVER_WAKE_UP:
+               {
+                       swap_device_wake_up_process();
+                       result = E_SD_SUCCESS;
+                       break;
+               }
                default:
                        print_warn("Unknown command %d\n", cmd);
                        result = -EINVAL;
index 5b133ea..38d7a01 100644 (file)
@@ -43,5 +43,6 @@ struct buffer_initialize {
 #define SWAP_DRIVER_FLUSH_BUFFER               _IO(SWAP_DRIVER_IOC_MAGIC, 4)
 #define SWAP_DRIVER_MSG                                _IOW(SWAP_DRIVER_IOC_MAGIC, 5, \
                                                     void *)
+#define SWAP_DRIVER_WAKE_UP                    _IO(SWAP_DRIVER_IOC_MAGIC, 6)
 
 #endif /* __SWAP_IOCTL_H__ */