X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FPci%2FEhciDxe%2FEhciUrb.c;fp=MdeModulePkg%2FBus%2FPci%2FEhciDxe%2FEhciUrb.c;h=6afb327df165aa81cf559a903a090391fa9e82bf;hp=09c12776ecdbe7445149a95f6c78c690c477d513;hb=f87db25620f79054cb122d6b16b1609a181da175;hpb=1ed6498c4a0210204bf4b95cc0c0cd6623ad6a0b diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c index 09c12776ec..6afb327df1 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c @@ -339,14 +339,6 @@ EhcFreeUrb ( PciIo->Unmap (PciIo, Urb->DataMap); } - if (Urb->AllocateCommonBuffer) { - PciIo->FreeBuffer ( - PciIo, - EFI_SIZE_TO_PAGES (Urb->DataLen), - Urb->Data - ); - } - if (Urb->Qh != NULL) { // // Ensure that this queue head has been unlinked from the @@ -537,8 +529,7 @@ ON_ERROR: @param Hub The transaction translator to use. @param Type The transaction type. @param Request The standard USB request for control transfer. - @param AllocateCommonBuffer Indicate whether need to allocate common buffer for data transfer. - @param Data The user data to transfer, NULL if AllocateCommonBuffer is TRUE. + @param Data The user data to transfer. @param DataLen The length of data buffer. @param Callback The function to call when data is transferred. @param Context The context to the callback. @@ -558,7 +549,6 @@ EhcCreateUrb ( IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Hub, IN UINTN Type, IN EFI_USB_DEVICE_REQUEST *Request, - IN BOOLEAN AllocateCommonBuffer, IN VOID *Data, IN UINTN DataLen, IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, @@ -606,24 +596,8 @@ EhcCreateUrb ( Ep->PollRate = EhcConvertPollRate (Interval); Urb->Request = Request; - if (AllocateCommonBuffer) { - ASSERT (Data == NULL); - Status = Ehc->PciIo->AllocateBuffer ( - Ehc->PciIo, - AllocateAnyPages, - EfiBootServicesData, - EFI_SIZE_TO_PAGES (DataLen), - &Data, - 0 - ); - if (EFI_ERROR (Status) || (Data == NULL)) { - FreePool (Urb); - return NULL; - } - } Urb->Data = Data; Urb->DataLen = DataLen; - Urb->AllocateCommonBuffer = AllocateCommonBuffer; Urb->Callback = Callback; Urb->Context = Context; @@ -653,14 +627,10 @@ EhcCreateUrb ( if (Data != NULL) { Len = DataLen; - if (Urb->AllocateCommonBuffer) { - MapOp = EfiPciIoOperationBusMasterCommonBuffer; + if (Ep->Direction == EfiUsbDataIn) { + MapOp = EfiPciIoOperationBusMasterWrite; } else { - if (Ep->Direction == EfiUsbDataIn) { - MapOp = EfiPciIoOperationBusMasterWrite; - } else { - MapOp = EfiPciIoOperationBusMasterRead; - } + MapOp = EfiPciIoOperationBusMasterRead; } Status = PciIo->Map (PciIo, MapOp, Data, &Len, &PhyAddr, &Map);