39#define IS_DEVICE_FIXED(a) (a)->FixedDevice ? 1 : 0
41#define UFS_WLUN_RPMB 0xC4
46 UINT32 GranularityAlignment;
49#define SCSI_DISK_DEV_SIGNATURE SIGNATURE_32 ('s', 'c', 'd', 'k')
68 UINTN SenseDataNumber;
86 BOOLEAN BlockLimitsVpdSupported;
99#define SCSI_DISK_DEV_FROM_BLKIO(a) CR (a, SCSI_DISK_DEV, BlkIo, SCSI_DISK_DEV_SIGNATURE)
100#define SCSI_DISK_DEV_FROM_BLKIO2(a) CR (a, SCSI_DISK_DEV, BlkIo2, SCSI_DISK_DEV_SIGNATURE)
101#define SCSI_DISK_DEV_FROM_ERASEBLK(a) CR (a, SCSI_DISK_DEV, EraseBlock, SCSI_DISK_DEV_SIGNATURE)
102#define SCSI_DISK_DEV_FROM_STORSEC(a) CR (a, SCSI_DISK_DEV, StorageSecurity, SCSI_DISK_DEV_SIGNATURE)
104#define SCSI_DISK_DEV_FROM_DISKINFO(a) CR (a, SCSI_DISK_DEV, DiskInfo, SCSI_DISK_DEV_SIGNATURE)
135 UINT8 SenseDataLength;
136 UINT8 HostAdapterStatus;
173#define ACTION_NO_ACTION 0x00
174#define ACTION_READ_CAPACITY 0x01
175#define ACTION_RETRY_COMMAND_LATER 0x02
176#define ACTION_RETRY_WITH_BACKOFF_ALGO 0x03
178#define SCSI_COMMAND_VERSION_1 0x01
179#define SCSI_COMMAND_VERSION_2 0x02
180#define SCSI_COMMAND_VERSION_3 0x03
184#define VENDOR_IDENTIFICATION_OFFSET 3
185#define VENDOR_IDENTIFICATION_LENGTH 8
186#define PRODUCT_IDENTIFICATION_OFFSET 11
187#define PRODUCT_IDENTIFICATION_LENGTH 16
196#define SCSI_DISK_TIMEOUT EFI_TIMER_PERIOD_SECONDS (30)
328 OUT CHAR16 **DriverName
406 OUT CHAR16 **ControllerName
426 IN BOOLEAN ExtendedVerification
516 IN BOOLEAN ExtendedVerification
718 IN UINT32 MediaId OPTIONAL,
720 IN UINT8 SecurityProtocolId,
721 IN UINT16 SecurityProtocolSpecificData,
723 OUT VOID *PayloadBuffer,
788 IN UINT32 MediaId OPTIONAL,
790 IN UINT8 SecurityProtocolId,
791 IN UINT16 SecurityProtocolSpecificData,
793 OUT VOID *PayloadBuffer
816 IN OUT VOID *InquiryData,
817 IN OUT UINT32 *InquiryDataSize
842 IN OUT VOID *IdentifyData,
843 IN OUT UINT32 *IdentifyDataSize
867 IN OUT VOID *SenseData,
868 IN OUT UINT32 *SenseDataSize,
869 OUT UINT8 *SenseDataNumber
887 OUT UINT32 *IdeChannel,
888 OUT UINT32 *IdeDevice
905 IN BOOLEAN MustReadCapacity,
906 OUT BOOLEAN *MediaChange
928 OUT BOOLEAN *NeedRetry,
968 OUT BOOLEAN *NeedRetry,
986 IN UINT8 HostAdapterStatus
1001 IN UINT8 TargetStatus
1024 OUT BOOLEAN *NeedRetry,
1027 IN BOOLEAN AskResetIfError
1043 OUT BOOLEAN *NeedRetry
1161 OUT BOOLEAN *NeedRetry,
1163 OUT UINT8 *DataBuffer,
1164 IN OUT UINT32 *DataLength,
1166 IN UINT32 SectorCount
1186 OUT BOOLEAN *NeedRetry,
1188 IN UINT8 *DataBuffer,
1189 IN OUT UINT32 *DataLength,
1191 IN UINT32 SectorCount
1210 OUT BOOLEAN *NeedRetry,
1212 OUT UINT8 *DataBuffer,
1213 IN OUT UINT32 *DataLength,
1215 IN UINT32 SectorCount
1235 OUT BOOLEAN *NeedRetry,
1237 IN UINT8 *DataBuffer,
1238 IN OUT UINT32 *DataLength,
1240 IN UINT32 SectorCount
1267 IN UINT8 TimesRetry,
1268 OUT UINT8 *DataBuffer,
1269 IN UINT32 DataLength,
1271 IN UINT32 SectorCount,
1300 IN UINT8 TimesRetry,
1301 IN UINT8 *DataBuffer,
1302 IN UINT32 DataLength,
1304 IN UINT32 SectorCount,
1333 IN UINT8 TimesRetry,
1334 OUT UINT8 *DataBuffer,
1335 IN UINT32 DataLength,
1337 IN UINT32 SectorCount,
1366 IN UINT8 TimesRetry,
1367 IN UINT8 *DataBuffer,
1368 IN UINT32 DataLength,
1370 IN UINT32 SectorCount,
1482 OUT BOOLEAN *RetryLater
EFI_STATUS EFIAPI ScsiDiskDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
VOID ParseInquiryData(IN OUT SCSI_DISK_DEV *ScsiDiskDevice)
EFI_STATUS EFIAPI ScsiDiskWriteBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI ScsiDiskSendData(IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, IN UINT32 MediaId OPTIONAL, IN UINT64 Timeout, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN PayloadBufferSize, OUT VOID *PayloadBuffer)
EFI_STATUS EFIAPI ScsiDiskFlushBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN OUT EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS ScsiDiskAsyncWrite10(IN SCSI_DISK_DEV *ScsiDiskDevice, IN UINT64 Timeout, IN UINT8 TimesRetry, IN UINT8 *DataBuffer, IN UINT32 DataLength, IN UINT32 StartLba, IN UINT32 SectorCount, IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req, IN EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS ScsiDiskAsyncRead16(IN SCSI_DISK_DEV *ScsiDiskDevice, IN UINT64 Timeout, IN UINT8 TimesRetry, OUT UINT8 *DataBuffer, IN UINT32 DataLength, IN UINT64 StartLba, IN UINT32 SectorCount, IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req, IN EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS EFIAPI ScsiDiskDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
BOOLEAN ScsiDiskIsHardwareError(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
EFI_STATUS ScsiDiskReadSectors(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT VOID *Buffer, IN EFI_LBA Lba, IN UINTN NumberOfBlocks)
EFI_STATUS EFIAPI ScsiDiskInfoWhichIde(IN EFI_DISK_INFO_PROTOCOL *This, OUT UINT32 *IdeChannel, OUT UINT32 *IdeDevice)
EFI_STATUS ScsiDiskRequestSenseKeys(IN OUT SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, OUT EFI_SCSI_SENSE_DATA **SenseDataArray, OUT UINTN *NumberOfSenseKeys, IN BOOLEAN AskResetIfError)
EFI_STATUS EFIAPI ScsiDiskComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS EFIAPI ScsiDiskFlushBlocks(IN EFI_BLOCK_IO_PROTOCOL *This)
BOOLEAN ScsiDiskIsResetBefore(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
EFI_STATUS EFIAPI ScsiDiskInfoInquiry(IN EFI_DISK_INFO_PROTOCOL *This, IN OUT VOID *InquiryData, IN OUT UINT32 *InquiryDataSize)
EFI_STATUS EFIAPI ScsiDiskReceiveData(IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, IN UINT32 MediaId OPTIONAL, IN UINT64 Timeout, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN PayloadBufferSize, OUT VOID *PayloadBuffer, OUT UINTN *PayloadTransferSize)
EFI_STATUS ScsiDiskAsyncRead10(IN SCSI_DISK_DEV *ScsiDiskDevice, IN UINT64 Timeout, IN UINT8 TimesRetry, OUT UINT8 *DataBuffer, IN UINT32 DataLength, IN UINT32 StartLba, IN UINT32 SectorCount, IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req, IN EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS ScsiDiskWrite10(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, IN UINT64 Timeout, IN UINT8 *DataBuffer, IN OUT UINT32 *DataLength, IN UINT32 StartLba, IN UINT32 SectorCount)
EFI_STATUS EFIAPI ScsiDiskComponentNameGetControllerName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
EFI_STATUS ScsiDiskInquiryDevice(IN OUT SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry)
BOOLEAN ScsiDiskHaveSenseKey(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
BOOLEAN ScsiDiskIsMediaChange(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
EFI_STATUS ScsiDiskRead10(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, IN UINT64 Timeout, OUT UINT8 *DataBuffer, IN OUT UINT32 *DataLength, IN UINT32 StartLba, IN UINT32 SectorCount)
EFI_STATUS EFIAPI ScsiDiskReadBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS ScsiDiskAsyncWrite16(IN SCSI_DISK_DEV *ScsiDiskDevice, IN UINT64 Timeout, IN UINT8 TimesRetry, IN UINT8 *DataBuffer, IN UINT32 DataLength, IN UINT64 StartLba, IN UINT32 SectorCount, IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req, IN EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS ScsiDiskAsyncWriteSectors(IN SCSI_DISK_DEV *ScsiDiskDevice, IN VOID *Buffer, IN EFI_LBA Lba, IN UINTN NumberOfBlocks, IN EFI_BLOCK_IO2_TOKEN *Token)
BOOLEAN DetermineInstallEraseBlock(IN SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_HANDLE ChildHandle)
EFI_STATUS EFIAPI ScsiDiskReset(IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI ScsiDiskWriteBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)
VOID GetMediaInfo(IN OUT SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_SCSI_DISK_CAPACITY_DATA *Capacity10, IN EFI_SCSI_DISK_CAPACITY_DATA16 *Capacity16)
EFI_STATUS DetectMediaParsingSenseKeys(OUT SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN NumberOfSenseKeys, OUT UINTN *Action)
EFI_STATUS EFIAPI ScsiDiskInfoSenseData(IN EFI_DISK_INFO_PROTOCOL *This, IN OUT VOID *SenseData, IN OUT UINT32 *SenseDataSize, OUT UINT8 *SenseDataNumber)
VOID ReleaseScsiDiskDeviceResources(IN SCSI_DISK_DEV *ScsiDiskDevice)
EFI_STATUS CheckTargetStatus(IN UINT8 TargetStatus)
EFI_STATUS ScsiDiskTestUnitReady(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, OUT EFI_SCSI_SENSE_DATA **SenseDataArray, OUT UINTN *NumberOfSenseKeys)
EFI_STATUS ScsiDiskWriteSectors(IN SCSI_DISK_DEV *ScsiDiskDevice, IN VOID *Buffer, IN EFI_LBA Lba, IN UINTN NumberOfBlocks)
EFI_STATUS EFIAPI ScsiDiskResetEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
BOOLEAN DetermineInstallStorageSecurity(IN SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_HANDLE ChildHandle)
EFI_STATUS ScsiDiskAsyncReadSectors(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT VOID *Buffer, IN EFI_LBA Lba, IN UINTN NumberOfBlocks, IN EFI_BLOCK_IO2_TOKEN *Token)
BOOLEAN ScsiDiskIsMediaError(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
EFI_STATUS ScsiDiskReadCapacity(IN OUT SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, OUT EFI_SCSI_SENSE_DATA **SenseDataArray, OUT UINTN *NumberOfSenseKeys)
BOOLEAN ScsiDiskIsDriveReady(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts, OUT BOOLEAN *RetryLater)
BOOLEAN DetermineInstallBlockIo(IN EFI_HANDLE ChildHandle)
EFI_STATUS CheckHostAdapterStatus(IN UINT8 HostAdapterStatus)
EFI_STATUS ScsiDiskDetectMedia(IN SCSI_DISK_DEV *ScsiDiskDevice, IN BOOLEAN MustReadCapacity, OUT BOOLEAN *MediaChange)
EFI_STATUS EFIAPI ScsiDiskReadBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI ScsiDiskEraseBlocks(IN EFI_ERASE_BLOCK_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_ERASE_BLOCK_TOKEN *Token, IN UINTN Size)
VOID *EFIAPI GetParentProtocol(IN EFI_GUID *ProtocolGuid, IN EFI_HANDLE ChildHandle)
EFI_STATUS ScsiDiskRead16(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, IN UINT64 Timeout, OUT UINT8 *DataBuffer, IN OUT UINT32 *DataLength, IN UINT64 StartLba, IN UINT32 SectorCount)
EFI_STATUS ScsiDiskWrite16(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, IN UINT64 Timeout, IN UINT8 *DataBuffer, IN OUT UINT32 *DataLength, IN UINT64 StartLba, IN UINT32 SectorCount)
EFI_STATUS EFIAPI ScsiDiskDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
VOID InitializeInstallDiskInfo(IN SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_HANDLE ChildHandle)
EFI_STATUS EFIAPI ScsiDiskInfoIdentify(IN EFI_DISK_INFO_PROTOCOL *This, IN OUT VOID *IdentifyData, IN OUT UINT32 *IdentifyDataSize)
BOOLEAN ScsiDiskIsNoMedia(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)