various changes
[ppcskel.git] / usb / core / usb.c
index b73a33d134c6df92618ee6b7c37bb3269d20d8e4..76c3e8516ff632ce1bca281a99ddbed6a81afe23 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/*
+       ppcskel - a Free Software replacement for the Nintendo/BroadOn bootloader.
+       libusb like interface
+
+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
+*/
+
 #include "usb.h"
 #include "core.h"
 #include "../host/host.h"
@@ -310,7 +321,9 @@ s8 usb_set_configuration(struct usb_device *dev, u8 configuration)
 {
        cleargbuf();
        usb_control_msg(dev, 0x00, SET_CONFIGURATION, configuration, 0, 0, gbuf, 0);
-       wait_ms(50);
+       printf("=============\nafter usb_set_configuration:\n");
+       hexdump((void*) gbuf, 8);
+       wait_ms(20);
        return 0;
 }
 
@@ -386,7 +399,7 @@ s8 usb_interrupt_read(struct usb_device *dev, u8 ep, u8 *buf, u8 size, u8 timeou
 {
        struct usb_irp *irp = (struct usb_irp*)malloc(sizeof(struct usb_irp));
        irp->dev = dev;
-       irp->endpoint = ep | 0x80; //from device to host
+       irp->endpoint = ep; //wtf? |80; //from device to host
        irp->epsize = dev->epSize[ep]; // ermitteln
        irp->type = USB_INTR;
 
@@ -394,7 +407,6 @@ s8 usb_interrupt_read(struct usb_device *dev, u8 ep, u8 *buf, u8 size, u8 timeou
        irp->len = size;
        irp->timeout = timeout;
 
-       printf("interupt_read\n");
        usb_submit_irp(irp);
        free(irp);