#include <asm/arch/virtual_com.h>
#include <asm/arch/packet.h>
#include <asm/arch/usb20_reg_v3.h>
+#include <linux/usb/ch9.h>
#define USB_DEBUG
case USB_DEVICE_DESCRIPTOR_TYPE:
send_data = (uint8 *) thor_get_device_desc(enum_speed);
- EPI0_config (0x12, 0x1, TRUE, (uint32 *) send_data);
+ /*
+ * only send less or equal than requested length.
+ * no need to care about larger reqeust than possible
+ * descriptor length because of zero-length packet
+ * generated by usb controller
+ */
+ EPI0_config (min(USB_DT_DEVICE_SIZE, length), 0x1, TRUE, (uint32 *) send_data);
break;
case USB_CONFIGURATION_DESCRIPTOR_TYPE: