blob: 94a2c37b930a855d33442eae36decf7266d0277b [file] [log] [blame]
Shimrit Malichia00d7322012-08-05 13:56:28 +03001/* Copyright (c) 2012, 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 __LINUX_USB_QDSS_H
14#define __LINUX_USB_QDSS_H
15
16#include <linux/kernel.h>
17
18struct qdss_request {
19 char *buf;
20 int length;
21 int actual;
22 int status;
23 void *context;
24};
25
26struct 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
36enum 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
44struct usb_qdss_ch *usb_qdss_open(const char *name, void *priv,
45 void (*notify)(void *, unsigned, struct qdss_request *,
46 struct usb_qdss_ch *));
47void usb_qdss_close(struct usb_qdss_ch *ch);
48int usb_qdss_alloc_req(struct usb_qdss_ch *ch, int n_write, int n_read);
49void usb_qdss_free_req(struct usb_qdss_ch *ch);
50int usb_qdss_read(struct usb_qdss_ch *ch, struct qdss_request *d_req);
51int usb_qdss_write(struct usb_qdss_ch *ch, struct qdss_request *d_req);
52int usb_qdss_ctrl_write(struct usb_qdss_ch *ch, struct qdss_request *d_req);
53int usb_qdss_ctrl_read(struct usb_qdss_ch *ch, struct qdss_request *d_req);
54
55#endif