diff options
| author | Ajay Agarwal <ajaya@codeaurora.org> | 2018-06-06 11:45:31 +0530 |
|---|---|---|
| committer | Ajay Agarwal <ajaya@codeaurora.org> | 2018-06-20 12:18:49 +0530 |
| commit | 60de9d752e977c72f7de73a99efe48392fbab8aa (patch) | |
| tree | 1c6a4d3a2971dd0136de77f75bd9b62d8c512948 /include/linux/usb/diag_bridge.h | |
| parent | 7faed80bafb67306fbee03806e4e3344dfa0e080 (diff) | |
usb: misc: Add snapshot of diag_bridge driver
Add diag_bridge driver which is used to communicate with the diag
and QMI interfaces exposed by Qualcomm devices. This snapshot is
taken as of msm-3.10 'commit d722f698a54e ("regulator: core: Fix
buffer overflow issue")'.
Also rename the diag_bridge driver to diag_ipc_bridge.c.
Change-Id: Ide503c5bf729a7e41de98b12c89e4edc12af61fe
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
Diffstat (limited to 'include/linux/usb/diag_bridge.h')
| -rw-r--r-- | include/linux/usb/diag_bridge.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/include/linux/usb/diag_bridge.h b/include/linux/usb/diag_bridge.h new file mode 100644 index 000000000000..e82c65330722 --- /dev/null +++ b/include/linux/usb/diag_bridge.h @@ -0,0 +1,54 @@ +/* Copyright (c) 2011, 2013, 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 + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#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 |
