blob: d2a6085345bec8c2e927115389efc46bfbad3019 [file] [log] [blame]
Chris Kellyb3147862012-02-20 21:12:08 +00001/* -----------------------------------------------------------------------------
2 * Copyright (c) 2011 Ozmo Inc
3 * Released under the GNU General Public License Version 2 (GPLv2).
4 * -----------------------------------------------------------------------------
5 */
6#ifndef _OZUSBIF_H
7#define _OZUSBIF_H
8
9#include <linux/usb.h>
10
11/* Reference counting functions.
12 */
13void oz_usb_get(void *hpd);
14void oz_usb_put(void *hpd);
15
16/* Stream functions.
17 */
18int oz_usb_stream_create(void *hpd, u8 ep_num);
19int oz_usb_stream_delete(void *hpd, u8 ep_num);
20
21/* Request functions.
22 */
23int oz_usb_control_req(void *hpd, u8 req_id, struct usb_ctrlrequest *setup,
Peter Huewedc7f5b32013-02-15 21:17:24 +010024 const u8 *data, int data_len);
Chris Kellyb3147862012-02-20 21:12:08 +000025int oz_usb_get_desc_req(void *hpd, u8 req_id, u8 req_type, u8 desc_type,
Himangi Saraogi45b1fe52014-03-12 22:20:32 +053026 u8 index, __le16 windex, int offset, int len);
Chris Kellyb3147862012-02-20 21:12:08 +000027int oz_usb_send_isoc(void *hpd, u8 ep_num, struct urb *urb);
28void oz_usb_request_heartbeat(void *hpd);
29
30/* Confirmation functions.
31 */
Jason A. Donenfeldb1bb5b42015-05-29 13:06:59 +020032void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status,
33 const u8 *desc, u8 length, u16 offset, u16 total_size);
Chris Kellyb3147862012-02-20 21:12:08 +000034void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode,
Peter Huewedc7f5b32013-02-15 21:17:24 +010035 const u8 *data, int data_len);
Chris Kellyb3147862012-02-20 21:12:08 +000036
37/* Indication functions.
38 */
Peter Huewedc7f5b32013-02-15 21:17:24 +010039void oz_hcd_data_ind(void *hport, u8 endpoint, const u8 *data, int data_len);
Chris Kellyb3147862012-02-20 21:12:08 +000040
41int oz_hcd_heartbeat(void *hport);
42
43#endif /* _OZUSBIF_H */