/* Gets the device path of a specific storage security device. */
EFI_STATUS EFIAPI AhciStorageSecurityGetDevicePath(IN EDKII_PEI_STORAGE_SECURITY_CMD_PPI *This, IN UINTN DeviceIndex, OUT UINTN *DevicePathLength, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
/* Gets the device path of a specific storage security device. */
EFI_STATUS EFIAPI AhciStorageSecurityGetDevicePath(IN EDKII_PEI_STORAGE_SECURITY_CMD_PPI *This, IN UINTN DeviceIndex, OUT UINTN *DevicePathLength, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
{
  PEI_AHCI_CONTROLLER_PRIVATE_DATA  *Private;
  PEI_AHCI_ATA_DEVICE_DATA          *DeviceData;
  EFI_STATUS                        Status;
  if ((This == NULL) || (DevicePathLength == NULL) || (DevicePath == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  Private = GET_AHCI_PEIM_HC_PRIVATE_DATA_FROM_THIS_STROAGE_SECURITY (This);
  if ((DeviceIndex == 0) || (DeviceIndex > Private->TrustComputingDevices)) {
    return EFI_INVALID_PARAMETER;
  }
  DeviceData = SearchTrustComputingDeviceByIndex (Private, DeviceIndex);
  if (DeviceData == NULL) {
    return EFI_NOT_FOUND;
  }
  Status = AhciBuildDevicePath (
             Private,
             DeviceData->Port,
             DeviceData->PortMultiplier,
             DevicePathLength,
             DevicePath
             );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  return EFI_SUCCESS;
}