/* This is the NotifyFunction passed to CreateEvent in the FastbootAppEntryPoint It will be called by the UEFI event framework when the transport protocol implementation signals that data has been received from the Fastboot host. The parameters are ignored.  */
STATIC VOID DataReady(IN EFI_EVENT Event, IN VOID *Context)
/* This is the NotifyFunction passed to CreateEvent in the FastbootAppEntryPoint It will be called by the UEFI event framework when the transport protocol implementation signals that data has been received from the Fastboot host. The parameters are ignored.  */
STATIC VOID DataReady(IN EFI_EVENT Event, IN VOID *Context)
{
  UINTN       Size;
  VOID        *Data;
  EFI_STATUS  Status;
  do {
    Status = mTransport->Receive (&Size, &Data);
    if (!EFI_ERROR (Status)) {
      if (mState == ExpectCmdState) {
        AcceptCmd (Size, (CHAR8 *)Data);
      } else if (mState == ExpectDataState) {
        AcceptData (Size, Data);
      } else {
        ASSERT (FALSE);
      }
      FreePool (Data);
    }
  } while (!EFI_ERROR (Status));
  if (Status != EFI_NOT_READY) {
    ASSERT (Status == EFI_DEVICE_ERROR);
    mTextOut->OutputString (mTextOut, L"\r\nFatal error receiving data. Exiting.\r\n");
    gBS->SignalEvent (mFinishedEvent);
  }
}