Home | History | Annotate | Download | only in linux
      1 #ifndef _UAPI_MSM_IPC_H_
      2 #define _UAPI_MSM_IPC_H_
      3 
      4 #include <linux/types.h>
      5 #include <linux/ioctl.h>
      6 
      7 struct msm_ipc_port_addr {
      8 	uint32_t node_id;
      9 	uint32_t port_id;
     10 };
     11 
     12 struct msm_ipc_port_name {
     13 	uint32_t service;
     14 	uint32_t instance;
     15 };
     16 
     17 struct 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 
     42 struct sockaddr_msm_ipc {
     43 	unsigned short family;
     44 	struct msm_ipc_addr address;
     45 	unsigned char reserved;
     46 };
     47 
     48 struct 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 
     56 #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 
     73 #define IPC_ROUTER_IOCTL_CONFIG_SEC_RULES \
     74 	_IOR(IPC_ROUTER_IOCTL_MAGIC, 5, struct config_sec_rules_args)
     75 
     76 struct msm_ipc_server_info {
     77 	uint32_t node_id;
     78 	uint32_t port_id;
     79 	uint32_t service;
     80 	uint32_t instance;
     81 };
     82 
     83 struct server_lookup_args {
     84 	struct msm_ipc_port_name port_name;
     85 	int num_entries_in_array;
     86 	int num_entries_found;
     87 	uint32_t lookup_mask;
     88 	struct msm_ipc_server_info srv_info[0];
     89 };
     90 
     91 #endif
     92