blob: d8de31ee58e9c394ebc67e990c06421b105747d1 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* 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
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;
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 Kumarf60c0252011-11-03 12:37:07 -070038 int (*send_cpkt_response)(void *g, void *buf, size_t len);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070039
40 /* to modem, and to be filled by driver implementing
41 * control function
42 */
Hemant Kumarf60c0252011-11-03 12:37:07 -070043 int (*send_encap_cmd)(u8 port_num, void *buf, size_t len);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070044
Hemant Kumarf60c0252011-11-03 12:37:07 -070045 void (*notify_modem)(void *g, u8 port_num, int cbits);
Vamsi Krishna9e9921a2011-10-04 16:09:31 -070046
47 void (*disconnect)(struct grmnet *g);
48 void (*connect)(struct grmnet *g);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049};
50
51int gbam_setup(unsigned int count);
52int gbam_connect(struct grmnet *, u8 port_num);
53void gbam_disconnect(struct grmnet *, u8 port_num);
54
55int 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);
58
59#endif /* __U_RMNET_H*/