/* This function tries to fill 512-byte ATAPI_IDENTIFY_DATA for ATAPI device to implement Identify() interface for DiskInfo protocol. The ATA command is sent via SCSI Request Packet. */
EFI_STATUS AtapiIdentifyDevice(IN OUT SCSI_DISK_DEV *ScsiDiskDevice)
/* This function tries to fill 512-byte ATAPI_IDENTIFY_DATA for ATAPI device to implement Identify() interface for DiskInfo protocol. The ATA command is sent via SCSI Request Packet. */
EFI_STATUS AtapiIdentifyDevice(IN OUT SCSI_DISK_DEV *ScsiDiskDevice)
{
  EFI_SCSI_IO_SCSI_REQUEST_PACKET  CommandPacket;
  UINT8                            Cdb[6];
  ZeroMem (&CommandPacket, sizeof (CommandPacket));
  ZeroMem (Cdb, sizeof (Cdb));
  Cdb[0]                         = ATA_CMD_IDENTIFY_DEVICE;
  CommandPacket.Timeout          = SCSI_DISK_TIMEOUT;
  CommandPacket.Cdb              = Cdb;
  CommandPacket.CdbLength        = (UINT8)sizeof (Cdb);
  CommandPacket.InDataBuffer     = &ScsiDiskDevice->IdentifyData;
  CommandPacket.InTransferLength = sizeof (ScsiDiskDevice->IdentifyData);
  return ScsiDiskDevice->ScsiIo->ExecuteScsiCommand (ScsiDiskDevice->ScsiIo, &CommandPacket, NULL);
}