TianoCore EDK2 master
Loading...
Searching...
No Matches
ScsiDisk.h
Go to the documentation of this file.
1
10#ifndef _SCSI_DISK_H_
11#define _SCSI_DISK_H_
12
13#include <Uefi.h>
14
15#include <Protocol/ScsiIo.h>
17#include <Protocol/BlockIo.h>
18#include <Protocol/BlockIo2.h>
19#include <Protocol/EraseBlock.h>
23#include <Protocol/DiskInfo.h>
25
26#include <Library/DebugLib.h>
28#include <Library/UefiLib.h>
31#include <Library/UefiScsiLib.h>
34#include <Library/PrintLib.h>
35
38
39#define IS_DEVICE_FIXED(a) (a)->FixedDevice ? 1 : 0
40
41#define UFS_WLUN_RPMB 0xC4
42
43typedef struct {
44 UINT32 MaxLbaCnt;
45 UINT32 MaxBlkDespCnt;
46 UINT32 GranularityAlignment;
48
49#define SCSI_DISK_DEV_SIGNATURE SIGNATURE_32 ('s', 'c', 'd', 'k')
50
51typedef struct {
52 UINT32 Signature;
53
54 EFI_HANDLE Handle;
55
57
60 EFI_BLOCK_IO_MEDIA BlkIoMedia;
61 EFI_ERASE_BLOCK_PROTOCOL EraseBlock;
63 UINT8 DeviceType;
64 BOOLEAN FixedDevice;
65 UINT16 Reserved;
66
67 EFI_SCSI_SENSE_DATA *SenseData;
68 UINTN SenseDataNumber;
69 EFI_SCSI_INQUIRY_DATA InquiryData;
70
71 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
72
74
75 //
76 // The following fields are only valid for ATAPI/SATA device
77 //
78 UINT32 Channel;
79 UINT32 Device;
80 ATAPI_IDENTIFY_DATA IdentifyData;
81
82 //
83 // Scsi UNMAP command parameters information
84 //
85 SCSI_UNMAP_PARAM_INFO UnmapInfo;
86 BOOLEAN BlockLimitsVpdSupported;
87
88 //
89 // The flag indicates if 16-byte command can be used
90 //
91 BOOLEAN Cdb16Byte;
92
93 //
94 // The queue for asynchronous task requests
95 //
96 LIST_ENTRY AsyncTaskQueue;
98
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)
103
104#define SCSI_DISK_DEV_FROM_DISKINFO(a) CR (a, SCSI_DISK_DEV, DiskInfo, SCSI_DISK_DEV_SIGNATURE)
105
106//
107// Asynchronous I/O request
108//
109//
110// Private data structure for a BlockIo2 request
111//
112typedef struct {
113 EFI_BLOCK_IO2_TOKEN *Token;
114 //
115 // The flag indicates if the last Scsi Read/Write sub-task for a BlockIo2
116 // request is sent to device
117 //
118 BOOLEAN LastScsiRW;
119
120 //
121 // The queue for Scsi Read/Write sub-tasks of a BlockIo2 request
122 //
123 LIST_ENTRY ScsiRWQueue;
124
125 LIST_ENTRY Link;
127
128//
129// Private data structure for a SCSI Read/Write request
130//
131typedef struct {
132 SCSI_DISK_DEV *ScsiDiskDevice;
133 UINT64 Timeout;
134 EFI_SCSI_SENSE_DATA *SenseData;
135 UINT8 SenseDataLength;
136 UINT8 HostAdapterStatus;
137 UINT8 TargetStatus;
138 UINT8 *InBuffer;
139 UINT8 *OutBuffer;
140 UINT32 DataLength;
141 UINT64 StartLba;
142 UINT32 SectorCount;
143 UINT8 TimesRetry;
144
145 //
146 // The BlockIo2 request this SCSI command belongs to
147 //
148 SCSI_BLKIO2_REQUEST *BlkIo2Req;
149
150 LIST_ENTRY Link;
152
153//
154// Private data structure for an EraseBlock request
155//
156typedef struct {
158
160
161 LIST_ENTRY Link;
163
164//
165// Global Variables
166//
167extern EFI_DRIVER_BINDING_PROTOCOL gScsiDiskDriverBinding;
168extern EFI_COMPONENT_NAME_PROTOCOL gScsiDiskComponentName;
169extern EFI_COMPONENT_NAME2_PROTOCOL gScsiDiskComponentName2;
170//
171// action code used in detect media process
172//
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
177
178#define SCSI_COMMAND_VERSION_1 0x01
179#define SCSI_COMMAND_VERSION_2 0x02
180#define SCSI_COMMAND_VERSION_3 0x03
181
182// Per SCSI spec, EFI_SCSI_INQUIRY_DATA.Reserved_5_95[3 - 10] has the Vendor identification
183// EFI_SCSI_INQUIRY_DATA.Reserved_5_95[11 - 26] has the product identification
184#define VENDOR_IDENTIFICATION_OFFSET 3
185#define VENDOR_IDENTIFICATION_LENGTH 8
186#define PRODUCT_IDENTIFICATION_OFFSET 11
187#define PRODUCT_IDENTIFICATION_LENGTH 16
188
189//
190// SCSI Disk Timeout Experience Value
191//
192// As ScsiDisk and ScsiBus driver are used to manage SCSI or ATAPI devices, the timeout
193// value is updated to 30s to follow ATA/ATAPI spec in which the device may take up to 30s
194// to respond command.
195//
196#define SCSI_DISK_TIMEOUT EFI_TIMER_PERIOD_SECONDS (30)
197
218EFIAPI
221 IN EFI_HANDLE Controller,
222 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
223 );
224
245EFIAPI
248 IN EFI_HANDLE Controller,
249 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
250 );
251
272EFIAPI
275 IN EFI_HANDLE Controller,
276 IN UINTN NumberOfChildren,
277 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
278 );
279
280//
281// EFI Component Name Functions
282//
283
324EFIAPI
327 IN CHAR8 *Language,
328 OUT CHAR16 **DriverName
329 );
330
400EFIAPI
403 IN EFI_HANDLE ControllerHandle,
404 IN EFI_HANDLE ChildHandle OPTIONAL,
405 IN CHAR8 *Language,
406 OUT CHAR16 **ControllerName
407 );
408
423EFIAPI
426 IN BOOLEAN ExtendedVerification
427 );
428
447EFIAPI
450 IN UINT32 MediaId,
451 IN EFI_LBA Lba,
452 IN UINTN BufferSize,
453 OUT VOID *Buffer
454 );
455
475EFIAPI
478 IN UINT32 MediaId,
479 IN EFI_LBA Lba,
480 IN UINTN BufferSize,
481 IN VOID *Buffer
482 );
483
495EFIAPI
498 );
499
513EFIAPI
516 IN BOOLEAN ExtendedVerification
517 );
518
546EFIAPI
549 IN UINT32 MediaId,
550 IN EFI_LBA Lba,
552 IN UINTN BufferSize,
553 OUT VOID *Buffer
554 );
555
580EFIAPI
583 IN UINT32 MediaId,
584 IN EFI_LBA Lba,
586 IN UINTN BufferSize,
587 IN VOID *Buffer
588 );
589
605EFIAPI
609 );
610
639EFIAPI
642 IN UINT32 MediaId,
643 IN EFI_LBA Lba,
645 IN UINTN Size
646 );
647
715EFIAPI
718 IN UINT32 MediaId OPTIONAL,
719 IN UINT64 Timeout,
720 IN UINT8 SecurityProtocolId,
721 IN UINT16 SecurityProtocolSpecificData,
722 IN UINTN PayloadBufferSize,
723 OUT VOID *PayloadBuffer,
724 OUT UINTN *PayloadTransferSize
725 );
726
785EFIAPI
788 IN UINT32 MediaId OPTIONAL,
789 IN UINT64 Timeout,
790 IN UINT8 SecurityProtocolId,
791 IN UINT16 SecurityProtocolSpecificData,
792 IN UINTN PayloadBufferSize,
793 OUT VOID *PayloadBuffer
794 );
795
813EFIAPI
816 IN OUT VOID *InquiryData,
817 IN OUT UINT32 *InquiryDataSize
818 );
819
839EFIAPI
842 IN OUT VOID *IdentifyData,
843 IN OUT UINT32 *IdentifyDataSize
844 );
845
864EFIAPI
867 IN OUT VOID *SenseData,
868 IN OUT UINT32 *SenseDataSize,
869 OUT UINT8 *SenseDataNumber
870 );
871
884EFIAPI
887 OUT UINT32 *IdeChannel,
888 OUT UINT32 *IdeDevice
889 );
890
904 IN SCSI_DISK_DEV *ScsiDiskDevice,
905 IN BOOLEAN MustReadCapacity,
906 OUT BOOLEAN *MediaChange
907 );
908
927 IN SCSI_DISK_DEV *ScsiDiskDevice,
928 OUT BOOLEAN *NeedRetry,
929 OUT EFI_SCSI_SENSE_DATA **SenseDataArray,
930 OUT UINTN *NumberOfSenseKeys
931 );
932
947 OUT SCSI_DISK_DEV *ScsiDiskDevice,
948 IN EFI_SCSI_SENSE_DATA *SenseData,
949 IN UINTN NumberOfSenseKeys,
950 OUT UINTN *Action
951 );
952
967 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
968 OUT BOOLEAN *NeedRetry,
969 OUT EFI_SCSI_SENSE_DATA **SenseDataArray,
970 OUT UINTN *NumberOfSenseKeys
971 );
972
986 IN UINT8 HostAdapterStatus
987 );
988
1001 IN UINT8 TargetStatus
1002 );
1003
1023 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
1024 OUT BOOLEAN *NeedRetry,
1025 OUT EFI_SCSI_SENSE_DATA **SenseDataArray,
1026 OUT UINTN *NumberOfSenseKeys,
1027 IN BOOLEAN AskResetIfError
1028 );
1029
1042 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
1043 OUT BOOLEAN *NeedRetry
1044 );
1045
1052VOID
1054 IN OUT SCSI_DISK_DEV *ScsiDiskDevice
1055 );
1056
1071 IN SCSI_DISK_DEV *ScsiDiskDevice,
1072 OUT VOID *Buffer,
1073 IN EFI_LBA Lba,
1074 IN UINTN NumberOfBlocks
1075 );
1076
1091 IN SCSI_DISK_DEV *ScsiDiskDevice,
1092 IN VOID *Buffer,
1093 IN EFI_LBA Lba,
1094 IN UINTN NumberOfBlocks
1095 );
1096
1114 IN SCSI_DISK_DEV *ScsiDiskDevice,
1115 OUT VOID *Buffer,
1116 IN EFI_LBA Lba,
1117 IN UINTN NumberOfBlocks,
1118 IN EFI_BLOCK_IO2_TOKEN *Token
1119 );
1120
1138 IN SCSI_DISK_DEV *ScsiDiskDevice,
1139 IN VOID *Buffer,
1140 IN EFI_LBA Lba,
1141 IN UINTN NumberOfBlocks,
1142 IN EFI_BLOCK_IO2_TOKEN *Token
1143 );
1144
1160 IN SCSI_DISK_DEV *ScsiDiskDevice,
1161 OUT BOOLEAN *NeedRetry,
1162 IN UINT64 Timeout,
1163 OUT UINT8 *DataBuffer,
1164 IN OUT UINT32 *DataLength,
1165 IN UINT32 StartLba,
1166 IN UINT32 SectorCount
1167 );
1168
1185 IN SCSI_DISK_DEV *ScsiDiskDevice,
1186 OUT BOOLEAN *NeedRetry,
1187 IN UINT64 Timeout,
1188 IN UINT8 *DataBuffer,
1189 IN OUT UINT32 *DataLength,
1190 IN UINT32 StartLba,
1191 IN UINT32 SectorCount
1192 );
1193
1209 IN SCSI_DISK_DEV *ScsiDiskDevice,
1210 OUT BOOLEAN *NeedRetry,
1211 IN UINT64 Timeout,
1212 OUT UINT8 *DataBuffer,
1213 IN OUT UINT32 *DataLength,
1214 IN UINT64 StartLba,
1215 IN UINT32 SectorCount
1216 );
1217
1234 IN SCSI_DISK_DEV *ScsiDiskDevice,
1235 OUT BOOLEAN *NeedRetry,
1236 IN UINT64 Timeout,
1237 IN UINT8 *DataBuffer,
1238 IN OUT UINT32 *DataLength,
1239 IN UINT64 StartLba,
1240 IN UINT32 SectorCount
1241 );
1242
1265 IN SCSI_DISK_DEV *ScsiDiskDevice,
1266 IN UINT64 Timeout,
1267 IN UINT8 TimesRetry,
1268 OUT UINT8 *DataBuffer,
1269 IN UINT32 DataLength,
1270 IN UINT32 StartLba,
1271 IN UINT32 SectorCount,
1272 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1273 IN EFI_BLOCK_IO2_TOKEN *Token
1274 );
1275
1298 IN SCSI_DISK_DEV *ScsiDiskDevice,
1299 IN UINT64 Timeout,
1300 IN UINT8 TimesRetry,
1301 IN UINT8 *DataBuffer,
1302 IN UINT32 DataLength,
1303 IN UINT32 StartLba,
1304 IN UINT32 SectorCount,
1305 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1306 IN EFI_BLOCK_IO2_TOKEN *Token
1307 );
1308
1331 IN SCSI_DISK_DEV *ScsiDiskDevice,
1332 IN UINT64 Timeout,
1333 IN UINT8 TimesRetry,
1334 OUT UINT8 *DataBuffer,
1335 IN UINT32 DataLength,
1336 IN UINT64 StartLba,
1337 IN UINT32 SectorCount,
1338 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1339 IN EFI_BLOCK_IO2_TOKEN *Token
1340 );
1341
1364 IN SCSI_DISK_DEV *ScsiDiskDevice,
1365 IN UINT64 Timeout,
1366 IN UINT8 TimesRetry,
1367 IN UINT8 *DataBuffer,
1368 IN UINT32 DataLength,
1369 IN UINT64 StartLba,
1370 IN UINT32 SectorCount,
1371 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1372 IN EFI_BLOCK_IO2_TOKEN *Token
1373 );
1374
1382VOID
1384 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
1385 IN EFI_SCSI_DISK_CAPACITY_DATA *Capacity10,
1387 );
1388
1398BOOLEAN
1400 IN EFI_SCSI_SENSE_DATA *SenseData,
1401 IN UINTN SenseCounts
1402 );
1403
1414BOOLEAN
1416 IN EFI_SCSI_SENSE_DATA *SenseData,
1417 IN UINTN SenseCounts
1418 );
1419
1430BOOLEAN
1432 IN EFI_SCSI_SENSE_DATA *SenseData,
1433 IN UINTN SenseCounts
1434 );
1435
1445BOOLEAN
1447 IN EFI_SCSI_SENSE_DATA *SenseData,
1448 IN UINTN SenseCounts
1449 );
1450
1461BOOLEAN
1463 IN EFI_SCSI_SENSE_DATA *SenseData,
1464 IN UINTN SenseCounts
1465 );
1466
1478BOOLEAN
1480 IN EFI_SCSI_SENSE_DATA *SenseData,
1481 IN UINTN SenseCounts,
1482 OUT BOOLEAN *RetryLater
1483 );
1484
1495BOOLEAN
1497 IN EFI_SCSI_SENSE_DATA *SenseData,
1498 IN UINTN SenseCounts
1499 );
1500
1507VOID
1509 IN SCSI_DISK_DEV *ScsiDiskDevice
1510 );
1511
1522BOOLEAN
1524 IN EFI_HANDLE ChildHandle
1525 );
1526
1539VOID
1541 IN SCSI_DISK_DEV *ScsiDiskDevice,
1542 IN EFI_HANDLE ChildHandle
1543 );
1544
1557VOID *
1558EFIAPI
1560 IN EFI_GUID *ProtocolGuid,
1561 IN EFI_HANDLE ChildHandle
1562 );
1563
1574BOOLEAN
1576 IN SCSI_DISK_DEV *ScsiDiskDevice,
1577 IN EFI_HANDLE ChildHandle
1578 );
1579
1590BOOLEAN
1592 IN SCSI_DISK_DEV *ScsiDiskDevice,
1593 IN EFI_HANDLE ChildHandle
1594 );
1595
1596#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI ScsiDiskDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
Definition: ScsiDisk.c:458
VOID ParseInquiryData(IN OUT SCSI_DISK_DEV *ScsiDiskDevice)
Definition: ScsiDisk.c:3434
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)
Definition: ScsiDisk.c:1188
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)
Definition: ScsiDisk.c:2154
EFI_STATUS EFIAPI ScsiDiskFlushBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN OUT EFI_BLOCK_IO2_TOKEN *Token)
Definition: ScsiDisk.c:1363
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)
Definition: ScsiDisk.c:5124
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)
Definition: ScsiDisk.c:5242
EFI_STATUS EFIAPI ScsiDiskDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
Definition: ScsiDisk.c:156
BOOLEAN ScsiDiskIsHardwareError(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
Definition: ScsiDisk.c:5589
EFI_STATUS ScsiDiskReadSectors(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT VOID *Buffer, IN EFI_LBA Lba, IN UINTN NumberOfBlocks)
Definition: ScsiDisk.c:3455
EFI_STATUS EFIAPI ScsiDiskInfoWhichIde(IN EFI_DISK_INFO_PROTOCOL *This, OUT UINT32 *IdeChannel, OUT UINT32 *IdeDevice)
Definition: ScsiDisk.c:6275
EFI_STATUS ScsiDiskRequestSenseKeys(IN OUT SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, OUT EFI_SCSI_SENSE_DATA **SenseDataArray, OUT UINTN *NumberOfSenseKeys, IN BOOLEAN AskResetIfError)
Definition: ScsiDisk.c:3276
EFI_STATUS EFIAPI ScsiDiskComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
Definition: ComponentName.c:75
EFI_STATUS EFIAPI ScsiDiskFlushBlocks(IN EFI_BLOCK_IO_PROTOCOL *This)
Definition: ScsiDisk.c:917
BOOLEAN ScsiDiskIsResetBefore(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
Definition: ScsiDisk.c:5665
EFI_STATUS EFIAPI ScsiDiskInfoInquiry(IN EFI_DISK_INFO_PROTOCOL *This, IN OUT VOID *InquiryData, IN OUT UINT32 *InquiryDataSize)
Definition: ScsiDisk.c:6164
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)
Definition: ScsiDisk.c:1936
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)
Definition: ScsiDisk.c:5006
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)
Definition: ScsiDisk.c:4346
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)
Definition: ScsiDisk.c:2526
BOOLEAN ScsiDiskHaveSenseKey(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
Definition: ScsiDisk.c:5776
BOOLEAN ScsiDiskIsMediaChange(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
Definition: ScsiDisk.c:5625
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)
Definition: ScsiDisk.c:4221
EFI_STATUS EFIAPI ScsiDiskReadBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer)
Definition: ScsiDisk.c:616
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)
Definition: ScsiDisk.c:5360
EFI_STATUS ScsiDiskAsyncWriteSectors(IN SCSI_DISK_DEV *ScsiDiskDevice, IN VOID *Buffer, IN EFI_LBA Lba, IN UINTN NumberOfBlocks, IN EFI_BLOCK_IO2_TOKEN *Token)
Definition: ScsiDisk.c:4005
BOOLEAN DetermineInstallEraseBlock(IN SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_HANDLE ChildHandle)
Definition: ScsiDisk.c:5951
EFI_STATUS EFIAPI ScsiDiskReset(IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
Definition: ScsiDisk.c:557
EFI_STATUS EFIAPI ScsiDiskWriteBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)
Definition: ScsiDisk.c:768
VOID GetMediaInfo(IN OUT SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_SCSI_DISK_CAPACITY_DATA *Capacity10, IN EFI_SCSI_DISK_CAPACITY_DATA16 *Capacity16)
Definition: ScsiDisk.c:3373
EFI_STATUS DetectMediaParsingSenseKeys(OUT SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN NumberOfSenseKeys, OUT UINTN *Action)
Definition: ScsiDisk.c:2923
EFI_STATUS EFIAPI ScsiDiskInfoSenseData(IN EFI_DISK_INFO_PROTOCOL *This, IN OUT VOID *SenseData, IN OUT UINT32 *SenseDataSize, OUT UINT8 *SenseDataNumber)
Definition: ScsiDisk.c:6252
VOID ReleaseScsiDiskDeviceResources(IN SCSI_DISK_DEV *ScsiDiskDevice)
Definition: ScsiDisk.c:5816
EFI_STATUS CheckTargetStatus(IN UINT8 TargetStatus)
Definition: ScsiDisk.c:3234
EFI_STATUS ScsiDiskTestUnitReady(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, OUT EFI_SCSI_SENSE_DATA **SenseDataArray, OUT UINTN *NumberOfSenseKeys)
Definition: ScsiDisk.c:2809
EFI_STATUS ScsiDiskWriteSectors(IN SCSI_DISK_DEV *ScsiDiskDevice, IN VOID *Buffer, IN EFI_LBA Lba, IN UINTN NumberOfBlocks)
Definition: ScsiDisk.c:3620
EFI_STATUS EFIAPI ScsiDiskResetEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
Definition: ScsiDisk.c:941
BOOLEAN DetermineInstallStorageSecurity(IN SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_HANDLE ChildHandle)
Definition: ScsiDisk.c:6096
EFI_STATUS ScsiDiskAsyncReadSectors(IN SCSI_DISK_DEV *ScsiDiskDevice, OUT VOID *Buffer, IN EFI_LBA Lba, IN UINTN NumberOfBlocks, IN EFI_BLOCK_IO2_TOKEN *Token)
Definition: ScsiDisk.c:3787
BOOLEAN ScsiDiskIsMediaError(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
Definition: ScsiDisk.c:5507
EFI_STATUS ScsiDiskReadCapacity(IN OUT SCSI_DISK_DEV *ScsiDiskDevice, OUT BOOLEAN *NeedRetry, OUT EFI_SCSI_SENSE_DATA **SenseDataArray, OUT UINTN *NumberOfSenseKeys)
Definition: ScsiDisk.c:3017
BOOLEAN ScsiDiskIsDriveReady(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts, OUT BOOLEAN *RetryLater)
Definition: ScsiDisk.c:5706
BOOLEAN DetermineInstallBlockIo(IN EFI_HANDLE ChildHandle)
Definition: ScsiDisk.c:5850
EFI_STATUS CheckHostAdapterStatus(IN UINT8 HostAdapterStatus)
Definition: ScsiDisk.c:3194
EFI_STATUS ScsiDiskDetectMedia(IN SCSI_DISK_DEV *ScsiDiskDevice, IN BOOLEAN MustReadCapacity, OUT BOOLEAN *MediaChange)
Definition: ScsiDisk.c:2319
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)
Definition: ScsiDisk.c:1009
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)
Definition: ScsiDisk.c:1752
VOID *EFIAPI GetParentProtocol(IN EFI_GUID *ProtocolGuid, IN EFI_HANDLE ChildHandle)
Definition: ScsiDisk.c:5896
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)
Definition: ScsiDisk.c:4469
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)
Definition: ScsiDisk.c:4593
EFI_STATUS EFIAPI ScsiDiskDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
Definition: ScsiDisk.c:220
VOID InitializeInstallDiskInfo(IN SCSI_DISK_DEV *ScsiDiskDevice, IN EFI_HANDLE ChildHandle)
Definition: ScsiDisk.c:6347
EFI_STATUS EFIAPI ScsiDiskInfoIdentify(IN EFI_DISK_INFO_PROTOCOL *This, IN OUT VOID *IdentifyData, IN OUT UINT32 *IdentifyDataSize)
Definition: ScsiDisk.c:6205
BOOLEAN ScsiDiskIsNoMedia(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
Definition: ScsiDisk.c:5467
UINT64 EFI_LBA
Definition: UefiBaseType.h:45
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
Definition: Base.h:213