2 * Copyright (c) 2007, Benedikt Sauter <sauter@ixbat.de>
5 * Short descripton of file:
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
18 * * Neither the name of the FH Augsburg nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ppcskel - a Free Software replacement for the Nintendo/BroadOn bootloader.
38 Copyright (C) 2009 Bernhard Urban <lewurm@gmx.net>
39 Copyright (C) 2009 Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
41 # This code is licensed to you under the terms of the GNU GPL, version 2;
42 # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
48 #include "../../types.h"
49 #include "../lib/list.h"
52 #include "../../bootmii_ppc.h"
53 inline static void wait_ms(int ms)
64 /* device descriptor */
78 u8 bNumConfigurations;
83 struct usb_conf *conf;
84 struct usb_device *next;
92 u8 bConfigurationValue;
97 struct usb_conf *next;
98 struct usb_intf *intf;
105 u8 bAlternateSetting;
108 u8 bInterfaceSubClass;
109 u8 bInterfaceProtocol;
112 struct usb_intf *next;
113 struct usb_endp *endp;
124 struct usb_endp *next;
127 struct usb_endpoint {
131 struct usb_endpoint *next;
134 struct usb_transfer_descriptor_ep {
135 struct usb_transfer_descriptor_ep *next;
138 struct usb_transfer_descriptor *start;
142 * USB Driver data structure
148 void (*remove)(void);
150 struct usb_driver *next;
159 struct usb_device *dev;
160 /* ep -> bit 7 is for direction 1=from dev to host */
163 /* control, interrupt, bulk or isochron */
175 * usb transfer descriptor
177 struct usb_transfer_descriptor {
183 // TODO: zusammenfassen!
192 struct usb_transfer_descriptor *next;
198 void (*stdout)(char * arg);
200 struct list *drivers;
201 struct list *devices;
204 void usb_init(u32 reg);
206 u8 usb_next_address();
209 struct usb_device *usb_add_device(u8 lowspeed, u32 reg);
210 u8 usb_remove_device(struct usb_device *dev);
211 u8 usb_register_driver(struct usb_driver *driver);
212 void usb_probe_driver();
214 void lsusb(struct usb_device *dev);
216 struct usb_irp *usb_get_irp();
217 u8 usb_remove_irp(struct usb_irp *irp);
218 u16 usb_submit_irp(struct usb_irp *irp);
221 struct usb_transfer_descriptor *usb_create_transfer_descriptor(struct usb_irp *irp);
224 #define USB_IRP_WAITING 1
227 #define USB_TRANSFER_DESCR_NONE 1
228 #define USB_TRANSFER_DESCR_SEND 2