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

Commit f229afbc authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

diag: Configure diag over STM for APPS by HW ACCEL command



Extend support to configure diag over STM using HW ACCEL command
for APPS.

Change-Id: Ifd9bf9867e910e9df4e1b6bddd94012c82f2be4f
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 84b56d3a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2020, The Linux Foundation. All rights reserved.
 */

#ifndef DIAGFWD_H
@@ -44,4 +44,6 @@ void diag_update_pkt_buffer(unsigned char *buf, uint32_t len, int type);
int diag_process_stm_cmd(unsigned char *buf, unsigned char *dest_buf);
void diag_md_hdlc_reset_timer_func(struct timer_list *tlist);
void diag_update_md_clients(unsigned int type);
void diag_process_stm_mask(uint8_t cmd, uint8_t data_mask,
	int data_type);
#endif
+10 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -1894,12 +1894,18 @@ int diag_send_passthru_ctrl_pkt(struct diag_hw_accel_cmd_req_t *req_params)
			pr_err("diag: Unable to send PASSTHRU ctrl packet to peripheral %d, err: %d\n",
				i, err);
	}
	if ((diagid_mask & DIAG_ID_APPS) &&
		(hw_accel_type == DIAG_HW_ACCEL_TYPE_STM)) {
		diag_process_stm_mask(req_params->operation,
			DIAG_STM_APPS, APPS_DATA);
	}
	return 0;
}

int diagfwd_cntl_init(void)
{
	uint8_t peripheral = 0;
	uint32_t diagid_mask = 0;

	driver->polling_reg_flag = 0;
	driver->log_on_demand_support = 1;
@@ -1920,6 +1926,9 @@ int diagfwd_cntl_init(void)
	if (!driver->cntl_wq)
		return -ENOMEM;

	diagid_mask = (BITMASK_DIAGID_FMASK | BITMASK_HW_ACCEL_STM_V1);
	process_diagid_v2_feature_mask(DIAG_ID_APPS, diagid_mask);

	return 0;
}

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

#ifndef DIAGFWD_CNTL_H
@@ -91,6 +91,10 @@
#define MAX_DIAGID_STR_LEN	30
#define MIN_DIAGID_STR_LEN	5

#define BITMASK_DIAGID_FMASK		0x0001
#define BITMASK_HW_ACCEL_STM_V1		0x0002
#define BITMASK_HW_ACCEL_ATB_V1		0x0004

struct diag_ctrl_pkt_header_t {
	uint32_t pkt_id;
	uint32_t len;