blob: d1e36056eaf049f9a018442b8de84a93dd44d1db [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* include/asm-arm/arch-msm/usbdiag.h
2 *
3 * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
4 *
5 * All source code in this file is licensed under the following license except
6 * where indicated.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 *
16 * See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you can find it at http://www.fsf.org
19 */
20
21#ifndef _DRIVERS_USB_DIAG_H_
22#define _DRIVERS_USB_DIAG_H_
23
24#define DIAG_LEGACY "diag"
25#define DIAG_MDM "diag_mdm"
26
27#define USB_DIAG_CONNECT 0
28#define USB_DIAG_DISCONNECT 1
29#define USB_DIAG_WRITE_DONE 2
30#define USB_DIAG_READ_DONE 3
31
32struct diag_request {
33 char *buf;
34 int length;
35 int actual;
36 int status;
37 void *context;
38};
39
40struct usb_diag_ch {
41 const char *name;
42 struct list_head list;
43 void (*notify)(void *priv, unsigned event, struct diag_request *d_req);
44 void *priv;
45 void *priv_usb;
46};
47
48struct usb_diag_ch *usb_diag_open(const char *name, void *priv,
49 void (*notify)(void *, unsigned, struct diag_request *));
50void usb_diag_close(struct usb_diag_ch *ch);
51int usb_diag_alloc_req(struct usb_diag_ch *ch, int n_write, int n_read);
52void usb_diag_free_req(struct usb_diag_ch *ch);
53int usb_diag_read(struct usb_diag_ch *ch, struct diag_request *d_req);
54int usb_diag_write(struct usb_diag_ch *ch, struct diag_request *d_req);
55
56int diag_read_from_cb(unsigned char * , int);
57
58#endif /* _DRIVERS_USB_DIAG_H_ */