summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-04 09:29:34 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-04 09:29:34 +0000
commit3a2f9cce7d2a393c6655c6cf2cde8539e75aa3ea (patch)
treed50844c92d82d7ce7ba70f8371cc6945ae02890f
parent029f9e857e0d2f70aebb4b98d5e5f11eb459b6a2 (diff)
downloadedk2-3a2f9cce7d2a393c6655c6cf2cde8539e75aa3ea.zip
edk2-3a2f9cce7d2a393c6655c6cf2cde8539e75aa3ea.tar.gz
edk2-3a2f9cce7d2a393c6655c6cf2cde8539e75aa3ea.tar.bz2
uniform the sw and hw expression to avoid confusing. it does not effect hw function.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10186 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c7
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
index d2e5330..58d4a30 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
@@ -74,6 +74,7 @@ EhcCreateHelpQ (
QhHw->HorizonLink = QH_LINK (PciAddr + OFFSET_OF(EHC_QH, QhHw), EHC_TYPE_QH, FALSE);
QhHw->Status = QTD_STAT_HALTED;
QhHw->ReclaimHead = 1;
+ Qh->NextQh = Qh;
Ehc->ReclaimHead = Qh;
//
@@ -335,9 +336,9 @@ EhcLinkQhToAsync (
Qh->NextQh = Head->NextQh;
Head->NextQh = Qh;
- PciAddr = UsbHcGetPciAddressForHostMem (Ehc->MemPool, Head, sizeof (EHC_QH));
+ PciAddr = UsbHcGetPciAddressForHostMem (Ehc->MemPool, Qh->NextQh, sizeof (EHC_QH));
Qh->QhHw.HorizonLink = QH_LINK (PciAddr, EHC_TYPE_QH, FALSE);
- PciAddr = UsbHcGetPciAddressForHostMem (Ehc->MemPool, Qh, sizeof (EHC_QH));
+ PciAddr = UsbHcGetPciAddressForHostMem (Ehc->MemPool, Head->NextQh, sizeof (EHC_QH));
Head->QhHw.HorizonLink = QH_LINK (PciAddr, EHC_TYPE_QH, FALSE);
}
@@ -372,7 +373,7 @@ EhcUnlinkQhFromAsync (
Head->NextQh = Qh->NextQh;
Qh->NextQh = NULL;
- PciAddr = UsbHcGetPciAddressForHostMem (Ehc->MemPool, Head, sizeof (EHC_QH));
+ PciAddr = UsbHcGetPciAddressForHostMem (Ehc->MemPool, Head->NextQh, sizeof (EHC_QH));
Head->QhHw.HorizonLink = QH_LINK (PciAddr, EHC_TYPE_QH, FALSE);
//
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
index 5194d54..536d8ad 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
@@ -246,6 +246,10 @@ UsbHcGetPciAddressForHostMem (
Head = Pool->Head;
AllocSize = USBHC_MEM_ROUND (Size);
+ if (Mem == NULL) {
+ return 0;
+ }
+
for (Block = Head; Block != NULL; Block = Block->Next) {
//
// scan the memory block list for the memory block that