From 3a2f9cce7d2a393c6655c6cf2cde8539e75aa3ea Mon Sep 17 00:00:00 2001 From: erictian Date: Thu, 4 Mar 2010 09:29:34 +0000 Subject: [PATCH] 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 --- MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 7 ++++--- MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c index d2e53300af..58d4a303dc 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 5194d540a7..536d8ad8e6 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