Bar Weiner | 0dae81b | 2013-02-14 13:53:54 +0200 | [diff] [blame] | 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 32 | |
| 33 | /* to usb host, aka laptop, windows pc etc. Will |
| 34 | * be filled by usb driver of rmnet functionality |
| 35 | */ |
Hemant Kumar | f60c025 | 2011-11-03 12:37:07 -0700 | [diff] [blame] | 36 | int (*send_cpkt_response)(void *g, void *buf, size_t len); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 37 | |
| 38 | /* to modem, and to be filled by driver implementing |
| 39 | * control function |
| 40 | */ |
Hemant Kumar | f60c025 | 2011-11-03 12:37:07 -0700 | [diff] [blame] | 41 | int (*send_encap_cmd)(u8 port_num, void *buf, size_t len); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 42 | |
Hemant Kumar | f60c025 | 2011-11-03 12:37:07 -0700 | [diff] [blame] | 43 | void (*notify_modem)(void *g, u8 port_num, int cbits); |
Vamsi Krishna | 9e9921a | 2011-10-04 16:09:31 -0700 | [diff] [blame] | 44 | |
| 45 | void (*disconnect)(struct grmnet *g); |
| 46 | void (*connect)(struct grmnet *g); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
Ofir Cohen | a1c2a87 | 2011-12-14 10:26:34 +0200 | [diff] [blame] | 49 | int gbam_setup(unsigned int no_bam_port, unsigned int no_bam2bam_port); |
| 50 | int gbam_connect(struct grmnet *gr, u8 port_num, |
Ofir Cohen | 77848d6 | 2012-12-05 13:16:10 +0200 | [diff] [blame] | 51 | enum transport_type trans, u8 connection_idx); |
| 52 | void gbam_disconnect(struct grmnet *gr, u8 port_num, enum transport_type trans); |
Amit Blay | e5bb35e | 2012-05-08 20:38:20 +0300 | [diff] [blame] | 53 | void gbam_suspend(struct grmnet *gr, u8 port_num, enum transport_type trans); |
| 54 | void gbam_resume(struct grmnet *gr, u8 port_num, enum transport_type trans); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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); |
Bar Weiner | 0dae81b | 2013-02-14 13:53:54 +0200 | [diff] [blame] | 58 | int gqti_ctrl_connect(struct grmnet *gr); |
| 59 | void gqti_ctrl_disconnect(struct grmnet *gr); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 60 | |
| 61 | #endif /* __U_RMNET_H*/ |