/* Refer to SDIO Simplified Spec 3 Section 3.2 for details. */
EFI_STATUS SdioSendOpCond(IN SD_PEIM_HC_SLOT *Slot, IN UINT32 VoltageWindow, IN BOOLEAN S18r)
/* Refer to SDIO Simplified Spec 3 Section 3.2 for details. */
EFI_STATUS SdioSendOpCond(IN SD_PEIM_HC_SLOT *Slot, IN UINT32 VoltageWindow, IN BOOLEAN S18r)
{
  SD_COMMAND_BLOCK   SdCmdBlk;
  SD_STATUS_BLOCK    SdStatusBlk;
  SD_COMMAND_PACKET  Packet;
  EFI_STATUS         Status;
  UINT32             Switch;
  ZeroMem (&SdCmdBlk, sizeof (SdCmdBlk));
  ZeroMem (&SdStatusBlk, sizeof (SdStatusBlk));
  ZeroMem (&Packet, sizeof (Packet));
  Packet.SdCmdBlk    = &SdCmdBlk;
  Packet.SdStatusBlk = &SdStatusBlk;
  Packet.Timeout     = SD_TIMEOUT;
  SdCmdBlk.CommandIndex = SDIO_SEND_OP_COND;
  SdCmdBlk.CommandType  = SdCommandTypeBcr;
  SdCmdBlk.ResponseType = SdResponseTypeR4;
  Switch = S18r ? BIT24 : 0;
  SdCmdBlk.CommandArgument = (VoltageWindow & 0xFFFFFF) | Switch;
  Status = SdPeimExecCmd (Slot, &Packet);
  return Status;
}