* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+ ppcskel - a Free Software replacement for the Nintendo/BroadOn bootloader.
+ plugmii core
+
+Copyright (C) 2009 Bernhard Urban <lewurm@gmx.net>
+Copyright (C) 2009 Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
+
+# This code is licensed to you under the terms of the GNU GPL, version 2;
+# see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+*/
#ifndef _CORE_H_
#define _CORE_H_
struct usb_device {
u8 address;
u8 fullspeed;
+ u32 ohci;
/* device descriptor */
u8 bLength;
u8 iConfiguration;
u8 bmAttributes;
u8 bMaxPower;
+
+ struct usb_conf *next;
+ struct usb_intf *intf;
+};
+
+struct usb_intf {
+ u8 bLength;
+ u8 bDescriptorType;
+ u8 bInterfaceNumber;
+ u8 bAlternateSetting;
+ u8 bNumEndpoints;
+ u8 bInterfaceClass;
+ u8 bInterfaceSubClass;
+ u8 bInterfaceProtocol;
+ u8 iInterface;
+
+ struct usb_intf *next;
+ struct usb_endp *endp;
+};
+
+struct usb_endp {
+ u8 bLength;
+ u8 bDescriptorType;
+ u8 bEndpointAddress;
+ u8 bmAttributes;
+ u16 wMaxPacketSize;
+ u8 bInterval;
+
+ struct usb_endp *next;
};
struct usb_endpoint {
char* name;
void (*probe)(void);
void (*check)(void);
- void * data;
+ void *data;
struct usb_driver *next;
};
struct usb_transfer_descriptor {
u8 devaddress;
u8 endpoint;
+ u8 fullspeed;
+ u8 type;
// TODO: zusammenfassen!
u8 pid;
struct list *devices;
} core;
-void usb_init();
+void usb_init(u32 reg);
void usb_periodic();
u8 usb_next_address();
-struct usb_device *usb_add_device();
+struct usb_device *usb_add_device(u8 lowspeed, u32 reg);
u8 usb_remove_device(struct usb_device *dev);
u8 usb_register_driver(struct usb_driver *driver);
void usb_probe_driver();
-
+void lsusb(struct usb_device *dev);
struct usb_irp *usb_get_irp();
u8 usb_remove_irp(struct usb_irp *irp);