usb_{s,g}et_configuration doing it wrong :/
authorBernhard Urban <lewurm@gmx.net>
Tue, 22 Sep 2009 13:57:55 +0000 (15:57 +0200)
committerBernhard Urban <lewurm@gmx.net>
Tue, 22 Sep 2009 13:57:55 +0000 (15:57 +0200)
usb/Makefile
usb/core/core.c
usb/core/usb.c

index 0171494c0ec1ba7fa4568b31c8e0b9d800f99892..ddd11fbdb39d559f016235b9ba95c7defc273aef 100644 (file)
@@ -3,7 +3,7 @@ CFLAGS += -Wno-unused-parameter
 
 #debug flags; DU = Debug USB
 #CFLAGS += -D _DU_OHCI_F #fire @ u/h/ohci.c
-#CFLAGS += -D _DU_OHCI_F_HALT #halted @ u/h/ohci.c
+CFLAGS += -D _DU_OHCI_F_HALT #halted @ u/h/ohci.c
 #CFLAGS += -D _DU_OHCI_Q #enqueue @ u/h/ohci.c
 #CFLAGS += -D _DU_OHCI_RH #roothub @ u/h/ohci.c
 CFLAGS += -D _DU_CORE #@ u/c/core.c
index 5a7c45ef9c5fc1f2e0416ccdfd9f68687cca0f6c..0f30731bbb8a45f24fcfb69c92fbfc16d222395a 100644 (file)
@@ -108,7 +108,6 @@ struct usb_device *usb_add_device()
                return (void*) -1;
        }
 
-       u8 buf[8];
 //#define WTF
 #ifdef WTF
        printf("lololololool PADDING WTF :O lolololololo \n");
@@ -162,15 +161,18 @@ struct usb_device *usb_add_device()
        printf("=============\nusb_set_configuration(ret: %d) %d\n", ret, dev->conf->bConfigurationValue);
        printf("=============\nusb_get_configuration: %d\n", usb_get_configuration(dev));
 
+#if 0
+       u8 buf[8];
        memset(buf, 0, 8);
-       usb_control_msg(dev, 0x00, SET_INTERFACE, 0, dev->conf->intf->bInterfaceNumber, 8, buf, 0);
+       usb_control_msg(dev, 0x00, SET_INTERFACE, 0, dev->conf->intf->bInterfaceNumber, 0, buf, 0);
        printf("=============\nusb_set_interface: %d\n", dev->conf->intf->bInterfaceNumber);
        hexdump((void*)buf, 8);
 
        memset(buf, 0, 8);
-       usb_control_msg(dev, 0x80, GET_INTERFACE, 0, 0, 8, buf, 0);
+       usb_control_msg(dev, 0x81, GET_INTERFACE, 0, dev->conf->intf->bInterfaceNumber, 8, buf, 0);
        printf("=============\nusb_get_interface: %d\n", buf[0]);
        hexdump((void*)buf, 8);
+#endif
 
 #if 0
        /* add device to device list */
index 35460a5b0be76ec8ed5fdb865998ea1eb0b0bd60..c0ff3fb1820b863cfa19be899a824045b157516f 100644 (file)
@@ -286,9 +286,6 @@ s8 usb_get_desc_config_ext(struct usb_device *dev, u8 index, struct usb_conf *co
                        off += 7;
                }
        }
-
-       printf("=============\nafter usb_get_desc_config_ext:\n");
-       hexdump((void*) gbuf, dev->conf->wTotalLength);
        return 0;
 }
 
@@ -303,7 +300,9 @@ s8 usb_set_address(struct usb_device *dev, u8 address)
 u8 usb_get_configuration(struct usb_device *dev)
 {
        cleargbuf();
-       usb_control_msg(dev, 0x80, GET_CONFIGURATION, 0, 0, 8, gbuf, 0);
+       usb_control_msg(dev, 0x80, GET_CONFIGURATION, 0, 0, 4, gbuf, 0);
+       printf("=============\nafter usb_get_configuration:\n");
+       hexdump((void*) gbuf, 1);
        return gbuf[0];
 }