Jack Pham | e32cf32 | 2011-09-26 10:20:17 -0700 | [diff] [blame] | 1 | /* 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 Pham | e32cf32 | 2011-09-26 10:20:17 -0700 | [diff] [blame] | 13 | #ifndef __LINUX_USB_DIAG_BRIDGE_H__ |
| 14 | #define __LINUX_USB_DIAG_BRIDGE_H__ |
| 15 | |
| 16 | struct diag_bridge_ops { |
| 17 | void *ctxt; |
| 18 | void (*read_complete_cb)(void *ctxt, char *buf, |
Dixon Peterson | 32e70bb | 2011-12-16 13:26:45 -0800 | [diff] [blame] | 19 | int buf_size, int actual); |
Jack Pham | e32cf32 | 2011-09-26 10:20:17 -0700 | [diff] [blame] | 20 | void (*write_complete_cb)(void *ctxt, char *buf, |
Dixon Peterson | 32e70bb | 2011-12-16 13:26:45 -0800 | [diff] [blame] | 21 | int buf_size, int actual); |
Jack Pham | b60775a | 2012-02-14 17:57:41 -0800 | [diff] [blame] | 22 | int (*suspend)(void *ctxt); |
| 23 | void (*resume)(void *ctxt); |
Jack Pham | e32cf32 | 2011-09-26 10:20:17 -0700 | [diff] [blame] | 24 | }; |
| 25 | |
Jack Pham | f6ed558 | 2011-11-02 16:08:31 -0700 | [diff] [blame] | 26 | #if defined(CONFIG_USB_QCOM_DIAG_BRIDGE) \ |
| 27 | || defined(CONFIG_USB_QCOM_DIAG_BRIDGE_MODULE) |
| 28 | |
Dixon Peterson | 32e70bb | 2011-12-16 13:26:45 -0800 | [diff] [blame] | 29 | extern int diag_bridge_read(char *data, int size); |
| 30 | extern int diag_bridge_write(char *data, int size); |
Jack Pham | f6ed558 | 2011-11-02 16:08:31 -0700 | [diff] [blame] | 31 | extern int diag_bridge_open(struct diag_bridge_ops *ops); |
| 32 | extern void diag_bridge_close(void); |
| 33 | |
| 34 | #else |
| 35 | |
Dixon Peterson | 32e70bb | 2011-12-16 13:26:45 -0800 | [diff] [blame] | 36 | static int __maybe_unused diag_bridge_read(char *data, int size) |
Jack Pham | f6ed558 | 2011-11-02 16:08:31 -0700 | [diff] [blame] | 37 | { |
| 38 | return -ENODEV; |
| 39 | } |
| 40 | |
Dixon Peterson | 32e70bb | 2011-12-16 13:26:45 -0800 | [diff] [blame] | 41 | static int __maybe_unused diag_bridge_write(char *data, int size) |
Jack Pham | f6ed558 | 2011-11-02 16:08:31 -0700 | [diff] [blame] | 42 | { |
| 43 | return -ENODEV; |
| 44 | } |
| 45 | |
| 46 | static int __maybe_unused diag_bridge_open(struct diag_bridge_ops *ops) |
| 47 | { |
| 48 | return -ENODEV; |
| 49 | } |
| 50 | |
| 51 | static void __maybe_unused diag_bridge_close(void) { } |
| 52 | |
| 53 | #endif |
Jack Pham | e32cf32 | 2011-09-26 10:20:17 -0700 | [diff] [blame] | 54 | |
| 55 | #endif |