blob: 7b6bf41a07ed4002d49fe53a7ec79651412d0ea7 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001#ifndef _LINUX_MSM_IPC_H_
2#define _LINUX_MSM_IPC_H_
3
4#include <linux/types.h>
5#include <linux/ioctl.h>
6
7struct msm_ipc_port_addr {
8 uint32_t node_id;
9 uint32_t port_id;
10};
11
12struct msm_ipc_port_name {
13 uint32_t service;
14 uint32_t instance;
15};
16
17struct msm_ipc_addr {
18 unsigned char addrtype;
19 union {
20 struct msm_ipc_port_addr port_addr;
21 struct msm_ipc_port_name port_name;
22 } addr;
23};
24
25#define MSM_IPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */
26
27/*
28 * Socket API
29 */
30
31#ifndef AF_MSM_IPC
32#define AF_MSM_IPC 27
33#endif
34
35#ifndef PF_MSM_IPC
36#define PF_MSM_IPC AF_MSM_IPC
37#endif
38
39#define MSM_IPC_ADDR_NAME 1
40#define MSM_IPC_ADDR_ID 2
41
42struct sockaddr_msm_ipc {
43 unsigned short family;
44 struct msm_ipc_addr address;
45 unsigned char reserved;
46};
47
Karthikeyan Ramasubramanian5b502d3642012-09-23 22:23:36 -060048struct config_sec_rules_args {
49 int num_group_info;
50 uint32_t service_id;
51 uint32_t instance_id;
52 unsigned reserved;
53 gid_t group_id[0];
54};
55
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070056#define IPC_ROUTER_IOCTL_MAGIC (0xC3)
57
58#define IPC_ROUTER_IOCTL_GET_VERSION \
59 _IOR(IPC_ROUTER_IOCTL_MAGIC, 0, unsigned int)
60
61#define IPC_ROUTER_IOCTL_GET_MTU \
62 _IOR(IPC_ROUTER_IOCTL_MAGIC, 1, unsigned int)
63
64#define IPC_ROUTER_IOCTL_LOOKUP_SERVER \
65 _IOWR(IPC_ROUTER_IOCTL_MAGIC, 2, struct sockaddr_msm_ipc)
66
67#define IPC_ROUTER_IOCTL_GET_CURR_PKT_SIZE \
68 _IOR(IPC_ROUTER_IOCTL_MAGIC, 3, unsigned int)
69
70#define IPC_ROUTER_IOCTL_BIND_CONTROL_PORT \
71 _IOR(IPC_ROUTER_IOCTL_MAGIC, 4, unsigned int)
72
Karthikeyan Ramasubramanian5b502d3642012-09-23 22:23:36 -060073#define IPC_ROUTER_IOCTL_CONFIG_SEC_RULES \
74 _IOR(IPC_ROUTER_IOCTL_MAGIC, 5, struct config_sec_rules_args)
75
Karthikeyan Ramasubramaniandfde01b2012-06-12 14:25:13 -060076struct msm_ipc_server_info {
77 uint32_t node_id;
78 uint32_t port_id;
79 uint32_t service;
80 uint32_t instance;
81};
82
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070083struct server_lookup_args {
84 struct msm_ipc_port_name port_name;
85 int num_entries_in_array;
86 int num_entries_found;
Karthikeyan Ramasubramaniancc450c92011-07-27 14:38:15 -060087 uint32_t lookup_mask;
Karthikeyan Ramasubramaniandfde01b2012-06-12 14:25:13 -060088 struct msm_ipc_server_info srv_info[0];
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070089};
90
91#endif