|
@@ -1691,6 +1691,7 @@ static void ipahal_cp_hdr_to_hw_buff_v3(void *const base, u32 offset,
|
|
|
* @hdr_base_addr: base address in table
|
|
|
* @offset_entry: offset from hdr_base_addr in table
|
|
|
* @l2tp_params: l2tp parameters
|
|
|
+ * @eogre_params: eogre parameters
|
|
|
* @generic_params: generic proc_ctx params
|
|
|
* @is_64: Indicates whether header base address/dma base address is 64 bit.
|
|
|
*/
|
|
@@ -1700,6 +1701,7 @@ static int ipahal_cp_proc_ctx_to_hw_buff_v3(enum ipa_hdr_proc_type type,
|
|
|
dma_addr_t phys_base, u64 hdr_base_addr,
|
|
|
struct ipa_hdr_offset_entry *offset_entry,
|
|
|
struct ipa_l2tp_hdr_proc_ctx_params *l2tp_params,
|
|
|
+ struct ipa_eogre_hdr_proc_ctx_params *eogre_params,
|
|
|
struct ipa_eth_II_to_eth_II_ex_procparams *generic_params,
|
|
|
bool is_64)
|
|
|
{
|
|
@@ -1877,7 +1879,56 @@ static int ipahal_cp_proc_ctx_to_hw_buff_v3(enum ipa_hdr_proc_type type,
|
|
|
ctx->end.type = IPA_PROC_CTX_TLV_TYPE_END;
|
|
|
ctx->end.length = 0;
|
|
|
ctx->end.value = 0;
|
|
|
- } else {
|
|
|
+ } else if (type == IPA_HDR_PROC_EoGRE_HEADER_ADD) {
|
|
|
+ struct ipa_hw_hdr_proc_ctx_add_eogre_hdr_cmd_seq *ctx =
|
|
|
+ (struct ipa_hw_hdr_proc_ctx_add_eogre_hdr_cmd_seq *)
|
|
|
+ (base + offset);
|
|
|
+
|
|
|
+ ctx->hdr_add.tlv.type = IPA_PROC_CTX_TLV_TYPE_HDR_ADD;
|
|
|
+ ctx->hdr_add.tlv.length = 2;
|
|
|
+ ctx->hdr_add.tlv.value = hdr_len;
|
|
|
+ hdr_addr = is_hdr_proc_ctx ? phys_base :
|
|
|
+ hdr_base_addr + offset_entry->offset;
|
|
|
+ IPAHAL_DBG("header address 0x%llx\n",
|
|
|
+ hdr_addr);
|
|
|
+ IPAHAL_CP_PROC_CTX_HEADER_UPDATE(ctx->hdr_add.hdr_addr,
|
|
|
+ ctx->hdr_add.hdr_addr_hi, hdr_addr);
|
|
|
+ if (!is_64)
|
|
|
+ ctx->hdr_add.hdr_addr_hi = 0;
|
|
|
+ ctx->eogre_params.tlv.type = IPA_PROC_CTX_TLV_TYPE_PROC_CMD;
|
|
|
+ ctx->eogre_params.tlv.length = 1;
|
|
|
+ ctx->eogre_params.tlv.value = IPA_HDR_UCP_EoGRE_HEADER_ADD;
|
|
|
+ ctx->eogre_params.eogre_params.eth_hdr_retained =
|
|
|
+ eogre_params->hdr_add_param.eth_hdr_retained;
|
|
|
+ ctx->eogre_params.eogre_params.input_ip_version =
|
|
|
+ eogre_params->hdr_add_param.input_ip_version;
|
|
|
+ ctx->eogre_params.eogre_params.output_ip_version =
|
|
|
+ eogre_params->hdr_add_param.output_ip_version;
|
|
|
+ ctx->eogre_params.eogre_params.second_pass =
|
|
|
+ eogre_params->hdr_add_param.second_pass;
|
|
|
+ IPAHAL_DBG("command id %d\n", ctx->eogre_params.tlv.value);
|
|
|
+ IPAHAL_DBG("eth_hdr_retained %d input_ip_version %d output_ip_version %d second_pass %d\n",
|
|
|
+ eogre_params->hdr_add_param.eth_hdr_retained,
|
|
|
+ eogre_params->hdr_add_param.input_ip_version,
|
|
|
+ eogre_params->hdr_add_param.output_ip_version,
|
|
|
+ eogre_params->hdr_add_param.second_pass);
|
|
|
+ ctx->end.type = IPA_PROC_CTX_TLV_TYPE_END;
|
|
|
+ ctx->end.length = 0;
|
|
|
+ ctx->end.value = 0;
|
|
|
+ } else if (type == IPA_HDR_PROC_EoGRE_HEADER_REMOVE) {
|
|
|
+ struct ipa_hw_hdr_proc_ctx_remove_eogre_hdr_cmd_seq *ctx =
|
|
|
+ (struct ipa_hw_hdr_proc_ctx_remove_eogre_hdr_cmd_seq *)
|
|
|
+ (base + offset);
|
|
|
+
|
|
|
+ ctx->eogre_params.tlv.type = IPA_PROC_CTX_TLV_TYPE_PROC_CMD;
|
|
|
+ ctx->eogre_params.tlv.length = 1;
|
|
|
+ ctx->eogre_params.tlv.value = IPA_HDR_UCP_EoGRE_HEADER_REMOVE;
|
|
|
+ ctx->eogre_params.eogre_params.hdr_len_remove =
|
|
|
+ eogre_params->hdr_remove_param.hdr_len_remove;
|
|
|
+ ctx->end.type = IPA_PROC_CTX_TLV_TYPE_END;
|
|
|
+ ctx->end.length = 0;
|
|
|
+ ctx->end.value = 0;
|
|
|
+ } else {
|
|
|
struct ipa_hw_hdr_proc_ctx_add_hdr_cmd_seq *ctx;
|
|
|
|
|
|
ctx = (struct ipa_hw_hdr_proc_ctx_add_hdr_cmd_seq *)
|
|
@@ -1963,6 +2014,13 @@ static int ipahal_get_proc_ctx_needed_len_v3(enum ipa_hdr_proc_type type)
|
|
|
case IPA_HDR_PROC_ETHII_TO_ETHII_EX:
|
|
|
ret = sizeof(struct ipa_hw_hdr_proc_ctx_add_hdr_cmd_seq_ex);
|
|
|
break;
|
|
|
+ case IPA_HDR_PROC_EoGRE_HEADER_ADD:
|
|
|
+ ret = sizeof(struct ipa_hw_hdr_proc_ctx_add_eogre_hdr_cmd_seq);
|
|
|
+ break;
|
|
|
+ case IPA_HDR_PROC_EoGRE_HEADER_REMOVE:
|
|
|
+ ret =
|
|
|
+ sizeof(struct ipa_hw_hdr_proc_ctx_remove_eogre_hdr_cmd_seq);
|
|
|
+ break;
|
|
|
default:
|
|
|
/* invalid value to make sure failure */
|
|
|
IPAHAL_ERR_RL("invalid ipa_hdr_proc_type %d\n", type);
|
|
@@ -1987,6 +2045,7 @@ struct ipahal_hdr_funcs {
|
|
|
u64 hdr_base_addr,
|
|
|
struct ipa_hdr_offset_entry *offset_entry,
|
|
|
struct ipa_l2tp_hdr_proc_ctx_params *l2tp_params,
|
|
|
+ struct ipa_eogre_hdr_proc_ctx_params *eogre_params,
|
|
|
struct ipa_eth_II_to_eth_II_ex_procparams
|
|
|
*generic_params,
|
|
|
bool is_64);
|
|
@@ -2055,6 +2114,7 @@ void ipahal_cp_hdr_to_hw_buff(void *base, u32 offset, u8 *const hdr,
|
|
|
* @hdr_base_addr: base address in table
|
|
|
* @offset_entry: offset from hdr_base_addr in table
|
|
|
* @l2tp_params: l2tp parameters
|
|
|
+ * @eogre_params: eogre parameters
|
|
|
* @generic_params: generic proc_ctx params
|
|
|
* @is_64: Indicates whether header base address/dma base address is 64 bit.
|
|
|
*/
|
|
@@ -2063,6 +2123,7 @@ int ipahal_cp_proc_ctx_to_hw_buff(enum ipa_hdr_proc_type type,
|
|
|
bool is_hdr_proc_ctx, dma_addr_t phys_base,
|
|
|
u64 hdr_base_addr, struct ipa_hdr_offset_entry *offset_entry,
|
|
|
struct ipa_l2tp_hdr_proc_ctx_params *l2tp_params,
|
|
|
+ struct ipa_eogre_hdr_proc_ctx_params *eogre_params,
|
|
|
struct ipa_eth_II_to_eth_II_ex_procparams *generic_params,
|
|
|
bool is_64)
|
|
|
{
|
|
@@ -2086,7 +2147,7 @@ int ipahal_cp_proc_ctx_to_hw_buff(enum ipa_hdr_proc_type type,
|
|
|
return hdr_funcs.ipahal_cp_proc_ctx_to_hw_buff(type, base, offset,
|
|
|
hdr_len, is_hdr_proc_ctx, phys_base,
|
|
|
hdr_base_addr, offset_entry, l2tp_params,
|
|
|
- generic_params, is_64);
|
|
|
+ eogre_params, generic_params, is_64);
|
|
|
}
|
|
|
|
|
|
/*
|