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

Commit 97cea5ca authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Check remote proc presence status"

parents 92aa9509 c96980a1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -319,7 +319,9 @@ uint16_t diag_get_remote_device_mask(void)

	for (i = 0; i < NUM_REMOTE_DEV; i++) {
		if (bridge_info[i].inited &&
		    bridge_info[i].type == DIAG_DATA_TYPE) {
		    bridge_info[i].type == DIAG_DATA_TYPE &&
		    (bridge_info[i].dev_ops->remote_proc_check &&
		    bridge_info[i].dev_ops->remote_proc_check())) {
			remote_dev |= 1 << i;
		}
	}
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ struct diag_remote_dev_ops {
	int (*queue_read)(int id);
	int (*write)(int id, unsigned char *buf, int len, int ctxt);
	int (*fwd_complete)(int id, unsigned char *buf, int len, int ctxt);
	int (*remote_proc_check)(void);
};

struct diagfwd_bridge_info {
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, 2016-2017 The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, 2016-2018 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
@@ -392,6 +392,7 @@ static struct diag_remote_dev_ops diag_hsic_fwd_ops = {
	.queue_read = hsic_queue_read,
	.write = hsic_write,
	.fwd_complete = hsic_fwd_complete,
	.remote_proc_check = NULL,
};

int diag_hsic_init(void)
+6 −0
Original line number Diff line number Diff line
@@ -515,6 +515,11 @@ static int mhi_fwd_complete(int id, unsigned char *buf, int len, int ctxt)
	return 0;
}

static int mhi_remote_proc_check(void)
{
	return diag_mhi[MHI_1].enabled;
}

static struct diag_mhi_info *diag_get_mhi_info(struct mhi_device *mhi_dev)
{
	struct diag_mhi_info *mhi_info = NULL;
@@ -635,6 +640,7 @@ static struct diag_remote_dev_ops diag_mhi_fwd_ops = {
	.queue_read = mhi_queue_read,
	.write = mhi_write,
	.fwd_complete = mhi_fwd_complete,
	.remote_proc_check = mhi_remote_proc_check,
};

static void diag_mhi_dev_exit(int dev)
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012, 2014, 2016 The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2014, 2016, 2018 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
@@ -275,6 +275,7 @@ static struct diag_remote_dev_ops diag_smux_fwd_ops = {
	.queue_read = smux_queue_read,
	.write = smux_write,
	.fwd_complete = smux_fwd_complete,
	.remote_proc_check = NULL,
};

int diag_smux_init(void)