public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value
@ 2022-12-10  9:36 Chang, Abner
  0 siblings, 0 replies; only message in thread
From: Chang, Abner @ 2022-12-10  9:36 UTC (permalink / raw)
  To: devel; +Cc: Kuei-Hung.Lin, Hao A Wu, Ray Ni, Garrett Kirkendall, Abner Chang

From: Abner Chang <abner.chang@amd.com>

Initialize XHCI DCI slot's context entries value.

Signed-off-by: Kuei-Hung Lin <Kuei-Hung.Lin@amd.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Garrett Kirkendall <garrett.kirkendall@amd.com>
Cc: Abner Chang <abner.chang@amd.com>
Signed-off-by: Abner Chang <abner.chang@amd.com>
---
 MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 6 ++++++
 MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 13b0400e83d..fecc19c50dc 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -2807,6 +2807,9 @@ XhcInitializeEndpointContext (
   MaxDci = 0;
 
   NumEp = IfDesc->NumEndpoints;
+  if (NumEp == 0) {
+    MaxDci = 1;
+  }
 
   EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
   for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
@@ -3006,6 +3009,9 @@ XhcInitializeEndpointContext64 (
   MaxDci = 0;
 
   NumEp = IfDesc->NumEndpoints;
+  if (NumEp == 0) {
+    MaxDci = 1;
+  }
 
   EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
   for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
index cc597a43717..f2eaf0a4b73 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
@@ -1752,6 +1752,9 @@ XhcPeiSetConfigCmd (
     }
 
     NumEp = IfDesc->NumEndpoints;
+    if ((NumEp == 0) && (MaxDci == 0)) {
+      MaxDci = 1;
+    }
 
     EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
     for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
@@ -1974,6 +1977,9 @@ XhcPeiSetConfigCmd64 (
     }
 
     NumEp = IfDesc->NumEndpoints;
+    if ((NumEp == 0) && (MaxDci == 0)) {
+      MaxDci = 1;
+    }
 
     EpDesc = (USB_ENDPOINT_DESCRIPTOR *)(IfDesc + 1);
     for (EpIndex = 0; EpIndex < NumEp; EpIndex++) {
-- 
2.37.1.windows.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-10  9:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-10  9:36 [PATCH] MdeModulePkg/Xhci: Initial XHCI DCI slot's Context value Chang, Abner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox