\r
Manage Usb Descriptor List\r
\r
-Copyright (c) 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
return NULL;\r
}\r
\r
- Desc = AllocateZeroPool (CtrlLen);\r
+ Desc = AllocateZeroPool ((UINTN) CtrlLen);\r
if (Desc == NULL) {\r
return NULL;\r
}\r
\r
- CopyMem (Desc, Head, DescLen);\r
+ CopyMem (Desc, Head, (UINTN) DescLen);\r
\r
*Consumed = Offset + Head->Len;\r
\r
while (Len >= sizeof (EFI_USB_INTERFACE_DESCRIPTOR)) {\r
Setting = UsbParseInterfaceDesc (DescBuf, Len, &Consumed);\r
\r
- if ((Setting == NULL)) {\r
+ if (Setting == NULL) {\r
DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: failed to parse interface setting\n"));\r
goto ON_ERROR;\r
\r
// Get the first 8 bytes of the device descriptor which contains\r
// max packet size for endpoint 0, which is at least 8.\r
//\r
- UsbDev->MaxPacket0 = 8;\r
-\r
for (Index = 0; Index < 3; Index++) {\r
Status = UsbCtrlGetDesc (UsbDev, USB_DESC_TYPE_DEVICE, 0, 0, &DevDesc, 8);\r
\r
if (!EFI_ERROR (Status)) {\r
+ if ((DevDesc.BcdUSB == 0x0300) && (DevDesc.MaxPacketSize0 == 9)) {\r
+ UsbDev->MaxPacket0 = 1 << 9;\r
+ return EFI_SUCCESS;\r
+ }\r
UsbDev->MaxPacket0 = DevDesc.MaxPacketSize0;\r
return EFI_SUCCESS;\r
}\r