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

Commit ce8732c5 authored by Chaitanya Pratapa's avatar Chaitanya Pratapa
Browse files

ipa: Fix to use template header for L2TP UDP Remove



If WLAN driver uses 802.3 format, L2TP UDP remove processing
requires 802.3 header template to copy the inner Ethernet header
onto 802.3 header before sending it to WLAN FW. Make changes to
enable header template even for L2TP_UDP_REMOVE command.

Change-Id: I136ca8f19de255aa0d479a53372d7a255d50acbb
Signed-off-by: default avatarChaitanya Pratapa <cpratapa@codeaurora.org>
parent 4f9559a8
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -1318,10 +1318,25 @@ static int ipahal_cp_proc_ctx_to_hw_buff_v3(enum ipa_hdr_proc_type type,
		ctx->end.length = 0;
		ctx->end.value = 0;
	} else if (type == IPA_HDR_PROC_L2TP_UDP_HEADER_REMOVE) {
		struct ipa_hw_hdr_proc_ctx_remove_l2tp_udp_hdr_cmd_seq *ctx;
		struct ipa_hw_hdr_proc_ctx_remove_l2tp_hdr_cmd_seq *ctx;

		ctx = (struct ipa_hw_hdr_proc_ctx_remove_l2tp_udp_hdr_cmd_seq *)
		ctx = (struct ipa_hw_hdr_proc_ctx_remove_l2tp_hdr_cmd_seq *)
			(base + offset);
		ctx->hdr_add.tlv.type = IPA_PROC_CTX_TLV_TYPE_HDR_ADD;
		ctx->hdr_add.tlv.length = 2;
		if (l2tp_params->hdr_remove_param.eth_hdr_retained) {
			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 length %d\n",
				hdr_addr, ctx->hdr_add.tlv.value);
			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;
		} else {
			ctx->hdr_add.tlv.value = 0;
		}
		ctx->l2tp_params.tlv.type = IPA_PROC_CTX_TLV_TYPE_PROC_CMD;
		ctx->l2tp_params.tlv.length = 1;
		ctx->l2tp_params.tlv.value =
@@ -1451,7 +1466,7 @@ static int ipahal_get_proc_ctx_needed_len_v3(enum ipa_hdr_proc_type type)
		break;
	case IPA_HDR_PROC_L2TP_UDP_HEADER_REMOVE:
		ret =
		sizeof(struct ipa_hw_hdr_proc_ctx_remove_l2tp_udp_hdr_cmd_seq);
		sizeof(struct ipa_hw_hdr_proc_ctx_remove_l2tp_hdr_cmd_seq);
		break;
	case IPA_HDR_PROC_ETHII_TO_ETHII_EX:
		ret = sizeof(struct ipa_hw_hdr_proc_ctx_add_hdr_cmd_seq_ex);