1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 by Christian Gmeiner
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef _USBSTACK_CONTROLLER_H_
21 #define _USBSTACK_CONTROLLER_H_
34 uint32_t ep_num
; /* which endpoint? */
35 uint32_t pipe_num
; /* which pipe? */
39 struct usb_endpoint_descriptor
*desc
;
40 struct list_head list
;
43 struct usb_controller
{
45 enum usb_controller_type type
;
46 enum usb_device_speed speed
;
48 void (*shutdown
)(void);
53 struct usb_device_driver
* device_driver
;
54 struct usb_host_driver
* host_driver
;
56 struct usb_ep endpoints
;
59 struct usb_dcd_controller_ops
{
60 /* endpoint management */
61 int (*enable
)(struct usb_ep
* ep
, struct usb_endpoint_descriptor
* desc
);
62 int (*disable
)(struct usb_ep
* ep
);
63 int (*set_halt
)(struct usb_ep
* ep
, bool hald
);
66 int (*send
)(struct usb_ep
* ep
, struct usb_response
* req
);
67 int (*receive
)(struct usb_ep
* ep
, struct usb_response
* res
);
73 int usb_controller_register(struct usb_controller
* ctrl
);
74 int usb_controller_unregister(struct usb_controller
* ctrl
);
77 * dcd - device controller driver
79 void usb_dcd_init(void);
80 void usb_dcd_shutdown(void);
83 * hcd - host controller driver
85 void usb_hcd_init(void);
86 void usb_hcd_shutdown(void);
88 #endif /*_USBSTACK_CONTROLLER_H_*/