| Duy Truong | e833aca | 2013-02-12 13:35:08 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. | 
| Shimrit Malichi | a00d732 | 2012-08-05 13:56:28 +0300 | [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 __LINUX_USB_QDSS_H | 
 | 14 | #define __LINUX_USB_QDSS_H | 
 | 15 |  | 
 | 16 | #include <linux/kernel.h> | 
 | 17 |  | 
 | 18 | struct qdss_request { | 
 | 19 | 	char *buf; | 
 | 20 | 	int length; | 
 | 21 | 	int actual; | 
 | 22 | 	int status; | 
 | 23 | 	void *context; | 
 | 24 | }; | 
 | 25 |  | 
 | 26 | struct usb_qdss_ch { | 
 | 27 | 	const char *name; | 
 | 28 | 	struct list_head list; | 
 | 29 | 	void (*notify)(void *priv, unsigned event, struct qdss_request *d_req, | 
 | 30 | 		struct usb_qdss_ch *); | 
 | 31 | 	void *priv; | 
 | 32 | 	void *priv_usb; | 
 | 33 | 	int app_conn; | 
 | 34 | }; | 
 | 35 |  | 
 | 36 | enum qdss_state { | 
 | 37 | 	USB_QDSS_CONNECT, | 
 | 38 | 	USB_QDSS_DISCONNECT, | 
 | 39 | 	USB_QDSS_CTRL_READ_DONE, | 
 | 40 | 	USB_QDSS_DATA_WRITE_DONE, | 
 | 41 | 	USB_QDSS_CTRL_WRITE_DONE, | 
 | 42 | }; | 
 | 43 |  | 
 | 44 | struct usb_qdss_ch *usb_qdss_open(const char *name, void *priv, | 
 | 45 | 	void (*notify)(void *, unsigned, struct qdss_request *, | 
 | 46 | 		struct usb_qdss_ch *)); | 
 | 47 | void usb_qdss_close(struct usb_qdss_ch *ch); | 
 | 48 | int usb_qdss_alloc_req(struct usb_qdss_ch *ch, int n_write, int n_read); | 
 | 49 | void usb_qdss_free_req(struct usb_qdss_ch *ch); | 
 | 50 | int usb_qdss_read(struct usb_qdss_ch *ch, struct qdss_request *d_req); | 
 | 51 | int usb_qdss_write(struct usb_qdss_ch *ch, struct qdss_request *d_req); | 
 | 52 | int usb_qdss_ctrl_write(struct usb_qdss_ch *ch, struct qdss_request *d_req); | 
 | 53 | int usb_qdss_ctrl_read(struct usb_qdss_ch *ch, struct qdss_request *d_req); | 
 | 54 |  | 
 | 55 | #endif |