memset(buf, 0, sizeof(buf));
ret = usb_get_desc_dev_simple(dev, buf, sizeof(buf));
#ifdef _DU_CORE_ADD
- printf("=============\nbuf: 0x%08X\nafter usb_get_dev_desc_simple(ret: %d):\n", buf, ret);
+ printf("=============\nafter usb_get_dev_desc_simple(ret: %d):\n", ret);
hexdump(buf, sizeof(buf));
#endif
if(ret < 0) {
memset(buf, 0, sizeof(buf));
ret = usb_get_desc_dev(dev, buf, sizeof(buf));
#ifdef _DU_CORE_ADD
- printf("=============\nbuf: 0x%08X\nafter usb_get_dev_desc(ret: %d):\n", buf, ret);
+ printf("=============\nafter usb_get_dev_desc(ret: %d):\n", ret);
hexdump(buf, sizeof(buf));
#endif
memset(buf, 0, sizeof(buf));
/* in the most cases usb devices have just one configuration descriptor */
ret = usb_get_desc_configuration(dev, 0, buf, sizeof(buf));
- printf("=============\nbuf: 0x%08X\nafter usb_get_desc_configuration(ret: %d):\n", buf, ret);
+ printf("=============\nafter usb_get_desc_configuration(ret: %d):\n", ret);
hexdump(buf, sizeof(buf));
- printf("interfaces: %d\n", dev->conf->bNumInterfaces);
+ memset(buf, 0, sizeof(buf));
+ ret = usb_get_descriptor(dev, CONFIGURATION, 0, buf, dev->conf->wTotalLength);
+ printf("=============\nafter usb_get_HACK(ret: %d):\n", ret);
+ hexdump(buf, sizeof(buf));
+
+ /* select configuration */
+ ret = usb_set_configuration(dev, dev->conf->bConfigurationValue);
+ printf("=============\nusb_set_configuration(ret: %d) %d\n", ret, dev->conf->bConfigurationValue);
+
+ /*
+ udelay(600000);
+
+ printf("=============\ninterfaces: %d\n", dev->conf->bNumInterfaces);
u8 i;
for(i = 1; i <= dev->conf->bNumInterfaces; i++) {
memset(buf, 0, sizeof(buf));
- ret = usb_get_desc_interface(dev, i, buf, sizeof(buf));
- printf("=============\nbuf: 0x%08X\nafter usb_get_desc_interface_%d(ret: %d):\n", buf, i, ret);
+ ret = usb_get_desc_interface(dev, 1, buf, sizeof(buf));
+ printf("=============\nafter usb_get_desc_interface_%d(ret: %d):\n", i, ret);
hexdump(buf, sizeof(buf));
}
+ */
if(size < 9) {
return -1;
}
- usb_get_descriptor(dev, INTERFACE, index, buf, 8);
- usb_get_descriptor(dev, INTERFACE, index, buf, size >= buf[0] ? buf[0] : size);
+ usb_get_descriptor(dev, INTERFACE, index, buf, 9);
return 0;
}
s8 usb_set_configuration(struct usb_device *dev, u8 configuration)
{
-
+ u8 buf[64];
+ usb_control_msg(dev, 0x00, SET_CONFIGURATION, configuration, 0, 0, buf, 0);
return 0;
}