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

Commit 886e1b9d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: enable SYSPIPE_ERR_DETECTION bit for deaggr_err"

parents 7ecfa0c5 b87b1804
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/atomic.h>
@@ -437,8 +437,10 @@ static struct ipa_ep_cfg usb_to_ipa_ep_cfg_deaggr_en = {
	},
	.deaggr = {
		.deaggr_hdr_len = sizeof(struct rndis_pkt_hdr),
		.syspipe_err_detection = true,
		.packet_offset_valid = true,
		.packet_offset_location = 8,
		.ignore_min_pkt_err = true,
		.max_packet_len = 8192, /* Will be overridden*/
	},
	.route = {
+6 −0
Original line number Diff line number Diff line
@@ -5349,6 +5349,9 @@ int ipa3_cfg_ep_deaggr(u32 clnt_hdl,
		clnt_hdl,
		ep_deaggr->deaggr_hdr_len);

	IPADBG("syspipe_err_detection=%d\n",
		ep_deaggr->syspipe_err_detection);

	IPADBG("packet_offset_valid=%d\n",
		ep_deaggr->packet_offset_valid);

@@ -5356,6 +5359,9 @@ int ipa3_cfg_ep_deaggr(u32 clnt_hdl,
		ep_deaggr->packet_offset_location,
		ep_deaggr->max_packet_len);

	IPADBG("ignore_min_pkt_err=%d\n",
		ep_deaggr->ignore_min_pkt_err);

	ep = &ipa3_ctx->ep[clnt_hdl];

	/* copy over EP cfg */
+33 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/init.h>
@@ -1554,6 +1554,37 @@ static void ipareg_construct_endp_init_deaggr_n(
		IPA_ENDP_INIT_DEAGGR_n_MAX_PACKET_LEN_BMSK);
}

static void ipareg_construct_endp_init_deaggr_n_v4_5(
		enum ipahal_reg_name reg, const void *fields, u32 *val)
{
	struct ipa_ep_cfg_deaggr *ep_deaggr =
		(struct ipa_ep_cfg_deaggr *)fields;

	IPA_SETFIELD_IN_REG(*val, ep_deaggr->deaggr_hdr_len,
		IPA_ENDP_INIT_DEAGGR_n_DEAGGR_HDR_LEN_SHFT,
		IPA_ENDP_INIT_DEAGGR_n_DEAGGR_HDR_LEN_BMSK);

	IPA_SETFIELD_IN_REG(*val, ep_deaggr->syspipe_err_detection,
		IPA_ENDP_INIT_DEAGGR_n_SYSPIPE_ERR_DETECTION_SHFT,
		IPA_ENDP_INIT_DEAGGR_n_SYSPIPE_ERR_DETECTION_BMSK);

	IPA_SETFIELD_IN_REG(*val, ep_deaggr->packet_offset_valid,
		IPA_ENDP_INIT_DEAGGR_n_PACKET_OFFSET_VALID_SHFT,
		IPA_ENDP_INIT_DEAGGR_n_PACKET_OFFSET_VALID_BMSK);

	IPA_SETFIELD_IN_REG(*val, ep_deaggr->packet_offset_location,
		IPA_ENDP_INIT_DEAGGR_n_PACKET_OFFSET_LOCATION_SHFT,
		IPA_ENDP_INIT_DEAGGR_n_PACKET_OFFSET_LOCATION_BMSK);

	IPA_SETFIELD_IN_REG(*val, ep_deaggr->ignore_min_pkt_err,
		IPA_ENDP_INIT_DEAGGR_n_IGNORE_MIN_PKT_ERR_SHFT,
		IPA_ENDP_INIT_DEAGGR_n_IGNORE_MIN_PKT_ERR_BMSK);

	IPA_SETFIELD_IN_REG(*val, ep_deaggr->max_packet_len,
		IPA_ENDP_INIT_DEAGGR_n_MAX_PACKET_LEN_SHFT,
		IPA_ENDP_INIT_DEAGGR_n_MAX_PACKET_LEN_BMSK);
}

static void ipareg_construct_endp_init_hol_block_en_n(
	enum ipahal_reg_name reg, const void *fields, u32 *val)
{
@@ -3167,7 +3198,7 @@ static struct ipahal_reg_obj ipahal_reg_objs[IPA_HW_MAX][IPA_REG_MAX] = {
		ipareg_construct_endp_init_cfg_n, ipareg_parse_dummy,
		0x00000808, 0x70, 0, 30, 1},
	[IPA_HW_v4_5][IPA_ENDP_INIT_DEAGGR_n] = {
		ipareg_construct_endp_init_deaggr_n,
		ipareg_construct_endp_init_deaggr_n_v4_5,
		ipareg_parse_dummy,
		0x00000834, 0x70, 0, 12, 1},
	[IPA_HW_v4_5][IPA_ENDP_INIT_CTRL_n] = {
+5 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */

#ifndef _IPAHAL_REG_I_H_
@@ -215,10 +215,14 @@ int ipahal_reg_init(enum ipa_hw_type ipa_hw_type);
/* IPA_ENDP_INIT_DEAGGR_n register */
#define IPA_ENDP_INIT_DEAGGR_n_MAX_PACKET_LEN_BMSK 0xFFFF0000
#define IPA_ENDP_INIT_DEAGGR_n_MAX_PACKET_LEN_SHFT 0x10
#define IPA_ENDP_INIT_DEAGGR_n_IGNORE_MIN_PKT_ERR_BMSK 0x4000
#define IPA_ENDP_INIT_DEAGGR_n_IGNORE_MIN_PKT_ERR_SHFT 0xe
#define IPA_ENDP_INIT_DEAGGR_n_PACKET_OFFSET_LOCATION_BMSK 0x3F00
#define IPA_ENDP_INIT_DEAGGR_n_PACKET_OFFSET_LOCATION_SHFT 0x8
#define IPA_ENDP_INIT_DEAGGR_n_PACKET_OFFSET_VALID_BMSK  0x80
#define IPA_ENDP_INIT_DEAGGR_n_PACKET_OFFSET_VALID_SHFT 0x7
#define IPA_ENDP_INIT_DEAGGR_n_SYSPIPE_ERR_DETECTION_BMSK 0x40
#define IPA_ENDP_INIT_DEAGGR_n_SYSPIPE_ERR_DETECTION_SHFT 0x6
#define IPA_ENDP_INIT_DEAGGR_n_DEAGGR_HDR_LEN_BMSK 0x3F
#define IPA_ENDP_INIT_DEAGGR_n_DEAGGR_HDR_LEN_SHFT 0x0

+11 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */

#ifndef _IPA_H_
@@ -350,18 +350,28 @@ struct ipa_ep_cfg_holb {
 * struct ipa_ep_cfg_deaggr - deaggregation configuration in IPA end-point
 * @deaggr_hdr_len: Deaggregation Header length in bytes. Valid only for Input
 *	Pipes, which are configured for 'Generic' deaggregation.
 * @syspipe_err_detection - If set to 1, enables error detection for
 *	de-aggregration. Valid only for Input Pipes, which are configured
 *	for 'Generic' deaggregation.
 *	Note: if this bit is set, de-aggregated frames must be contiguous
 *	in memory.
 * @packet_offset_valid: - 0: PACKET_OFFSET is not used, 1: PACKET_OFFSET is
 *	used.
 * @packet_offset_location: Location of packet offset field, which specifies
 *	the offset to the packet from the start of the packet offset field.
 * @ignore_min_pkt_err - Ignore packets smaller than header. This is intended
 *	for use in RNDIS de-aggregated pipes, to silently ignore a redundant
 *	1-byte trailer in MSFT implementation.
 * @max_packet_len: DEAGGR Max Packet Length in Bytes. A Packet with higher
 *	size wil be treated as an error. 0 - Packet Length is not Bound,
 *	IPA should not check for a Max Packet Length.
 */
struct ipa_ep_cfg_deaggr {
	u32 deaggr_hdr_len;
	bool syspipe_err_detection;
	bool packet_offset_valid;
	u32 packet_offset_location;
	bool ignore_min_pkt_err;
	u32 max_packet_len;
};