blob: 3c21316d71c7eb2402c393b4f27744fedeb6ff41 [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 */
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 Krishna9e9921a2011-10-04 16:09:31 -070051
52 void (*disconnect)(struct grmnet *g);
53 void (*connect)(struct grmnet *g);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070054};
55
56int gbam_setup(unsigned int count);
57int gbam_connect(struct grmnet *, u8 port_num);
58void gbam_disconnect(struct grmnet *, u8 port_num);
59
60int gsmd_ctrl_connect(struct grmnet *gr, int port_num);
61void gsmd_ctrl_disconnect(struct grmnet *gr, u8 port_num);
62int gsmd_ctrl_setup(unsigned int count);
63
64#endif /* __U_RMNET_H*/