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

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

diag: Add support for querying supported peripheral information



The patch adds support for an IOCTL querying the supported
peripheral information in present kernel version.

Change-Id: I2c1533b5f0cc2ec7826db8a07e8bd68724d02569
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent c426bc6f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -473,6 +473,11 @@ struct diag_logging_mode_param_t {
	int peripheral;
} __packed;

struct diag_con_all_param_t {
	uint32_t diag_con_all;
	uint32_t num_peripherals;
};

struct diag_md_session_t {
	int pid;
	int peripheral_mask;
+20 −0
Original line number Diff line number Diff line
@@ -2480,6 +2480,7 @@ long diagchar_compat_ioctl(struct file *filp,
	uint16_t remote_dev;
	struct diag_dci_client_tbl *dci_client = NULL;
	struct diag_logging_mode_param_t mode_param;
	struct diag_con_all_param_t con_param;

	switch (iocmd) {
	case DIAG_IOCTL_COMMAND_REG:
@@ -2598,6 +2599,15 @@ long diagchar_compat_ioctl(struct file *filp,
			return -EFAULT;
		result = diag_ioctl_query_pd_logging(&mode_param);
		break;
	case DIAG_IOCTL_QUERY_CON_ALL:
		con_param.diag_con_all = DIAG_CON_ALL;
		con_param.num_peripherals = NUM_PERIPHERALS;
		if (copy_to_user((void __user *)ioarg, &con_param,
				sizeof(struct diag_con_all_param_t)))
			result = -EFAULT;
		else
			result = 0;
		break;
	}
	return result;
}
@@ -2612,6 +2622,7 @@ long diagchar_ioctl(struct file *filp,
	uint16_t remote_dev;
	struct diag_dci_client_tbl *dci_client = NULL;
	struct diag_logging_mode_param_t mode_param;
	struct diag_con_all_param_t con_param;

	switch (iocmd) {
	case DIAG_IOCTL_COMMAND_REG:
@@ -2730,6 +2741,15 @@ long diagchar_ioctl(struct file *filp,
			return -EFAULT;
		result = diag_ioctl_query_pd_logging(&mode_param);
		break;
	case DIAG_IOCTL_QUERY_CON_ALL:
		con_param.diag_con_all = DIAG_CON_ALL;
		con_param.num_peripherals = NUM_PERIPHERALS;
		if (copy_to_user((void __user *)ioarg, &con_param,
				sizeof(struct diag_con_all_param_t)))
			result = -EFAULT;
		else
			result = 0;
		break;
	}
	return result;
}
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@
#define DIAG_IOCTL_REGISTER_CALLBACK	37
#define DIAG_IOCTL_HDLC_TOGGLE	38
#define DIAG_IOCTL_QUERY_PD_LOGGING	39
#define DIAG_IOCTL_QUERY_CON_ALL	40

/* PC Tools IDs */
#define APQ8060_TOOLS_ID	4062