Amit Blay | f9b352b | 2013-03-04 15:01:40 +0200 | [diff] [blame] | 1 | /* Copyright (c) 2013, The Linux Foundation. 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 | |
| 13 | #ifndef __U_BAM_DATA_H |
| 14 | #define __U_BAM_DATA_H |
| 15 | |
| 16 | #include <mach/usb_gadget_xport.h> |
| 17 | |
| 18 | enum function_type { |
| 19 | USB_FUNC_ECM, |
| 20 | USB_FUNC_MBIM, |
| 21 | USB_FUNC_RNDIS, |
| 22 | }; |
| 23 | |
| 24 | struct data_port { |
| 25 | struct usb_composite_dev *cdev; |
Anna Perel | a83ca80 | 2013-05-13 15:11:23 +0300 | [diff] [blame] | 26 | struct usb_function *func; |
Amit Blay | f9b352b | 2013-03-04 15:01:40 +0200 | [diff] [blame] | 27 | struct usb_ep *in; |
| 28 | struct usb_ep *out; |
| 29 | }; |
| 30 | |
| 31 | void bam_data_disconnect(struct data_port *gr, u8 port_num); |
| 32 | |
| 33 | int bam_data_connect(struct data_port *gr, u8 port_num, |
Shimrit Malichi | dbf43d7 | 2013-03-16 03:32:27 +0200 | [diff] [blame] | 34 | enum transport_type trans, u8 src_connection_idx, |
| 35 | u8 dst_connection_idx, enum function_type func); |
Amit Blay | f9b352b | 2013-03-04 15:01:40 +0200 | [diff] [blame] | 36 | |
| 37 | int bam_data_setup(unsigned int no_bam2bam_port); |
| 38 | |
Bar Weiner | 189bb3c | 2013-06-09 14:24:56 +0300 | [diff] [blame] | 39 | int bam_data_destroy(unsigned int no_bam2bam_port); |
| 40 | |
Amit Blay | f9b352b | 2013-03-04 15:01:40 +0200 | [diff] [blame] | 41 | void bam_data_suspend(u8 port_num); |
| 42 | |
| 43 | void bam_data_resume(u8 port_num); |
| 44 | |
| 45 | #endif /* __U_BAM_DATA_H */ |