Chandana Kishori Chiluveru | 50a2184 | 2017-11-06 14:54:24 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2011-2017, The Linux Foundation. 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 | #include "f_qdss.h" |
| 22 | |
| 23 | struct rmnet_ctrl_pkt { |
| 24 | void *buf; |
| 25 | int len; |
| 26 | struct list_head list; |
| 27 | }; |
| 28 | |
| 29 | struct grmnet { |
| 30 | /* to usb host, aka laptop, windows pc etc. Will |
| 31 | * be filled by usb driver of rmnet functionality |
| 32 | */ |
| 33 | int (*send_cpkt_response)(void *g, void *buf, size_t len); |
| 34 | |
| 35 | /* to modem, and to be filled by driver implementing |
| 36 | * control function |
| 37 | */ |
| 38 | int (*send_encap_cmd)(enum qti_port_type qport, void *buf, size_t len); |
| 39 | void (*notify_modem)(void *g, enum qti_port_type qport, int cbits); |
| 40 | |
| 41 | void (*disconnect)(struct grmnet *g); |
| 42 | void (*connect)(struct grmnet *g); |
| 43 | }; |
| 44 | |
| 45 | enum ctrl_client { |
| 46 | FRMNET_CTRL_CLIENT, |
| 47 | GPS_CTRL_CLIENT, |
| 48 | |
| 49 | NR_CTRL_CLIENTS |
| 50 | }; |
| 51 | |
| 52 | int gqti_ctrl_connect(void *gr, enum qti_port_type qport, unsigned int intf); |
| 53 | void gqti_ctrl_disconnect(void *gr, enum qti_port_type qport); |
| 54 | int gqti_ctrl_init(void); |
| 55 | void gqti_ctrl_cleanup(void); |
| 56 | #endif /* __U_RMNET_H*/ |