Merge branch 'tizen_2.4' into tizen_2.4_dev
[platform/kernel/swap-modules.git] / parser / swap_msg_parser.c
index 487da22..60fc0ac 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/uaccess.h>
 
 #include "parser_defs.h"
+#include "us_inst.h"
 #include "msg_buf.h"
 #include "msg_cmd.h"
 #include "cpu_ctrl.h"
  * @brief Message IDs.
  */
 enum MSG_ID {
-       MSG_KEEP_ALIVE          = 0x0001,       /**< Keep alive message. */
-       MSG_START               = 0x0002,           /**< Start message. */
-       MSG_STOP                = 0x0003,           /**< Stop message. */
-       MSG_CONFIG              = 0x0004,           /**< Config message. */
-       MSG_SWAP_INST_ADD       = 0x0008,       /**< Swap inst add message. */
-       MSG_SWAP_INST_REMOVE    = 0x0009    /**< Swap inst remove message. */
+       MSG_KEEP_ALIVE          = 0x0001,       /**< Keep alive message. */
+       MSG_START               = 0x0002,       /**< Start message. */
+       MSG_STOP                = 0x0003,       /**< Stop message. */
+       MSG_CONFIG              = 0x0004,       /**< Config message. */
+       MSG_SWAP_INST_ADD       = 0x0008,       /**< Swap inst add message. */
+       MSG_SWAP_INST_REMOVE    = 0x0009,       /**< Swap inst remove message. */
+       MSG_WRT_LAUNCHER_PORT   = 0x8001        /**< WRT launcher port. */
 };
 
 /**
@@ -130,6 +132,18 @@ static int msg_handler(void __user *msg)
                print_parse_debug("MSG_SWAP_INST_REMOVE. size=%d\n", size);
                ret = msg_swap_inst_remove(&mb);
                break;
+       case MSG_WRT_LAUNCHER_PORT: {
+               /* TODO: discuss wrt-launcher port transfer */
+               int port;
+               print_parse_debug("MSG_WRT_LAUNCHER_PORT. size=%d\n", size);
+               port = get_wrt_launcher_port();
+               if (copy_to_user(payload, &port, sizeof(port))) {
+                       ret = -EIO;
+                       break;
+               }
+               ret = port ? 0 : -EINVAL;
+               break;
+       }
        default:
                print_err("incorrect message ID [%u]. size=%d\n", msg_id, size);
                ret = -EINVAL;
@@ -150,6 +164,7 @@ static int reg_msg_handler(void)
 static void unreg_msg_handler(void)
 {
        set_msg_handler(NULL);
+       pfg_put_all();
 }
 
 static int once(void)