1/*
2 * Copyright (c) 2007-2013 ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10#ifndef USB_MANAGER_CLIENT_H_
11#define USB_MANAGER_CLIENT_H_
12
13#include <if/usb_manager_defs.h>
14#include <if/usb_driver_defs.h>
15
16extern struct usb_manager_binding *usb_manager;
17
18void usb_driver_rx_detach_notify(struct usb_driver_binding *b);
19void usb_driver_rx_done_notify(struct usb_driver_binding *b,
20        uint32_t tid, uint32_t error, const uint8_t *data, size_t length);
21
22struct usb_client_st {
23    lib_usb_callback callback;
24    void *st;
25    uint16_t init_config;
26
27    /*
28     * --------------------------------------------------------------------------
29     * Variables for connection management to the USB manager service
30     * --------------------------------------------------------------------------
31     */
32
33    /// the iref of the usb manager for connections
34    iref_t usb_manager_iref;
35
36    /// ower own iref
37    iref_t usb_driver_iref;
38
39    /// our own driver binding with the usb manager
40    struct usb_driver_binding *driver_binding;
41
42    /// state variables for the ensuring that the exportation process is completed
43    volatile uint8_t manager_connected;
44
45};
46
47#endif /* USB_MANAGER_CLIENT_H_ */
48