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 | */ |
Hemant Kumar | f60c025 | 2011-11-03 12:37:07 -0700 | [diff] [blame^] | 38 | int (*send_cpkt_response)(void *g, void *buf, size_t len); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 39 | |
| 40 | /* to modem, and to be filled by driver implementing |
| 41 | * control function |
| 42 | */ |
Hemant Kumar | f60c025 | 2011-11-03 12:37:07 -0700 | [diff] [blame^] | 43 | int (*send_encap_cmd)(u8 port_num, void *buf, size_t len); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 44 | |
Hemant Kumar | f60c025 | 2011-11-03 12:37:07 -0700 | [diff] [blame^] | 45 | void (*notify_modem)(void *g, u8 port_num, int cbits); |
Vamsi Krishna | 9e9921a | 2011-10-04 16:09:31 -0700 | [diff] [blame] | 46 | |
| 47 | void (*disconnect)(struct grmnet *g); |
| 48 | void (*connect)(struct grmnet *g); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | int gbam_setup(unsigned int count); |
| 52 | int gbam_connect(struct grmnet *, u8 port_num); |
| 53 | void gbam_disconnect(struct grmnet *, u8 port_num); |
| 54 | |
| 55 | int gsmd_ctrl_connect(struct grmnet *gr, int port_num); |
| 56 | void gsmd_ctrl_disconnect(struct grmnet *gr, u8 port_num); |
| 57 | int gsmd_ctrl_setup(unsigned int count); |
| 58 | |
| 59 | #endif /* __U_RMNET_H*/ |