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

Commit 3a010068 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Make fixes to Memory Device mode"

parents f5d6c791 1cd8e834
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -25,11 +25,13 @@
#include "diag_memorydevice.h"
#include "diagfwd_bridge.h"
#include "diag_mux.h"
#include "diagmem.h"

struct diag_md_info diag_md[NUM_DIAG_MD_DEV] = {
	{
		.id = DIAG_MD_LOCAL,
		.ctx = 0,
		.mempool = POOL_TYPE_MUX_APPS,
		.num_tbl_entries = 0,
		.tbl = NULL,
		.ops = NULL,
@@ -38,6 +40,7 @@ struct diag_md_info diag_md[NUM_DIAG_MD_DEV] = {
	{
		.id = DIAG_MD_MDM,
		.ctx = 0,
		.mempool = POOL_TYPE_MDM_MUX,
		.num_tbl_entries = 0,
		.tbl = NULL,
		.ops = NULL,
@@ -45,6 +48,7 @@ struct diag_md_info diag_md[NUM_DIAG_MD_DEV] = {
	{
		.id = DIAG_MD_MDM2,
		.ctx = 0,
		.mempool = POOL_TYPE_MDM2_MUX,
		.num_tbl_entries = 0,
		.tbl = NULL,
		.ops = NULL,
@@ -52,6 +56,7 @@ struct diag_md_info diag_md[NUM_DIAG_MD_DEV] = {
	{
		.id = DIAG_MD_SMUX,
		.ctx = 0,
		.mempool = POOL_TYPE_QSC_MUX,
		.num_tbl_entries = 0,
		.tbl = NULL,
		.ops = NULL,
@@ -241,7 +246,7 @@ int diag_md_init()

	for (i = 0; i < NUM_DIAG_MD_DEV; i++) {
		ch = &diag_md[i];
		ch->num_tbl_entries = driver->poolsize;
		ch->num_tbl_entries = diag_mempools[ch->mempool].poolsize;
		ch->tbl = kzalloc(ch->num_tbl_entries *
				  sizeof(struct diag_buf_tbl_t),
				  GFP_KERNEL);
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ struct diag_buf_tbl_t {
struct diag_md_info {
	int id;
	int ctx;
	int mempool;
	int num_tbl_entries;
	struct diag_buf_tbl_t *tbl;
	struct diag_mux_ops *ops;
+4 −4
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ struct diag_usb_info diag_usb[NUM_DIAG_USB_DEV] = {
		.name = DIAG_LEGACY,
		.connected = 0,
		.enabled = 0,
		.mempool = POOL_TYPE_USB_APPS,
		.mempool = POOL_TYPE_MUX_APPS,
		.hdl = NULL,
		.ops = NULL,
		.read_buf = NULL,
@@ -52,7 +52,7 @@ struct diag_usb_info diag_usb[NUM_DIAG_USB_DEV] = {
		.name = DIAG_MDM,
		.connected = 0,
		.enabled = 0,
		.mempool = POOL_TYPE_MDM_USB,
		.mempool = POOL_TYPE_MDM_MUX,
		.hdl = NULL,
		.ops = NULL,
		.read_buf = NULL,
@@ -67,7 +67,7 @@ struct diag_usb_info diag_usb[NUM_DIAG_USB_DEV] = {
		.name = DIAG_MDM2,
		.connected = 0,
		.enabled = 0,
		.mempool = POOL_TYPE_MDM2_USB,
		.mempool = POOL_TYPE_MDM2_MUX,
		.hdl = NULL,
		.ops = NULL,
		.read_buf = NULL,
@@ -82,7 +82,7 @@ struct diag_usb_info diag_usb[NUM_DIAG_USB_DEV] = {
		.name = DIAG_QSC,
		.connected = 0,
		.enabled = 0,
		.mempool = POOL_TYPE_QSC_USB,
		.mempool = POOL_TYPE_QSC_MUX,
		.hdl = NULL,
		.ops = NULL,
		.read_buf = NULL,
+6 −6
Original line number Diff line number Diff line
@@ -608,13 +608,13 @@ static int diag_remote_init(void)
	diagmem_setsize(POOL_TYPE_MDM_DCI, itemsize_mdm_dci, poolsize_mdm_dci);
	diagmem_setsize(POOL_TYPE_MDM2_DCI, itemsize_mdm_dci,
			poolsize_mdm_dci);
	diagmem_setsize(POOL_TYPE_MDM_USB, itemsize_mdm_usb, poolsize_mdm_usb);
	diagmem_setsize(POOL_TYPE_MDM2_USB, itemsize_mdm_usb, poolsize_mdm_usb);
	diagmem_setsize(POOL_TYPE_MDM_MUX, itemsize_mdm_usb, poolsize_mdm_usb);
	diagmem_setsize(POOL_TYPE_MDM2_MUX, itemsize_mdm_usb, poolsize_mdm_usb);
	diagmem_setsize(POOL_TYPE_MDM_DCI_WRITE, itemsize_mdm_dci_write,
			poolsize_mdm_dci_write);
	diagmem_setsize(POOL_TYPE_MDM2_DCI_WRITE, itemsize_mdm_dci_write,
			poolsize_mdm_dci_write);
	diagmem_setsize(POOL_TYPE_QSC_USB, itemsize_qsc_usb,
	diagmem_setsize(POOL_TYPE_QSC_MUX, itemsize_qsc_usb,
			poolsize_qsc_usb);
	driver->cb_buf = kzalloc(HDLC_OUT_BUF_SIZE, GFP_KERNEL);
	if (!driver->cb_buf)
@@ -2285,13 +2285,13 @@ static int __init diagchar_init(void)
	diagmem_setsize(POOL_TYPE_HDLC, itemsize_hdlc, poolsize_hdlc);
	diagmem_setsize(POOL_TYPE_USER, itemsize_user, poolsize_user);
	/*
	 * POOL_TYPE_USB_APPS is for USB write structures for the Local
	 * USB channel. The number of items encompasses Diag data generated on
	 * POOL_TYPE_MUX_APPS is for the buffers in the Diag MUX layer.
	 * The number of buffers encompasses Diag data generated on
	 * the Apss processor + 1 for the responses generated exclusively on
	 * the Apps processor + data from SMD data channels (2 channels per
	 * peripheral) + data from SMD command channels
	 */
	diagmem_setsize(POOL_TYPE_USB_APPS, itemsize_usb_apps,
	diagmem_setsize(POOL_TYPE_MUX_APPS, itemsize_usb_apps,
			poolsize_usb_apps + 1 + (NUM_SMD_DATA_CHANNELS * 2) +
			NUM_SMD_CMD_CHANNELS);
	diagmem_setsize(POOL_TYPE_DCI, itemsize_dci, poolsize_dci);
+8 −8
Original line number Diff line number Diff line
@@ -52,8 +52,8 @@ struct diag_mempool_t diag_mempools[NUM_MEMORY_POOLS] = {
		.count = 0
	},
	{
		.id = POOL_TYPE_USB_APPS,
		.name = "POOL_USB_APPS",
		.id = POOL_TYPE_MUX_APPS,
		.name = "POOL_MUX_APPS",
		.pool = NULL,
		.itemsize = 0,
		.poolsize = 0,
@@ -101,16 +101,16 @@ struct diag_mempool_t diag_mempools[NUM_MEMORY_POOLS] = {
		.count = 0
	},
	{
		.id = POOL_TYPE_MDM_USB,
		.name = "POOL_MDM_USB",
		.id = POOL_TYPE_MDM_MUX,
		.name = "POOL_MDM_MUX",
		.pool = NULL,
		.itemsize = 0,
		.poolsize = 0,
		.count = 0
	},
	{
		.id = POOL_TYPE_MDM2_USB,
		.name = "POOL_MDM2_USB",
		.id = POOL_TYPE_MDM2_MUX,
		.name = "POOL_MDM2_MUX",
		.pool = NULL,
		.itemsize = 0,
		.poolsize = 0,
@@ -133,8 +133,8 @@ struct diag_mempool_t diag_mempools[NUM_MEMORY_POOLS] = {
		.count = 0
	},
	{
		.id = POOL_TYPE_QSC_USB,
		.name = "POOL_QSC_USB",
		.id = POOL_TYPE_QSC_MUX,
		.name = "POOL_QSC_MUX",
		.pool = NULL,
		.itemsize = 0,
		.poolsize = 0,
Loading