]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
Remove the check of signature because the code which looks for the input NotifyHandle...
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / UsbDesc.c
index 191312bbb3db677fb3965b3ad272c5494df1e29f..529b136188ace95104d6dfb9e069e0c9b202c165 100644 (file)
@@ -2,8 +2,8 @@
 \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
@@ -197,12 +197,12 @@ UsbCreateDesc (
     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
@@ -359,7 +359,7 @@ UsbParseConfigDesc (
   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
@@ -527,12 +527,14 @@ UsbGetMaxPacketSize0 (
   // 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