]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Usb: Fix wrong condition judgment to support usb3.1 dev
authorFeng Tian <feng.tian@intel.com>
Fri, 8 Apr 2016 05:43:49 +0000 (13:43 +0800)
committerFeng Tian <feng.tian@intel.com>
Thu, 21 Apr 2016 07:53:14 +0000 (15:53 +0800)
The bcdUSB value of usb3.1 is 0x0310, we update the condition judgment
to get correct max packet size for usb3.1 dev.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c

index 39c28ab7d83d20cab8d0d6c1f246303ec160ac26..4798bea86061efd107dd6dbeb7b2c2e948b3056a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The XHCI controller driver.\r
 \r
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2016, 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
@@ -955,7 +955,7 @@ XhcControlTransfer (
         // Store a copy of device scriptor as hub device need this info to configure endpoint.\r
         //\r
         CopyMem (&Xhc->UsbDevContext[SlotId].DevDesc, Data, *DataLength);\r
-        if (Xhc->UsbDevContext[SlotId].DevDesc.BcdUSB == 0x0300) {\r
+        if (Xhc->UsbDevContext[SlotId].DevDesc.BcdUSB >= 0x0300) {\r
           //\r
           // If it's a usb3.0 device, then its max packet size is a 2^n.\r
           //\r
index eaea38d94d299386fcbd62016f2fe755f2ef55ab..a58739fb4a681edcfedfb76ab00a9a6c08dfc94c 100644 (file)
@@ -2,7 +2,7 @@
 PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid\r
 which is used to enable recovery function from USB Drivers.\r
 \r
-Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -687,7 +687,7 @@ XhcPeiControlTransfer (
       // Store a copy of device scriptor as hub device need this info to configure endpoint.\r
       //\r
       CopyMem (&Xhc->UsbDevContext[SlotId].DevDesc, Data, *DataLength);\r
-      if (Xhc->UsbDevContext[SlotId].DevDesc.BcdUSB == 0x0300) {\r
+      if (Xhc->UsbDevContext[SlotId].DevDesc.BcdUSB >= 0x0300) {\r
         //\r
         // If it's a usb3.0 device, then its max packet size is a 2^n.\r
         //\r
index 9687eb0bca51c40f2683cb78672459c70c2e0258..5b8b1aaeae343e15f1c2f25799f3f08dc3aad876 100644 (file)
@@ -2,7 +2,7 @@
 \r
     Manage Usb Descriptor List\r
 \r
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2016, 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
@@ -539,7 +539,7 @@ UsbGetMaxPacketSize0 (
     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
+      if ((DevDesc.BcdUSB >= 0x0300) && (DevDesc.MaxPacketSize0 == 9)) {\r
         UsbDev->MaxPacket0 = 1 << 9;\r
         return EFI_SUCCESS;\r
       }\r
index f3500218626c5e3a5b4d825c398c3bf3027e46a1..a4bb4d7aa72d8d696ab98f5db1629f684595d40e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 The module to produce Usb Bus PPI.\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
   \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -702,7 +702,7 @@ PeiConfigureUsbDevice (
     return Status;\r
   }\r
 \r
-  if ((DeviceDescriptor.BcdUSB == 0x0300) && (DeviceDescriptor.MaxPacketSize0 == 9)) {\r
+  if ((DeviceDescriptor.BcdUSB >= 0x0300) && (DeviceDescriptor.MaxPacketSize0 == 9)) {\r
     PeiUsbDevice->MaxPacketSize0 = 1 << 9;\r
   } else {\r
     PeiUsbDevice->MaxPacketSize0 = DeviceDescriptor.MaxPacketSize0;\r