Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -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 | |
| 13 | #ifndef __U_RMNET_H |
| 14 | #define __U_RMNET_H |
| 15 | |
| 16 | #include <linux/usb/composite.h> |
| 17 | #include <linux/usb/cdc.h> |
| 18 | #include <linux/wait.h> |
| 19 | #include <linux/workqueue.h> |
| 20 | |
| 21 | struct rmnet_ctrl_pkt { |
| 22 | void *buf; |
| 23 | int len; |
| 24 | struct list_head list; |
| 25 | }; |
| 26 | |
| 27 | struct grmnet { |
| 28 | struct usb_function func; |
| 29 | |
| 30 | struct usb_ep *in; |
| 31 | struct usb_ep *out; |
| 32 | struct usb_endpoint_descriptor *in_desc; |
| 33 | struct usb_endpoint_descriptor *out_desc; |
| 34 | |
| 35 | /* to usb host, aka laptop, windows pc etc. Will |
| 36 | * be filled by usb driver of rmnet functionality |
| 37 | */ |
| 38 | int (*send_cpkt_response)(struct grmnet *g, |
| 39 | struct rmnet_ctrl_pkt *pkt); |
| 40 | |
| 41 | /* to modem, and to be filled by driver implementing |
| 42 | * control function |
| 43 | */ |
| 44 | int (*send_cpkt_request)(struct grmnet *g, |
| 45 | u8 port_num, |
| 46 | struct rmnet_ctrl_pkt *pkt); |
| 47 | |
| 48 | void (*send_cbits_tomodem)(struct grmnet *g, |
| 49 | u8 port_num, |
| 50 | int cbits); |
Vamsi Krishna | 9e9921a | 2011-10-04 16:09:31 -0700 | [diff] [blame] | 51 | |
| 52 | void (*disconnect)(struct grmnet *g); |
| 53 | void (*connect)(struct grmnet *g); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | int gbam_setup(unsigned int count); |
| 57 | int gbam_connect(struct grmnet *, u8 port_num); |
| 58 | void gbam_disconnect(struct grmnet *, u8 port_num); |
| 59 | |
| 60 | int gsmd_ctrl_connect(struct grmnet *gr, int port_num); |
| 61 | void gsmd_ctrl_disconnect(struct grmnet *gr, u8 port_num); |
| 62 | int gsmd_ctrl_setup(unsigned int count); |
| 63 | |
| 64 | #endif /* __U_RMNET_H*/ |