PciIo->Unmap (PciIo, Urb->DataMap);\r
}\r
\r
- if (Urb->AllocateCommonBuffer) {\r
- PciIo->FreeBuffer (\r
- PciIo,\r
- EFI_SIZE_TO_PAGES (Urb->DataLen),\r
- Urb->Data\r
- );\r
- }\r
-\r
if (Urb->Qh != NULL) {\r
//\r
// Ensure that this queue head has been unlinked from the\r
@param Hub The transaction translator to use.\r
@param Type The transaction type.\r
@param Request The standard USB request for control transfer.\r
- @param AllocateCommonBuffer Indicate whether need to allocate common buffer for data transfer.\r
- @param Data The user data to transfer, NULL if AllocateCommonBuffer is TRUE.\r
+ @param Data The user data to transfer.\r
@param DataLen The length of data buffer.\r
@param Callback The function to call when data is transferred.\r
@param Context The context to the callback.\r
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Hub,\r
IN UINTN Type,\r
IN EFI_USB_DEVICE_REQUEST *Request,\r
- IN BOOLEAN AllocateCommonBuffer,\r
IN VOID *Data,\r
IN UINTN DataLen,\r
IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback,\r
Ep->PollRate = EhcConvertPollRate (Interval);\r
\r
Urb->Request = Request;\r
- if (AllocateCommonBuffer) {\r
- ASSERT (Data == NULL);\r
- Status = Ehc->PciIo->AllocateBuffer (\r
- Ehc->PciIo,\r
- AllocateAnyPages,\r
- EfiBootServicesData,\r
- EFI_SIZE_TO_PAGES (DataLen),\r
- &Data,\r
- 0\r
- );\r
- if (EFI_ERROR (Status) || (Data == NULL)) {\r
- FreePool (Urb);\r
- return NULL;\r
- }\r
- }\r
Urb->Data = Data;\r
Urb->DataLen = DataLen;\r
- Urb->AllocateCommonBuffer = AllocateCommonBuffer;\r
Urb->Callback = Callback;\r
Urb->Context = Context;\r
\r
if (Data != NULL) {\r
Len = DataLen;\r
\r
- if (Urb->AllocateCommonBuffer) {\r
- MapOp = EfiPciIoOperationBusMasterCommonBuffer;\r
+ if (Ep->Direction == EfiUsbDataIn) {\r
+ MapOp = EfiPciIoOperationBusMasterWrite;\r
} else {\r
- if (Ep->Direction == EfiUsbDataIn) {\r
- MapOp = EfiPciIoOperationBusMasterWrite;\r
- } else {\r
- MapOp = EfiPciIoOperationBusMasterRead;\r
- }\r
+ MapOp = EfiPciIoOperationBusMasterRead;\r
}\r
\r
Status = PciIo->Map (PciIo, MapOp, Data, &Len, &PhyAddr, &Map);\r