Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 051cae7a authored by Amir Levy's avatar Amir Levy
Browse files

msm: ipa3: fix compatibility with ipa user space



Add several defines and structs to allow IPA user space compile.

Change-Id: Icd6fe721bd0572b6c8f0c57dd65da3e7a6e69596
Acked-by: default avatarDmitry Kogan <dmitryk@qti.qualcomm.com>
Signed-off-by: default avatarAmir Levy <alevy@codeaurora.org>
parent eb61a053
Loading
Loading
Loading
Loading
+142 −66
Original line number Diff line number Diff line
@@ -15,13 +15,28 @@
 */
#define IPA_IOC_MAGIC 0xCF

/**
 * IPA device full path
 */
#define IPA_DEV_NAME "/dev/ipa"

/**
 * IPA NAT table character device name
 */
#define IPA_NAT_DEV_NAME "ipaNatTable"

/**
 * IPA IPv6CT table character device name
 */
#define IPA_IPV6CT_DEV_NAME "ipaIpv6CTTable"

 /**
 * name of the default routing tables for v4 and v6
 */
#define IPA_DFLT_RT_TBL_NAME "ipa_dflt_rt"

/**
 *   the commands supported by IPA driver
 * commands supported by IPA driver
 */
#define IPA_IOCTL_ADD_HDR                       0
#define IPA_IOCTL_DEL_HDR                       1
@@ -47,7 +62,9 @@
#define IPA_IOCTL_SET_FLT                       21
#define IPA_IOCTL_ALLOC_NAT_MEM                 22
#define IPA_IOCTL_V4_INIT_NAT                   23
#define IPA_IOCTL_NAT_DMA        24
#define IPA_IOCTL_TABLE_DMA_CMD                 24
#define IPA_IOCTL_NAT_DMA                       IPA_IOCTL_TABLE_DMA_CMD
#define IPA_IOCTL_INIT_IPV6CT_TABLE             25
#define IPA_IOCTL_V4_DEL_NAT                    26
#define IPA_IOCTL_PULL_MSG                      27
#define IPA_IOCTL_GET_NAT_OFFSET                28
@@ -74,7 +91,11 @@
#define IPA_IOCTL_ADD_L2TP_VLAN_MAPPING         49
#define IPA_IOCTL_DEL_L2TP_VLAN_MAPPING         50
#define IPA_IOCTL_NAT_MODIFY_PDN                51
#define IPA_IOCTL_MAX 52
#define IPA_IOCTL_ALLOC_NAT_TABLE               52
#define IPA_IOCTL_ALLOC_IPV6CT_TABLE            53
#define IPA_IOCTL_DEL_NAT_TABLE                 54
#define IPA_IOCTL_DEL_IPV6CT_TABLE              55
#define IPA_IOCTL_MAX                           56

/**
 * max size of the header to be inserted
@@ -1422,15 +1443,26 @@ struct ipa_ioc_nat_alloc_mem {
};

/**
 * struct ipa_ioc_v4_nat_init - nat table initialization
 * parameters
 * struct ipa_ioc_nat_ipv6ct_table_alloc - NAT/IPv6CT table memory allocation
 * properties
 * @size: input parameter, size of table in bytes
 * @offset: output parameter, offset into page in case of system memory
 */
struct ipa_ioc_nat_ipv6ct_table_alloc {
	size_t size;
	off_t offset;
};

/**
 * struct ipa_ioc_v4_nat_init - nat table initialization parameters
 * @tbl_index: input parameter, index of the table
 * @ipv4_rules_offset: input parameter, ipv4 rules address offset
 * @expn_rules_offset: input parameter, ipv4 expansion rules address offset
 * @index_offset: input parameter, index rules offset
 * @index_expn_offset: input parameter, index expansion rules offset
 * @table_entries: input parameter, ipv4 rules table size in entries
 * @expn_table_entries: input parameter, ipv4 expansion rules table size
 * @table_entries: input parameter, ipv4 rules table number of entries
 * @expn_table_entries: input parameter, ipv4 expansion rules table number of
 *                      entries
 * @ip_addr: input parameter, public ip address
 */
struct ipa_ioc_v4_nat_init {
@@ -1446,6 +1478,23 @@ struct ipa_ioc_v4_nat_init {
	uint32_t ip_addr;
};

/**
 * struct ipa_ioc_ipv6ct_init - IPv6CT table initialization parameters
 * @tbl_index: input parameter, index of the table
 * @base_table_offset: input parameter, IPv6CT base table address offset
 * @expn_table_offset: input parameter, IPv6CT expansion table address offset
 * @table_entries: input parameter, IPv6CT table number of entries
 * @expn_table_entries: input parameter, IPv6CT expansion table number of
 *                      entries
 */
struct ipa_ioc_ipv6ct_init {
	uint8_t tbl_index;
	uint32_t base_table_offset;
	uint32_t expn_table_offset;
	uint16_t table_entries;
	uint16_t expn_table_entries;
};

/**
 * struct ipa_ioc_v4_nat_del - nat table delete parameter
 * @table_index: input parameter, index of the table
@@ -1457,7 +1506,15 @@ struct ipa_ioc_v4_nat_del {
};

/**
 * struct ipa_ioc_nat_dma_one - nat dma command parameter
 * struct ipa_ioc_nat_ipv6ct_table_del - NAT/IPv6CT table delete parameter
 * @table_index: input parameter, index of the table
 */
struct ipa_ioc_nat_ipv6ct_table_del {
	uint8_t table_index;
};

/**
 * struct ipa_ioc_nat_dma_one - nat/ipv6ct dma command parameter
 * @table_index: input parameter, index of the table
 * @base_addr:	type of table, from which the base address of the table
 *		can be inferred
@@ -1474,7 +1531,7 @@ struct ipa_ioc_nat_dma_one {
};

/**
 * struct ipa_ioc_nat_dma_cmd - To hold multiple nat dma commands
 * struct ipa_ioc_nat_dma_cmd - To hold multiple nat/ipv6ct dma commands
 * @entries: number of dma commands in use
 * @dma: data pointer to the dma commands
 */
@@ -1521,6 +1578,7 @@ struct ipa_ioc_nat_pdn_entry {
	uint32_t src_metadata;
	uint32_t dst_metadata;
};

/**
 * struct ipa_msg_meta - Format of the message meta-data.
 * @msg_type: the type of the message
@@ -1780,15 +1838,33 @@ struct ipa_tether_device_info {
#define IPA_IOC_ALLOC_NAT_MEM _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_ALLOC_NAT_MEM, \
				struct ipa_ioc_nat_alloc_mem *)
#define IPA_IOC_ALLOC_NAT_TABLE _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_ALLOC_NAT_TABLE, \
				struct ipa_ioc_nat_ipv6ct_table_alloc *)
#define IPA_IOC_ALLOC_IPV6CT_TABLE _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_ALLOC_IPV6CT_TABLE, \
				struct ipa_ioc_nat_ipv6ct_table_alloc *)
#define IPA_IOC_V4_INIT_NAT _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_V4_INIT_NAT, \
				struct ipa_ioc_v4_nat_init *)
#define IPA_IOC_INIT_IPV6CT_TABLE _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_INIT_IPV6CT_TABLE, \
				struct ipa_ioc_ipv6ct_init *)
#define IPA_IOC_NAT_DMA _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_NAT_DMA, \
				struct ipa_ioc_nat_dma_cmd *)
#define IPA_IOC_TABLE_DMA_CMD _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_TABLE_DMA_CMD, \
				struct ipa_ioc_nat_dma_cmd *)
#define IPA_IOC_V4_DEL_NAT _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_V4_DEL_NAT, \
				struct ipa_ioc_v4_nat_del *)
#define IPA_IOC_DEL_NAT_TABLE _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_DEL_NAT_TABLE, \
				struct ipa_ioc_nat_ipv6ct_table_del *)
#define IPA_IOC_DEL_IPV6CT_TABLE _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_DEL_IPV6CT_TABLE, \
				struct ipa_ioc_nat_ipv6ct_table_del *)
#define IPA_IOC_GET_NAT_OFFSET _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_GET_NAT_OFFSET, \
				uint32_t *)