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

Commit 1d01ae52 authored by Ravi Aravamudhan's avatar Ravi Aravamudhan Committed by Matt Wagantall
Browse files

diag: Account for token offset while writing buffers to processors



While sending data to remote processors, the token is stripped off
from the buffer. Diag driver must account for this offset while
checking against the original buffer on write complete.

Change-Id: If2fffbafdcc5fcf2c037090fbb0e37bf0836971b
Signed-off-by: default avatarRavi Aravamudhan <aravamud@codeaurora.org>
parent 0505f577
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -235,7 +235,12 @@ int diag_remote_dev_write_done(int id, unsigned char *buf, int len, int ctxt)
	if (bridge_info[id].type == DIAG_DATA_TYPE) {
		if (buf == driver->cb_buf)
			driver->cb_buf_len = 0;
		if (buf == driver->user_space_data_buf)
		/*
		 * For remote processor, the token offset is stripped from the
		 * buffer. Account for the token offset while checking against
		 * the original buffer
		 */
		if (buf == (driver->user_space_data_buf + sizeof(int)))
			driver->user_space_data_busy = 0;
		err = diag_mux_queue_read(BRIDGE_TO_MUX(id));
	} else {