#include <linux/errno.h>
-#include <linux/delay.h>
#include <linux/module.h>
#include "msg_parser.h"
#include "msg_buf.h"
#include <us_manager/us_manager.h>
-static int wrt_launcher_port;
-
static int set_config(struct conf_data *conf)
{
int ret;
return app_list_unreg(&app_head);
}
-void set_wrt_launcher_port(int port)
-{
- wrt_launcher_port = port;
-}
-EXPORT_SYMBOL_GPL(set_wrt_launcher_port);
-
-#define GET_PORT_DELAY 100 /* msec */
-#define GET_PORT_TIMEOUT 10000 /* msec */
-
-int get_wrt_launcher_port(void)
-{
- int port;
- int timeout = GET_PORT_TIMEOUT;
-
- do {
- port = wrt_launcher_port;
- timeout -= GET_PORT_DELAY;
- mdelay(GET_PORT_DELAY);
- } while (!port && timeout > 0);
-
- set_wrt_launcher_port(0);
-
- return port;
-}
-
/**
* @brief Initializes commands handling.
*
int msg_config(struct msg_buf *mb);
int msg_swap_inst_add(struct msg_buf *mb);
int msg_swap_inst_remove(struct msg_buf *mb);
-int get_wrt_launcher_port(void);
-void set_wrt_launcher_port(int port);
#endif /* _MSG_CMD_H */
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. */
};
/**
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;
MSG_PROC_MAP = 0x0012,
MSG_PROC_UNMAP = 0x0013,
MSG_PROC_COMM = 0x0014,
- MSG_WEB_PROFILING = 0x0015,
MSG_NSP = 0x0019,
- MSG_WSP = 0x001a,
MSG_FBI = 0x0020
};