]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg EhciPei: Minor refinement about IOMMU
authorStar Zeng <star.zeng@intel.com>
Mon, 20 Nov 2017 07:44:24 +0000 (15:44 +0800)
committerStar Zeng <star.zeng@intel.com>
Wed, 22 Nov 2017 10:37:48 +0000 (18:37 +0800)
This patch is following 2c656af04d7f.
1. Fix typo "XHC" to "EHC".
2. Reinitialize Request(Phy/Map) and Data(Phy/Map)
in Urb, otherwise the last time value of them may
be used in error handling when error happens.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h
MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c

index 279407475b66b9df2dd781f2bfb90138105318b7..715a5ab1c142d2d2eb373bf7498e88b3b50ba0a0 100644 (file)
@@ -99,7 +99,7 @@ struct _PEI_USB2_HC_DEV {
   EDKII_IOMMU_PPI                     *IoMmu;\r
   EFI_PEI_PPI_DESCRIPTOR              PpiDescriptor;\r
   //\r
-  // EndOfPei callback is used to stop the XHC DMA operation\r
+  // EndOfPei callback is used to stop the EHC DMA operation\r
   // after exit PEI phase.\r
   //\r
   EFI_PEI_NOTIFY_DESCRIPTOR           EndOfPeiNotifyList;\r
index 3dadcd60b6fec69825b64f98fa2d8041ad831ef6..baacf5d56080ec615b1a8efbb7ea64111396f51d 100644 (file)
@@ -576,7 +576,12 @@ EhcCreateUrb (
   if (Urb->Qh == NULL) {\r
     goto ON_ERROR;\r
   }\r
-  \r
+\r
+  Urb->RequestPhy = NULL;\r
+  Urb->RequestMap = NULL;\r
+  Urb->DataPhy  = NULL;\r
+  Urb->DataMap  = NULL;\r
+\r
   //\r
   // Map the request and user data\r
   //\r
@@ -591,9 +596,6 @@ EhcCreateUrb (
 \r
     Urb->RequestPhy = (VOID *) ((UINTN) PhyAddr);\r
     Urb->RequestMap = Map;\r
-  } else {\r
-    Urb->RequestPhy = NULL;\r
-    Urb->RequestMap = NULL;\r
   }\r
 \r
   if (Data != NULL) {\r
@@ -613,9 +615,6 @@ EhcCreateUrb (
 \r
     Urb->DataPhy  = (VOID *) ((UINTN) PhyAddr);\r
     Urb->DataMap  = Map;\r
-  } else {\r
-    Urb->DataPhy  = NULL;\r
-    Urb->DataMap  = NULL;\r
   }\r
 \r
   Status = EhcCreateQtds (Ehc, Urb);\r