Merge "msm: ipa3: fix compatibility with ipa user space"

This commit is contained in:
Linux Build Service Account 2017-07-17 05:28:28 -07:00 committed by Gerrit - the friendly Code Review server
commit 9875d5f19c

View file

@ -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
@ -70,7 +87,11 @@
#define IPA_IOCTL_GET_HW_VERSION 45
#define IPA_IOCTL_ADD_RT_RULE_EXT 46
#define IPA_IOCTL_NAT_MODIFY_PDN 47
#define IPA_IOCTL_MAX 48
#define IPA_IOCTL_ALLOC_NAT_TABLE 48
#define IPA_IOCTL_ALLOC_IPV6CT_TABLE 49
#define IPA_IOCTL_DEL_NAT_TABLE 50
#define IPA_IOCTL_DEL_IPV6CT_TABLE 51
#define IPA_IOCTL_MAX 52
/**
* max size of the header to be inserted
@ -1314,15 +1335,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 {
@ -1338,6 +1370,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
@ -1349,7 +1398,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
@ -1366,7 +1423,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
*/
@ -1600,15 +1657,33 @@ enum ipacm_client_enum {
#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 *)