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

Commit 067a3d9a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: misc: Add snapshot of diag_ipc_bridge driver"

parents d70d62a2 d3e268e9
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -281,3 +281,27 @@ config USB_QTI_KS_BRIDGE
	  boot images, ram-dumps and efs sync.
	  To compile this driver as a module, choose M here: the module
	  will be called ks_bridge. If unsure, choose N.

config USB_QCOM_IPC_BRIDGE
	tristate "USB QTI IPC bridge driver"
	depends on USB
	depends on USB_QCOM_DIAG_BRIDGE
	help
	  Say Y here if you have a QTI modem device connected via USB that
	  will be bridged in kernel space. This driver works as a transport
	  layer for IPC router module that enables communication between
	  APPS processor and MODEM processor. This config depends on
	  USB_QCOM_DIAG_BRIDGE because the core USB support for the transports
	  of both diag and IPC messages is in the same driver. Select this
	  config manually if you want to compile HSIC transport IPC router.

config USB_QCOM_DIAG_BRIDGE
	tristate "USB QTI diagnostic bridge driver"
	depends on USB
	help
	  Say Y here if you have a QTI modem device connected via USB that
	  will be bridged in kernel space. This driver communicates with the
	  diagnostic interface and allows for bridging with the diag forwarding
	  driver.
	  To compile this driver as a module, choose M here: the
	  module will be called diag_bridge.  If unsure, choose N.
+1 −0
Original line number Diff line number Diff line
@@ -33,3 +33,4 @@ obj-$(CONFIG_USB_LINK_LAYER_TEST) += lvstest.o
obj-$(CONFIG_USB_REDRIVER_NB7VPQ904M)	+= ssusb-redriver-nb7vpq904m.o

obj-$(CONFIG_USB_QTI_KS_BRIDGE)		+= ks_bridge.o
obj-$(CONFIG_USB_QCOM_DIAG_BRIDGE)	+= diag_ipc_bridge.o
+888 −0

File added.

Preview size limit exceeded, changes collapsed.

+48 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2011, 2013, 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
 */

#ifndef __LINUX_USB_DIAG_BRIDGE_H__
#define __LINUX_USB_DIAG_BRIDGE_H__

struct diag_bridge_ops {
	void *ctxt;
	void (*read_complete_cb)(void *ctxt, char *buf,
			int buf_size, int actual);
	void (*write_complete_cb)(void *ctxt, char *buf,
			int buf_size, int actual);
	int (*suspend)(void *ctxt);
	void (*resume)(void *ctxt);
};

#if IS_ENABLED(CONFIG_USB_QCOM_DIAG_BRIDGE)

extern int diag_bridge_read(int id, char *data, int size);
extern int diag_bridge_write(int id, char *data, int size);
extern int diag_bridge_open(int id, struct diag_bridge_ops *ops);
extern void diag_bridge_close(int id);

#else

static int __maybe_unused diag_bridge_read(int id, char *data, int size)
{
	return -ENODEV;
}

static int __maybe_unused diag_bridge_write(int id, char *data, int size)
{
	return -ENODEV;
}

static int __maybe_unused diag_bridge_open(int id, struct diag_bridge_ops *ops)
{
	return -ENODEV;
}

static void __maybe_unused diag_bridge_close(int id) { }

#endif

#endif
+59 −0

File added.

Preview size limit exceeded, changes collapsed.