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.
38 #include "../../types.h"
39 #include "../lib/list.h"
42 #include "../../bootmii_ppc.h"
43 inline static void wait_ms(int ms)
53 /* device descriptor */
67 u8 bNumConfigurations;
72 struct usb_conf *conf;
73 struct usb_device *next;
81 u8 bConfigurationValue;
86 struct usb_conf *next;
87 struct usb_intf *intf;
97 u8 bInterfaceSubClass;
98 u8 bInterfaceProtocol;
101 struct usb_intf *next;
102 struct usb_endp *endp;
113 struct usb_endp *next;
116 struct usb_endpoint {
120 struct usb_endpoint *next;
123 struct usb_transfer_descriptor_ep {
124 struct usb_transfer_descriptor_ep *next;
127 struct usb_transfer_descriptor *start;
131 * USB Driver data structure
138 struct usb_driver *next;
147 struct usb_device *dev;
148 /* ep -> bit 7 is for direction 1=from dev to host */
151 /* control, interrupt, bulk or isochron */
163 * usb transfer descriptor
165 struct usb_transfer_descriptor {
170 // TODO: zusammenfassen!
179 struct usb_transfer_descriptor *next;
185 void (*stdout)(char * arg);
187 struct list *drivers;
188 struct list *devices;
193 u8 usb_next_address();
196 struct usb_device *usb_add_device(u8 lowspeed);
197 u8 usb_remove_device(struct usb_device *dev);
198 u8 usb_register_driver(struct usb_driver *driver);
199 void usb_probe_driver();
201 void lsusb(struct usb_device *dev);
203 struct usb_irp *usb_get_irp();
204 u8 usb_remove_irp(struct usb_irp *irp);
205 u16 usb_submit_irp(struct usb_irp *irp);
208 struct usb_transfer_descriptor *usb_create_transfer_descriptor(struct usb_irp *irp);
211 #define USB_IRP_WAITING 1
214 #define USB_TRANSFER_DESCR_NONE 1
215 #define USB_TRANSFER_DESCR_SEND 2