blob: cea9369fbfe3b587f4bdb07379d0b66bdd96468d [file] [log] [blame]
Bar Weiner0dae81b2013-02-14 13:53:54 +02001/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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
21struct rmnet_ctrl_pkt {
22 void *buf;
23 int len;
24 struct list_head list;
25};
26
27struct grmnet {
28 struct usb_function func;
29
30 struct usb_ep *in;
31 struct usb_ep *out;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070032
33 /* to usb host, aka laptop, windows pc etc. Will
34 * be filled by usb driver of rmnet functionality
35 */
Hemant Kumarf60c0252011-11-03 12:37:07 -070036 int (*send_cpkt_response)(void *g, void *buf, size_t len);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070037
38 /* to modem, and to be filled by driver implementing
39 * control function
40 */
Hemant Kumarf60c0252011-11-03 12:37:07 -070041 int (*send_encap_cmd)(u8 port_num, void *buf, size_t len);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070042
Hemant Kumarf60c0252011-11-03 12:37:07 -070043 void (*notify_modem)(void *g, u8 port_num, int cbits);
Vamsi Krishna9e9921a2011-10-04 16:09:31 -070044
45 void (*disconnect)(struct grmnet *g);
46 void (*connect)(struct grmnet *g);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070047};
48
Ofir Cohena1c2a872011-12-14 10:26:34 +020049int gbam_setup(unsigned int no_bam_port, unsigned int no_bam2bam_port);
50int gbam_connect(struct grmnet *gr, u8 port_num,
Ofir Cohen77848d62012-12-05 13:16:10 +020051 enum transport_type trans, u8 connection_idx);
52void gbam_disconnect(struct grmnet *gr, u8 port_num, enum transport_type trans);
Amit Blaye5bb35e2012-05-08 20:38:20 +030053void gbam_suspend(struct grmnet *gr, u8 port_num, enum transport_type trans);
54void gbam_resume(struct grmnet *gr, u8 port_num, enum transport_type trans);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055int gsmd_ctrl_connect(struct grmnet *gr, int port_num);
56void gsmd_ctrl_disconnect(struct grmnet *gr, u8 port_num);
57int gsmd_ctrl_setup(unsigned int count);
Bar Weiner0dae81b2013-02-14 13:53:54 +020058int gqti_ctrl_connect(struct grmnet *gr);
59void gqti_ctrl_disconnect(struct grmnet *gr);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070060
61#endif /* __U_RMNET_H*/