Lines Matching defs:Urb
173 Check if the Trb is a transaction of the URB.
178 @retval TRUE It is a transaction of the URB.
179 @retval FALSE It is not any transaction of the URB.
206 Check the URB's execution result and update the URB's
210 @param Urb The URB to check result.
216 IN URB *Urb
223 URB *CheckedUrb;
228 ASSERT ((Handle != NULL) && (Urb != NULL));
230 if (Urb->Finished) {
257 if (IsTrbInTrsRing ((TRANSFER_RING *)(UINTN)(Urb->Ring), TRBPtr)) {
258 CheckedUrb = Urb;
285 // This Urb has been processed
315 @param Urb The pointer to URB.
324 IN URB *Urb
332 Dcdb = (Urb->Direction == EfiUsbDataIn) ? 0x100 : 0x0;
344 Execute the transfer by polling the URB. This is a synchronous operation.
347 @param Urb The URB to execute.
354 IN URB *Urb,
367 XhcRingDoorBell (Handle, Urb);
372 XhcCheckUrbResult (Handle, Urb);
373 if (Urb->Finished) {
382 Urb->Result |= EFI_USB_ERR_TIMEOUT;
385 // If URB transfer is error, restore transfer ring to original value before URB transfer
388 Ring = (TRANSFER_RING *)(UINTN) Urb->Ring;
389 if ((Urb->Result != EFI_USB_NOERROR) && (Urb->Direction == EfiUsbDataIn)) {
393 Ring->RingEnqueue = Urb->Trb;
397 Trb = (TRB_TEMPLATE *)(UINTN) Urb->Trb;
411 @param Urb The urb used to construct the transfer TRB.
419 IN URB *Urb
425 if (Urb->Direction == EfiUsbDataIn) {
431 Urb->Ring = (EFI_PHYSICAL_ADDRESS)(UINTN) EPRing;
434 Urb->Trb = EPRing->RingEnqueue;
436 Trb->TrbNormal.TRBPtrLo = XHC_LOW_32BIT (Urb->Data);
437 Trb->TrbNormal.TRBPtrHi = XHC_HIGH_32BIT (Urb->Data);
438 Trb->TrbNormal.Length = Urb->DataLen;
454 Create a new URB for a new transaction.
461 @return Created URB or NULL
464 URB*
473 URB *Urb;
477 Urb = &Handle->UrbIn;
479 Urb = &Handle->UrbOut;
482 UrbData = Urb->Data;
484 ZeroMem (Urb, sizeof (URB));
485 Urb->Direction = Direction;
492 Urb->Data = UrbData;
496 // Do not break URB data in buffer as it may contain the data which were just put in via DMA by XHC
498 Urb->DataLen = (UINT32) DataLen;
501 // Put data into URB data out buffer which will create TRBs
503 ZeroMem ((VOID*)(UINTN) Urb->Data, DataLen);
504 CopyMem ((VOID*)(UINTN) Urb->Data, Data, DataLen);
505 Urb->DataLen = (UINT32) DataLen;
508 Status = XhcCreateTransferTrb (Handle, Urb);
511 return Urb;
542 URB *Urb;
553 // Create a new URB, insert it into the asynchronous
556 Urb = XhcCreateUrb (Handle, Direction, Data, *DataLength);
557 ASSERT (Urb != NULL);
559 XhcExecTransfer (Handle, Urb, Timeout);
561 *DataLength = Urb->Completed;
564 if (Urb->Result == EFI_USB_NOERROR) {
573 CopyMem (Data, (VOID *)(UINTN)Urb