Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* 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 | |
| 32 | struct diag_request { |
| 33 | char *buf; |
| 34 | int length; |
| 35 | int actual; |
| 36 | int status; |
| 37 | void *context; |
| 38 | }; |
| 39 | |
| 40 | struct 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 | |
| 48 | struct usb_diag_ch *usb_diag_open(const char *name, void *priv, |
| 49 | void (*notify)(void *, unsigned, struct diag_request *)); |
| 50 | void usb_diag_close(struct usb_diag_ch *ch); |
| 51 | int usb_diag_alloc_req(struct usb_diag_ch *ch, int n_write, int n_read); |
| 52 | void usb_diag_free_req(struct usb_diag_ch *ch); |
| 53 | int usb_diag_read(struct usb_diag_ch *ch, struct diag_request *d_req); |
| 54 | int usb_diag_write(struct usb_diag_ch *ch, struct diag_request *d_req); |
| 55 | |
| 56 | int diag_read_from_cb(unsigned char * , int); |
| 57 | |
| 58 | #endif /* _DRIVERS_USB_DIAG_H_ */ |