X-Git-Url: http://review.tizen.org/git/?p=profile%2Fmobile%2Fplatform%2Fkernel%2Fu-boot-tm1.git;a=blobdiff_plain;f=property%2Fusb%2Fdrv_cdc.c;h=8596fa22ad684b1486932c969b1805392bb72c77;hp=b18a0d6adba06e35e3af82a1f3f05105afa2ea68;hb=b25c7f53daffa02d3d5fe76fc6138ca7cbf57556;hpb=3f98b0827c777c7e00493d75df1bbbef233e2dab diff --git a/property/usb/drv_cdc.c b/property/usb/drv_cdc.c index b18a0d6..8596fa2 100644 --- a/property/usb/drv_cdc.c +++ b/property/usb/drv_cdc.c @@ -17,6 +17,7 @@ #include #include #include +#include #define USB_DEBUG @@ -259,7 +260,13 @@ LOCAL void usb_get_descriptor (USB_REQUEST_1_U *request1, USB_REQUEST_2_U *reque 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: