/* For Serial ATA (SATA) controllers, this member function can be used to disqualify a higher transfer rate mode on a given channel. For example, a platform driver may inform the IDE controller driver to not use second-generation (Gen2) speeds for a certain SATA drive. */
EFI_STATUS EFIAPI IdeInitDisqualifyMode(IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, IN UINT8 Channel, IN UINT8 Device, IN EFI_ATA_COLLECTIVE_MODE *BadModes)
/* For Serial ATA (SATA) controllers, this member function can be used to disqualify a higher transfer rate mode on a given channel. For example, a platform driver may inform the IDE controller driver to not use second-generation (Gen2) speeds for a certain SATA drive. */
EFI_STATUS EFIAPI IdeInitDisqualifyMode(IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, IN UINT8 Channel, IN UINT8 Device, IN EFI_ATA_COLLECTIVE_MODE *BadModes)
{
  EFI_SATA_CONTROLLER_PRIVATE_DATA  *Private;
  UINTN                             DeviceIndex;
  ASSERT (This != NULL);
  Private = SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS (This);
  if ((Channel >= This->ChannelCount) || (BadModes == NULL) || (Device >= Private->DeviceCount)) {
    return EFI_INVALID_PARAMETER;
  }
  DeviceIndex = FlatDeviceIndex (Private, Channel, Device);
  CopyMem (
    &(Private->DisqualifiedModes[DeviceIndex]),
    BadModes,
    sizeof (EFI_ATA_COLLECTIVE_MODE)
    );
  return EFI_SUCCESS;
}