msm: ipa4: add generic header processing context

IPA uC now supports generic header processing context that
accepts source and target headers negative offset as parameters.
This change adds HAL and API support for this new feature.

Change-Id: Idb4c977f55175a66b55b92225f6677431ad8066a
Signed-off-by: Amir Levy <alevy@codeaurora.org>
This commit is contained in:
Amir Levy 2019-11-10 11:35:20 +02:00 • committed by Gerrit - the friendly Code Review server
commit dc5e84ea74
7 changed files with 153 additions and 33 deletions

View file

@ -1101,6 +1101,8 @@ enum ipa_hdr_l2_type {
* IPA_HDR_PROC_ETHII_TO_802_3: Process Ethernet II to 802_3
* IPA_HDR_PROC_802_3_TO_ETHII: Process 802_3 to Ethernet II
* IPA_HDR_PROC_802_3_TO_802_3: Process 802_3 to 802_3
* IPA_HDR_PROC_ETHII_TO_ETHII_EX: Process Ethernet II to Ethernet II with
* generic lengths of src and dst headers
*/
enum ipa_hdr_proc_type {
IPA_HDR_PROC_NONE,
@ -1109,9 +1111,10 @@ enum ipa_hdr_proc_type {
IPA_HDR_PROC_802_3_TO_ETHII,
IPA_HDR_PROC_802_3_TO_802_3,
IPA_HDR_PROC_L2TP_HEADER_ADD,
IPA_HDR_PROC_L2TP_HEADER_REMOVE
IPA_HDR_PROC_L2TP_HEADER_REMOVE,
IPA_HDR_PROC_ETHII_TO_ETHII_EX
};
#define IPA_HDR_PROC_MAX (IPA_HDR_PROC_L2TP_HEADER_REMOVE + 1)
#define IPA_HDR_PROC_MAX (IPA_HDR_PROC_ETHII_TO_ETHII_EX + 1)
/**
* struct ipa_rt_rule - attributes of a routing rule
@ -1266,6 +1269,20 @@ struct ipa_l2tp_hdr_proc_ctx_params {
enum ipa_client_type dst_pipe;
};
/**
* struct ipa_eth_II_to_eth_II_ex_procparams -
* @input_ethhdr_negative_offset: Specifies where the ethernet hdr offset is
* (in bytes) from the start of the input IP hdr
* @output_ethhdr_negative_offset: Specifies where the ethernet hdr offset is
* (in bytes) from the end of the template hdr
* @reserved: for future use
*/
struct ipa_eth_II_to_eth_II_ex_procparams {
uint32_t input_ethhdr_negative_offset : 8;
uint32_t output_ethhdr_negative_offset : 8;
uint32_t reserved : 16;
};
#define L2TP_USER_SPACE_SPECIFY_DST_PIPE
/**
@ -1274,6 +1291,7 @@ struct ipa_l2tp_hdr_proc_ctx_params {
* @type: processing context type
* @hdr_hdl: in parameter, handle to header
* @l2tp_params: l2tp parameters
* @generic_params: generic proc_ctx params
* @proc_ctx_hdl: out parameter, handle to proc_ctx, valid when status is 0
* @status: out parameter, status of header add operation,
* 0 for success,
@ -1285,6 +1303,7 @@ struct ipa_hdr_proc_ctx_add {
uint32_t proc_ctx_hdl;
int status;
struct ipa_l2tp_hdr_proc_ctx_params l2tp_params;
struct ipa_eth_II_to_eth_II_ex_procparams generic_params;
};
#define IPA_L2TP_HDR_PROC_SUPPORT