summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-19 06:54:35 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2010-03-19 06:54:35 +0000
commitaa91de055c5e15a716f3a0ce6bf5a1c28fda9e56 (patch)
tree33ac167e3bd420086aeb2fecabc0332733f4130d /MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
parent33f30f1ee3490739c6b84de1bbecc3f9a63a5591 (diff)
downloadedk2-aa91de055c5e15a716f3a0ce6bf5a1c28fda9e56.tar.gz
edk2-aa91de055c5e15a716f3a0ce6bf5a1c28fda9e56.tar.bz2
edk2-aa91de055c5e15a716f3a0ce6bf5a1c28fda9e56.zip
Fix a bug that usb keybarod can not work well when it is inserted at a usb 2.0 hub.
It's due to AsyncInterruptList does not update the corresponding QTDHw->Data with pci bus master address. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10286 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c')
-rw-r--r--MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c38
1 files changed, 11 insertions, 27 deletions
diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
index c2d560b48c..bc7cfb9c90 100644
--- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
+++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
@@ -949,7 +949,6 @@ Uhci2AsyncInterruptTransfer (
EFI_STATUS Status;
UINT8 *DataPtr;
UINT8 *DataPhy;
- VOID *DataMap;
UINT8 PktId;
Uhc = UHC_FROM_USB2_HC_PROTO (This);
@@ -957,7 +956,6 @@ Uhci2AsyncInterruptTransfer (
IntTds = NULL;
DataPtr = NULL;
DataPhy = NULL;
- DataMap = NULL;
IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);
@@ -998,40 +996,30 @@ Uhci2AsyncInterruptTransfer (
return EFI_DEVICE_ERROR;
}
+ if ((EndPointAddress & 0x80) == 0) {
+ PktId = OUTPUT_PACKET_ID;
+ } else {
+ PktId = INPUT_PACKET_ID;
+ }
+
//
// Allocate and map source data buffer for bus master access.
//
- DataPtr = UsbHcAllocateMem (Uhc->MemPool, DataLength);
+ DataPtr = UsbHcAllocateMem (Uhc->MemPool, DataLength);
if (DataPtr == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- OldTpl = gBS->RaiseTPL (UHCI_TPL);
-
- //
- // Map the user data then create a queue head and
- // list of TD for it.
- //
- Status = UhciMapUserData (
- Uhc,
- EfiUsbDataIn,
- DataPtr,
- &DataLength,
- &PktId,
- &DataPhy,
- &DataMap
- );
+ DataPhy = (UINT8 *)UsbHcGetPciAddressForHostMem (Uhc->MemPool, DataPtr, DataLength);
- if (EFI_ERROR (Status)) {
- goto FREE_DATA;
- }
+ OldTpl = gBS->RaiseTPL (UHCI_TPL);
Qh = UhciCreateQh (Uhc, PollingInterval);
if (Qh == NULL) {
Status = EFI_OUT_OF_RESOURCES;
- goto UNMAP_DATA;
+ goto FREE_DATA;
}
IntTds = UhciCreateBulkOrIntTds (
@@ -1066,7 +1054,6 @@ Uhci2AsyncInterruptTransfer (
EndPointAddress,
DataLength,
PollingInterval,
- DataMap,
DataPtr,
CallBackFunction,
Context,
@@ -1085,11 +1072,8 @@ Uhci2AsyncInterruptTransfer (
DESTORY_QH:
UsbHcFreeMem (Uhc->MemPool, Qh, sizeof (UHCI_QH_SW));
-UNMAP_DATA:
- Uhc->PciIo->Unmap (Uhc->PciIo, DataMap);
-
FREE_DATA:
- gBS->FreePool (DataPtr);
+ UsbHcFreeMem (Uhc->MemPool, DataPtr, DataLength);
Uhc->PciIo->Flush (Uhc->PciIo);
gBS->RestoreTPL (OldTpl);