blob: b06f020ef02fe9921700398503163042b5b598fa [file] [log] [blame]
Jack Phame32cf322011-09-26 10:20:17 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
Jack Phame32cf322011-09-26 10:20:17 -070013#ifndef __LINUX_USB_DIAG_BRIDGE_H__
14#define __LINUX_USB_DIAG_BRIDGE_H__
15
16struct diag_bridge_ops {
17 void *ctxt;
18 void (*read_complete_cb)(void *ctxt, char *buf,
Dixon Peterson32e70bb2011-12-16 13:26:45 -080019 int buf_size, int actual);
Jack Phame32cf322011-09-26 10:20:17 -070020 void (*write_complete_cb)(void *ctxt, char *buf,
Dixon Peterson32e70bb2011-12-16 13:26:45 -080021 int buf_size, int actual);
Jack Phamb60775a2012-02-14 17:57:41 -080022 int (*suspend)(void *ctxt);
23 void (*resume)(void *ctxt);
Jack Phame32cf322011-09-26 10:20:17 -070024};
25
Jack Phamf6ed5582011-11-02 16:08:31 -070026#if defined(CONFIG_USB_QCOM_DIAG_BRIDGE) \
27 || defined(CONFIG_USB_QCOM_DIAG_BRIDGE_MODULE)
28
Dixon Peterson32e70bb2011-12-16 13:26:45 -080029extern int diag_bridge_read(char *data, int size);
30extern int diag_bridge_write(char *data, int size);
Jack Phamf6ed5582011-11-02 16:08:31 -070031extern int diag_bridge_open(struct diag_bridge_ops *ops);
32extern void diag_bridge_close(void);
33
34#else
35
Dixon Peterson32e70bb2011-12-16 13:26:45 -080036static int __maybe_unused diag_bridge_read(char *data, int size)
Jack Phamf6ed5582011-11-02 16:08:31 -070037{
38 return -ENODEV;
39}
40
Dixon Peterson32e70bb2011-12-16 13:26:45 -080041static int __maybe_unused diag_bridge_write(char *data, int size)
Jack Phamf6ed5582011-11-02 16:08:31 -070042{
43 return -ENODEV;
44}
45
46static int __maybe_unused diag_bridge_open(struct diag_bridge_ops *ops)
47{
48 return -ENODEV;
49}
50
51static void __maybe_unused diag_bridge_close(void) { }
52
53#endif
Jack Phame32cf322011-09-26 10:20:17 -070054
55#endif