blob: 44fa8ebfb2f760d1b7e41842b39847d07f1de2e9 [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
48#define IPC_ROUTER_IOCTL_MAGIC (0xC3)
49
50#define IPC_ROUTER_IOCTL_GET_VERSION \
51 _IOR(IPC_ROUTER_IOCTL_MAGIC, 0, unsigned int)
52
53#define IPC_ROUTER_IOCTL_GET_MTU \
54 _IOR(IPC_ROUTER_IOCTL_MAGIC, 1, unsigned int)
55
56#define IPC_ROUTER_IOCTL_LOOKUP_SERVER \
57 _IOWR(IPC_ROUTER_IOCTL_MAGIC, 2, struct sockaddr_msm_ipc)
58
59#define IPC_ROUTER_IOCTL_GET_CURR_PKT_SIZE \
60 _IOR(IPC_ROUTER_IOCTL_MAGIC, 3, unsigned int)
61
62#define IPC_ROUTER_IOCTL_BIND_CONTROL_PORT \
63 _IOR(IPC_ROUTER_IOCTL_MAGIC, 4, unsigned int)
64
Karthikeyan Ramasubramaniandfde01b2012-06-12 14:25:13 -060065struct msm_ipc_server_info {
66 uint32_t node_id;
67 uint32_t port_id;
68 uint32_t service;
69 uint32_t instance;
70};
71
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070072struct server_lookup_args {
73 struct msm_ipc_port_name port_name;
74 int num_entries_in_array;
75 int num_entries_found;
Karthikeyan Ramasubramaniancc450c92011-07-27 14:38:15 -060076 uint32_t lookup_mask;
Karthikeyan Ramasubramaniandfde01b2012-06-12 14:25:13 -060077 struct msm_ipc_server_info srv_info[0];
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070078};
79
80#endif