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

Commit ea758854 authored by Armaan Siddiqui's avatar Armaan Siddiqui
Browse files

msm: ipa: interface to provide pdn configuration



Make interface changes to get PDN configuration. The ioctl
can be used to notify whether a PDN is in IP collision
mode or in IP passthrough mode and provide the required configuration
information.

Change-Id: I36c596aa449669e5d5b389a1fbdafb6f92a81744
Signed-off-by: default avatarArmaan Siddiqui <asiddiqu@codeaurora.org>
parent c55c5408
Loading
Loading
Loading
Loading
+47 −1
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@
#define IPA_IOCTL_SET_FNR_COUNTER_INFO          77
#define IPA_IOCTL_GET_NAT_IN_SRAM_INFO          78
#define IPA_IOCTL_APP_CLOCK_VOTE                79
#define IPA_IOCTL_PDN_CONFIG                    80

/**
 * max size of the header to be inserted
@@ -715,7 +716,15 @@ enum ipa_peripheral_event {
#define WIGIG_FST_SWITCH (WIGIG_CLIENT_CONNECT + 1)
#define WIGIG_EVENT_MAX (WIGIG_FST_SWITCH + 1)

#define IPA_EVENT_MAX_NUM (WIGIG_EVENT_MAX)
enum ipa_pdn_config_event {
	IPA_PDN_DEFAULT_MODE_CONFIG = WIGIG_EVENT_MAX, /* Default mode. */
	IPA_PDN_IP_COLLISION_MODE_CONFIG, /* IP Collision detected. */
	IPA_PDN_IP_PASSTHROUGH_MODE_CONFIG, /* IP Passthrough mode. */
	IPA_PDN_CONFIG_EVENT_MAX
#define IPA_PDN_CONFIG_EVENT_MAX IPA_PDN_CONFIG_EVENT_MAX
};

#define IPA_EVENT_MAX_NUM (IPA_PDN_CONFIG_EVENT_MAX)
#define IPA_EVENT_MAX ((int)IPA_EVENT_MAX_NUM)

/**
@@ -2638,6 +2647,40 @@ enum ipacm_hw_index_counter_virtual_type {
	DL_WLAN_TX
};

/**
 * struct ipa_ioc_pdn_config - provide pdn configuration
 * @dev_name: PDN interface name
 * @pdn_cfg_type: type of the pdn config applied.
 * @enable: enable/disable pdn config type.
 * @u.collison_cfg.pdn_ip_addr: pdn_ip_address used in collision config.
 * @u.passthrough_cfg.pdn_ip_addr: pdn_ip_address used in passthrough config.
 * @u.passthrough_cfg.device_type: Device type of the client.
 * @u.passthrough_cfg.vlan_id: VLAN ID of the client.
 * @u.passthrough_cfg.client_mac_addr: client mac for which passthough
 *»       is enabled.
 * @u.passthrough_cfg.skip_nat: skip NAT processing.
 * @default_pdn: bool to indicate the config is for default pdn.
 */
struct ipa_ioc_pdn_config {
	char dev_name[IPA_RESOURCE_NAME_MAX];
	enum ipa_pdn_config_event pdn_cfg_type;
	__u8 enable;
	union {
		struct ipa_pdn_ip_collision_cfg {
			__u32 pdn_ip_addr;
		} collison_cfg;

		struct ipa_pdn_ip_passthrough_cfg {
			__u32 pdn_ip_addr;
			enum ipacm_per_client_device_type device_type;
			__u16 vlan_id;
			__u8 client_mac_addr[IPA_MAC_ADDR_SIZE];
			__u8 skip_nat;
		} passthrough_cfg;
	} u;
	__u8 default_pdn;
};

/**
 *   actual IOCTLs supported by IPA driver
 */
@@ -2898,6 +2941,9 @@ enum ipacm_hw_index_counter_virtual_type {
#define IPA_IOC_APP_CLOCK_VOTE _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_APP_CLOCK_VOTE, \
				uint32_t)
#define IPA_IOC_PDN_CONFIG _IOWR(IPA_IOC_MAGIC, \
				IPA_IOCTL_PDN_CONFIG, \
				struct ipa_ioc_pdn_config)

/*
 * unique magic number of the Tethering bridge ioctls