X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FBus%2FScsi%2FScsiDiskDxe%2FScsiDisk.h;h=273c0edc8b3edc94d6a64e5445c6ce605e9a6561;hb=9beb888e7ce592fe424ba9fa871651d64d192001;hp=64ee905e36900ae387567c4f2fadb225fa2235a1;hpb=3b2dbece7cac30131999e904cdf9aa872fb3d8c1;p=mirror_edk2.git diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h index 64ee905e36..273c0edc8b 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h @@ -12,13 +12,29 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#ifndef _SCSI_DISK_H -#define _SCSI_DISK_H +#ifndef _SCSI_DISK_H_ +#define _SCSI_DISK_H_ +#include + + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + #include -#define IsDeviceFixed(a) (a)->FixedDevice ? 1 : 0 +#define IS_DEVICE_FIXED(a) (a)->FixedDevice ? 1 : 0 #define SCSI_DISK_DEV_SIGNATURE EFI_SIGNATURE_32 ('s', 'c', 'd', 'k') @@ -57,29 +73,86 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gScsiDiskComponentName2; #define ACTION_READ_CAPACITY 0x01 #define ACTION_RETRY_COMMAND_LATER 0x02 +/** + Test to see if this driver supports ControllerHandle. + + This service is called by the EFI boot service ConnectController(). In order + to make drivers as small as possible, there are a few calling restrictions for + this service. ConnectController() must follow these calling restrictions. + If any other agent wishes to call Supported() it must also follow these + calling restrictions. + + @param This Protocol instance pointer. + @param ControllerHandle Handle of device to test + @param RemainingDevicePath Optional parameter use to pick a specific child + device to start. + + @retval EFI_SUCCESS This driver supports this device + @retval EFI_ALREADY_STARTED This driver is already running on this device + @retval other This driver does not support this device + +**/ EFI_STATUS EFIAPI ScsiDiskDriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL ); +/** + Start this driver on ControllerHandle. + + This service is called by the EFI boot service ConnectController(). In order + to make drivers as small as possible, there are a few calling restrictions for + this service. ConnectController() must follow these calling restrictions. If + any other agent wishes to call Start() it must also follow these calling + restrictions. + + @param This Protocol instance pointer. + @param ControllerHandle Handle of device to bind driver to + @param RemainingDevicePath Optional parameter use to pick a specific child + device to start. + + @retval EFI_SUCCESS This driver is added to ControllerHandle + @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle + @retval other This driver does not support this device + +**/ EFI_STATUS EFIAPI ScsiDiskDriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL ); +/** + Stop this driver on ControllerHandle. + + This service is called by the EFI boot service DisconnectController(). + In order to make drivers as small as possible, there are a few calling + restrictions for this service. DisconnectController() must follow these + calling restrictions. If any other agent wishes to call Stop() it must + also follow these calling restrictions. + + @param This Protocol instance pointer. + @param ControllerHandle Handle of device to stop driver on + @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of + children is zero stop the entire bus driver. + @param ChildHandleBuffer List of Child Handles to Stop. + + @retval EFI_SUCCESS This driver is removed ControllerHandle + @retval other This driver was not removed from this device + +**/ EFI_STATUS EFIAPI ScsiDiskDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer + IN EFI_HANDLE *ChildHandleBuffer OPTIONAL ); // @@ -95,10 +168,10 @@ ScsiDiskDriverBindingStop ( by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned. - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or + @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. - @param Language[in] A pointer to a Null-terminated ASCII string + @param Language A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the @@ -107,7 +180,7 @@ ScsiDiskDriverBindingStop ( to the driver writer. Language is specified in RFC 3066 or ISO 639-2 language code format. - @param DriverName[out] A pointer to the Unicode string to return. + @param DriverName A pointer to the Unicode string to return. This Unicode string is the name of the driver specified by This in the language specified by Language. @@ -146,15 +219,15 @@ ScsiDiskComponentNameGetDriverName ( then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned. - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or + @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. - @param ControllerHandle[in] The handle of a controller that the driver + @param ControllerHandle The handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned. - @param ChildHandle[in] The handle of the child controller to retrieve + @param ChildHandle The handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers @@ -163,7 +236,7 @@ ScsiDiskComponentNameGetDriverName ( driver that wishes to retrieve the name of a child controller. - @param Language[in] A pointer to a Null-terminated ASCII string + @param Language A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the @@ -172,7 +245,7 @@ ScsiDiskComponentNameGetDriverName ( to the driver writer. Language is specified in RFC 3066 or ISO 639-2 language code format. - @param ControllerName[out] A pointer to the Unicode string to return. + @param ControllerName A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by @@ -211,699 +284,500 @@ ScsiDiskComponentNameGetControllerName ( OUT CHAR16 **ControllerName ); +/** + Reset SCSI Disk. + + + @param This The pointer of EFI_BLOCK_IO_PROTOCOL + @param ExtendedVerification The flag about if extend verificate + @retval EFI_SUCCESS The device was reset. + @retval EFI_DEVICE_ERROR The device is not functioning properly and could + not be reset. + @return EFI_STATUS is retured from EFI_SCSI_IO_PROTOCOL.ResetDevice(). + +**/ EFI_STATUS EFIAPI ScsiDiskReset ( IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification - ) -/*++ - -Routine Description: - - Reset SCSI Disk - -Arguments: + ); - This - The pointer of EFI_BLOCK_IO_PROTOCOL - ExtendedVerification - The flag about if extend verificate -Returns: +/** + The function is to Read Block from SCSI Disk. - EFI_STATUS + @param This The pointer of EFI_BLOCK_IO_PROTOCOL. + @param MediaId The Id of Media detected + @param Lba The logic block address + @param BufferSize The size of Buffer + @param Buffer The buffer to fill the read out data ---*/ -; + @retval EFI_SUCCESS Successfully to read out block. + @retval EFI_DEVICE_ERROR Fail to detect media. + @retval EFI_NO_MEDIA Media is not present. + @retval EFI_MEDIA_CHANGED Media has changed. + @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device. + @retval EFI_INVALID_PARAMETER Invalid parameter passed in. +**/ EFI_STATUS EFIAPI ScsiDiskReadBlocks ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, - IN EFI_LBA LBA, + IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer - ) -/*++ - -Routine Description: - - The function is to Read Block from SCSI Disk - -Arguments: - - This - The pointer of EFI_BLOCK_IO_PROTOCOL - MediaId - The Id of Media detected - LBA - The logic block address - BufferSize - The size of Buffer - Buffer - The buffer to fill the read out data - -Returns: + ); - EFI_INVALID_PARAMETER - Invalid parameter passed in. - EFI_SUCCESS - Successfully to read out block. - EFI_DEVICE_ERROR - Fail to detect media. - EFI_NO_MEDIA - Media is not present. - EFI_MEDIA_CHANGED - Media has changed. - EFI_BAD_BUFFER_SIZE - The buffer size is not multiple of BlockSize. ---*/ -; +/** + The function is to Write Block to SCSI Disk. + + @param This The pointer of EFI_BLOCK_IO_PROTOCOL + @param MediaId The Id of Media detected + @param Lba The logic block address + @param BufferSize The size of Buffer + @param Buffer The buffer to fill the read out data + + @retval EFI_SUCCESS Successfully to read out block. + @retval EFI_WRITE_PROTECTED The device can not be written to. + @retval EFI_DEVICE_ERROR Fail to detect media. + @retval EFI_NO_MEDIA Media is not present. + @retval EFI_MEDIA_CHNAGED Media has changed. + @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device. + @retval EFI_INVALID_PARAMETER Invalid parameter passed in. +**/ EFI_STATUS EFIAPI ScsiDiskWriteBlocks ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, - IN EFI_LBA LBA, + IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer - ) -/*++ - -Routine Description: - - The function is to Write Block to SCSI Disk + ); -Arguments: - This - The pointer of EFI_BLOCK_IO_PROTOCOL - MediaId - The Id of Media detected - LBA - The logic block address - BufferSize - The size of Buffer - Buffer - The buffer to fill the read out data +/** + Flush Block to Disk. -Returns: + EFI_SUCCESS is returned directly. - EFI_INVALID_PARAMETER - Invalid parameter passed in. - EFI_SUCCESS - Successfully to read out block. - EFI_DEVICE_ERROR - Fail to detect media. - EFI_NO_MEDIA - Media is not present. - EFI_MEDIA_CHANGED - Media has changed. - EFI_BAD_BUFFER_SIZE - The buffer size is not multiple of BlockSize. + @param This The pointer of EFI_BLOCK_IO_PROTOCOL ---*/ -; + @retval EFI_SUCCESS All outstanding data was written to the device +**/ EFI_STATUS EFIAPI ScsiDiskFlushBlocks ( IN EFI_BLOCK_IO_PROTOCOL *This - ) -/*++ - -Routine Description: - - Flush Block to Disk - -Arguments: - - This - The pointer of EFI_BLOCK_IO_PROTOCOL + ); -Returns: +/** + Dectect Device and read out capacity ,if error occurs, parse the sense key. - EFI_SUCCESS + @param ScsiDiskDevice The pointer of SCSI_DISK_DEV + @param MustReadCapacity The flag about reading device capacity + @param MediaChange The pointer of flag indicates if media has changed ---*/ -; + @retval EFI_DEVICE_ERROR Indicates that error occurs + @retval EFI_SUCCESS Successfully to detect media +**/ EFI_STATUS ScsiDiskDetectMedia ( - SCSI_DISK_DEV *ScsiDiskDevice, - BOOLEAN MustReadCap, - BOOLEAN *MediaChange - ) -/*++ - -Routine Description: - - Dectect Device and read out capacity ,if error occurs, parse the sense key. - -Arguments: + IN SCSI_DISK_DEV *ScsiDiskDevice, + IN BOOLEAN MustReadCapacity, + OUT BOOLEAN *MediaChange + ); - ScsiDiskDevice - The pointer of SCSI_DISK_DEV - MustReadCapacity - The flag about reading device capacity - MediaChange - The pointer of flag indicates if media has changed +/** + To test deivice. -Returns: + When Test Unit Ready command succeeds, retrieve Sense Keys via Request Sense; + When Test Unit Ready command encounters any error caused by host adapter or + target, return error without retrieving Sense Keys. - EFI_DEVICE_ERROR - Indicates that error occurs - EFI_SUCCESS - Successfully to detect media + @param ScsiDiskDevice The pointer of SCSI_DISK_DEV + @param NeedRetry The pointer of flag indicates try again + @param SenseDataArray The pointer of an array of sense data + @param NumberOfSenseKeys The pointer of the number of sense data array ---*/ -; + @retval EFI_DEVICE_ERROR Indicates that error occurs + @retval EFI_SUCCESS Successfully to test unit +**/ EFI_STATUS ScsiDiskTestUnitReady ( - SCSI_DISK_DEV *ScsiDiskDevice, - BOOLEAN *NeedRetry, - EFI_SCSI_SENSE_DATA **SenseDataArray, - UINTN *NumberOfSenseKeys - ) -/*++ - -Routine Description: + IN SCSI_DISK_DEV *ScsiDiskDevice, + OUT BOOLEAN *NeedRetry, + OUT EFI_SCSI_SENSE_DATA **SenseDataArray, + OUT UINTN *NumberOfSenseKeys + ); - When Test Unit Ready command succeeds, retrieve Sense Keys via Request Sense; - When Test Unit Ready command encounters any error caused by host adapter or - target, return error without retrieving Sense Keys. - -Arguments: - ScsiDiskDevice - The pointer of SCSI_DISK_DEV - NeedRetry - The pointer of flag indicates try again - SenseDataArray - The pointer of an array of sense data - NumberOfSenseKeys - The pointer of the number of sense data array - -Returns: +/** + Parsing Sense Keys which got from request sense command. - EFI_DEVICE_ERROR - Indicates that error occurs - EFI_SUCCESS - Successfully to test unit + @param ScsiDiskDevice The pointer of SCSI_DISK_DEV + @param SenseData The pointer of EFI_SCSI_SENSE_DATA + @param NumberOfSenseKeys The number of sense key + @param Action The pointer of action which indicates what is need to do next ---*/ -; + @retval EFI_DEVICE_ERROR Indicates that error occurs + @retval EFI_SUCCESS Successfully to complete the parsing +**/ EFI_STATUS DetectMediaParsingSenseKeys ( - SCSI_DISK_DEV *ScsiDiskDevice, - EFI_SCSI_SENSE_DATA *SenseData, - UINTN NumberOfSenseKeys, - UINTN *Action - ) -/*++ - -Routine Description: - - Parsing Sense Keys which got from request sense command. - -Arguments: + OUT SCSI_DISK_DEV *ScsiDiskDevice, + IN EFI_SCSI_SENSE_DATA *SenseData, + IN UINTN NumberOfSenseKeys, + OUT UINTN *Action + ); - ScsiDiskDevice - The pointer of SCSI_DISK_DEV - SenseData - The pointer of EFI_SCSI_SENSE_DATA - NumberOfSenseKeys - The number of sense key - Action - The pointer of action which indicates what is need to do next -Returns: +/** + Send read capacity command to device and get the device parameter. - EFI_DEVICE_ERROR - Indicates that error occurs - EFI_SUCCESS - Successfully to complete the parsing + @param ScsiDiskDevice The pointer of SCSI_DISK_DEV + @param NeedRetry The pointer of flag indicates if need a retry + @param SenseDataArray The pointer of an array of sense data + @param NumberOfSenseKeys The number of sense key ---*/ -; + @retval EFI_DEVICE_ERROR Indicates that error occurs + @retval EFI_SUCCESS Successfully to read capacity +**/ EFI_STATUS ScsiDiskReadCapacity ( - SCSI_DISK_DEV *ScsiDiskDevice, - BOOLEAN *NeedRetry, - EFI_SCSI_SENSE_DATA **SenseDataArray, - UINTN *NumberOfSenseKeys - ) -/*++ - -Routine Description: - - Send read capacity command to device and get the device parameter - -Arguments: - - ScsiDiskDevice - The pointer of SCSI_DISK_DEV - NeedRetry - The pointer of flag indicates if need a retry - SenseDataArray - The pointer of an array of sense data - NumberOfSenseKeys - The number of sense key + IN OUT SCSI_DISK_DEV *ScsiDiskDevice, + OUT BOOLEAN *NeedRetry, + OUT EFI_SCSI_SENSE_DATA **SenseDataArray, + OUT UINTN *NumberOfSenseKeys + ); -Returns: +/** + Check the HostAdapter status and re-interpret it in EFI_STATUS. - EFI_DEVICE_ERROR - Indicates that error occurs - EFI_SUCCESS - Successfully to read capacity + @param HostAdapterStatus Host Adapter status ---*/ -; + @retval EFI_SUCCESS Host adapter is OK. + @retval EFI_TIMEOUT Timeout. + @retval EFI_NOT_READY Adapter NOT ready. + @retval EFI_DEVICE_ERROR Adapter device error. +**/ EFI_STATUS CheckHostAdapterStatus ( - UINT8 HostAdapterStatus - ) -/*++ - -Routine Description: - - Check the HostAdapter status - -Arguments: + IN UINT8 HostAdapterStatus + ); - HostAdapterStatus - Host Adapter status -Returns: +/** + Check the target status and re-interpret it in EFI_STATUS. - EFI_SUCCESS - EFI_TIMEOUT - EFI_NOT_READY - EFI_DEVICE_ERROR + @param TargetStatus Target status ---*/ -; + @retval EFI_NOT_READY Device is NOT ready. + @retval EFI_DEVICE_ERROR + @retval EFI_SUCCESS +**/ EFI_STATUS CheckTargetStatus ( - UINT8 TargetStatus - ) -/*++ - -Routine Description: - - Check the target status - -Arguments: + IN UINT8 TargetStatus + ); - TargetStatus - Target status +/** + Retrieve all sense keys from the device. -Returns: + When encountering error during the process, if retrieve sense keys before + error encounterred, it returns the sense keys with return status set to EFI_SUCCESS, + and NeedRetry set to FALSE; otherwize, return the proper return status. - EFI_NOT_READY - EFI_DEVICE_ERROR - EFI_SUCCESS + @param ScsiDiskDevice The pointer of SCSI_DISK_DEV + @param NeedRetry The pointer of flag indicates if need a retry + @param SenseDataArray The pointer of an array of sense data + @param NumberOfSenseKeys The number of sense key + @param AskResetIfError The flag indicates if need reset when error occurs ---*/ -; + @retval EFI_DEVICE_ERROR Indicates that error occurs + @retval EFI_SUCCESS Successfully to request sense key +**/ EFI_STATUS ScsiDiskRequestSenseKeys ( - SCSI_DISK_DEV *ScsiDiskDevice, - BOOLEAN *NeedRetry, - EFI_SCSI_SENSE_DATA **SenseDataArray, - UINTN *NumberOfSenseKeys, - BOOLEAN AskResetIfError - ) -/*++ - -Routine Description: + IN OUT SCSI_DISK_DEV *ScsiDiskDevice, + OUT BOOLEAN *NeedRetry, + OUT EFI_SCSI_SENSE_DATA **SenseDataArray, + OUT UINTN *NumberOfSenseKeys, + IN BOOLEAN AskResetIfError + ); - Retrieve all sense keys from the device. - When encountering error during the process, - if retrieve sense keys before error encounterred, - return the sense keys with return status set to EFI_SUCCESS, - and NeedRetry set to FALSE; otherwize, return the proper return - status. - -Arguments: - - ScsiDiskDevice - The pointer of SCSI_DISK_DEV - NeedRetry - The pointer of flag indicates if need a retry - SenseDataArray - The pointer of an array of sense data - NumberOfSenseKeys - The number of sense key - AskResetIfError - The flag indicates if need reset when error occurs - -Returns: +/** + Send out Inquiry command to Device. - EFI_DEVICE_ERROR - Indicates that error occurs - EFI_SUCCESS - Successfully to request sense key + @param ScsiDiskDevice The pointer of SCSI_DISK_DEV + @param NeedRetry Indicates if needs try again when error happens ---*/ -; + @retval EFI_DEVICE_ERROR Indicates that error occurs + @retval EFI_SUCCESS Successfully to detect media +**/ EFI_STATUS ScsiDiskInquiryDevice ( - SCSI_DISK_DEV *ScsiDiskDevice, - BOOLEAN *NeedRetry - ) -/*++ - -Routine Description: - - Send out Inquiry command to Device - -Arguments: - - ScsiDiskDevice - The pointer of SCSI_DISK_DEV - NeedRetry - Indicates if needs try again when error happens - -Returns: + IN OUT SCSI_DISK_DEV *ScsiDiskDevice, + OUT BOOLEAN *NeedRetry + ); - EFI_DEVICE_ERROR - Indicates that error occurs - EFI_SUCCESS - Successfully to detect media +/** + Parse Inquiry data. ---*/ -; + @param ScsiDiskDevice The pointer of SCSI_DISK_DEV +**/ VOID ParseInquiryData ( - SCSI_DISK_DEV *ScsiDiskDevice - ) -/*++ - -Routine Description: - - Parse Inquiry data - -Arguments: - - ScsiDiskDevice - The pointer of SCSI_DISK_DEV + IN OUT SCSI_DISK_DEV *ScsiDiskDevice + ); -Returns: +/** + Read sector from SCSI Disk. - NONE + @param ScsiDiskDevice The poiniter of SCSI_DISK_DEV + @param Buffer The buffer to fill in the read out data + @param Lba Logic block address + @param NumberOfBlocks The number of blocks to read ---*/ -; + @retval EFI_DEVICE_ERROR Indicates a device error. + @retval EFI_SUCCESS Operation is successful. +**/ EFI_STATUS ScsiDiskReadSectors ( - SCSI_DISK_DEV *ScsiDiskDevice, - VOID *Buffer, - EFI_LBA Lba, - UINTN NumberOfBlocks - ) -/*++ - -Routine Description: - - Read sector from SCSI Disk - -Arguments: - - ScsiDiskDevice - The poiniter of SCSI_DISK_DEV - Buffer - The buffer to fill in the read out data - Lba - Logic block address - NumberOfBlocks - The number of blocks to read + IN SCSI_DISK_DEV *ScsiDiskDevice, + OUT VOID *Buffer, + IN EFI_LBA Lba, + IN UINTN NumberOfBlocks + ); -Returns: +/** + Write sector to SCSI Disk. - EFI_DEVICE_ERROR - EFI_SUCCESS + @param ScsiDiskDevice The poiniter of SCSI_DISK_DEV + @param Buffer The buffer of data to be written into SCSI Disk + @param Lba Logic block address + @param NumberOfBlocks The number of blocks to read ---*/ -; + @retval EFI_DEVICE_ERROR Indicates a device error. + @retval EFI_SUCCESS Operation is successful. +**/ EFI_STATUS ScsiDiskWriteSectors ( - SCSI_DISK_DEV *ScsiDiskDevice, - VOID *Buffer, - EFI_LBA Lba, - UINTN NumberOfBlocks - ) -/*++ - -Routine Description: - - Write SCSI Disk sectors - -Arguments: - - ScsiDiskDevice - The pointer of SCSI_DISK_DEV - Buffer - The data buffer to write sector - Lba - Logic block address - NumberOfBlocks - The number of blocks to write - -Returns: - - EFI_DEVICE_ERROR - EFI_SUCCESS - ---*/ -; + IN SCSI_DISK_DEV *ScsiDiskDevice, + IN VOID *Buffer, + IN EFI_LBA Lba, + IN UINTN NumberOfBlocks + ); +/** + Sumbmit Read command. + + @param ScsiDiskDevice The pointer of ScsiDiskDevice + @param NeedRetry The pointer of flag indicates if needs retry if error happens + @param SenseDataArray NOT used yet in this function + @param NumberOfSenseKeys The number of sense key + @param Timeout The time to complete the command + @param DataBuffer The buffer to fill with the read out data + @param DataLength The length of buffer + @param StartLba The start logic block address + @param SectorSize The size of sector + + @return EFI_STATUS is returned by calling ScsiRead10Command(). +**/ EFI_STATUS ScsiDiskRead10 ( - SCSI_DISK_DEV *ScsiDiskDevice, - BOOLEAN *NeedRetry, - EFI_SCSI_SENSE_DATA **SenseDataArray, - UINTN *NumberOfSenseKeys, - UINT64 Timeout, - UINT8 *DataBuffer, - UINT32 *DataLength, - UINT32 StartLba, - UINT32 SectorSize - ) -/*++ - -Routine Description: - - Sumbmit Read command - -Arguments: - - ScsiDiskDevice - The pointer of ScsiDiskDevice - NeedRetry - The pointer of flag indicates if needs retry if error happens - SenseDataArray - The pointer of an array of sense data - NumberOfSenseKeys - The number of sense key - Timeout - The time to complete the command - DataBuffer - The buffer to fill with the read out data - DataLength - The length of buffer - StartLba - The start logic block address - SectorSize - The size of sector + IN SCSI_DISK_DEV *ScsiDiskDevice, + OUT BOOLEAN *NeedRetry, + OUT EFI_SCSI_SENSE_DATA **SenseDataArray, OPTIONAL + OUT UINTN *NumberOfSenseKeys, + IN UINT64 Timeout, + OUT UINT8 *DataBuffer, + IN OUT UINT32 *DataLength, + IN UINT32 StartLba, + IN UINT32 SectorSize + ); -Returns: +/** + Submit Write Command. - EFI_STATUS + @param ScsiDiskDevice The pointer of ScsiDiskDevice + @param NeedRetry The pointer of flag indicates if needs retry if error happens + @param SenseDataArray NOT used yet in this function + @param NumberOfSenseKeys The number of sense key + @param Timeout The time to complete the command + @param DataBuffer The buffer to fill with the read out data + @param DataLength The length of buffer + @param StartLba The start logic block address + @param SectorSize The size of sector ---*/ -; + @return EFI_STATUS is returned by calling ScsiWrite10Command(). +**/ EFI_STATUS ScsiDiskWrite10 ( - SCSI_DISK_DEV *ScsiDiskDevice, - BOOLEAN *NeedRetry, - EFI_SCSI_SENSE_DATA **SenseDataArray, - UINTN *NumberOfSenseKeys, - UINT64 Timeout, - UINT8 *DataBuffer, - UINT32 *DataLength, - UINT32 StartLba, - UINT32 SectorSize - ) -/*++ - -Routine Description: - - Submit Write Command - -Arguments: - - ScsiDiskDevice - The pointer of ScsiDiskDevice - NeedRetry - The pointer of flag indicates if needs retry if error happens - SenseDataArray - The pointer of an array of sense data - NumberOfSenseKeys - The number of sense key - Timeout - The time to complete the command - DataBuffer - The buffer to fill with the read out data - DataLength - The length of buffer - StartLba - The start logic block address - SectorSize - The size of sector - -Returns: + IN SCSI_DISK_DEV *ScsiDiskDevice, + OUT BOOLEAN *NeedRetry, + OUT EFI_SCSI_SENSE_DATA **SenseDataArray, OPTIONAL + OUT UINTN *NumberOfSenseKeys, + IN UINT64 Timeout, + IN UINT8 *DataBuffer, + IN OUT UINT32 *DataLength, + IN UINT32 StartLba, + IN UINT32 SectorSize + ); - EFI_STATUS +/** + Get information from media read capacity command. ---*/ -; + @param ScsiDiskDevice The pointer of SCSI_DISK_DEV + @param Capacity The pointer of EFI_SCSI_DISK_CAPACITY_DATA +**/ VOID GetMediaInfo ( - SCSI_DISK_DEV *ScsiDiskDevice, - EFI_SCSI_DISK_CAPACITY_DATA *Capacity - ) -/*++ - -Routine Description: - - Get information from media read capacity command - -Arguments: - - ScsiDiskDevice - The pointer of SCSI_DISK_DEV - Capacity - The pointer of EFI_SCSI_DISK_CAPACITY_DATA - -Returns: + IN OUT SCSI_DISK_DEV *ScsiDiskDevice, + IN EFI_SCSI_DISK_CAPACITY_DATA *Capacity + ); - NONE +/** + Check sense key to find if media presents. ---*/ -; + @param SenseData The pointer of EFI_SCSI_SENSE_DATA + @param SenseCounts The number of sense key + @retval TRUE NOT any media + @retval FALSE Media presents +**/ BOOLEAN ScsiDiskIsNoMedia ( IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts - ) -/*++ - -Routine Description: - - Check sense key to find if media presents - -Arguments: - - SenseData - The pointer of EFI_SCSI_SENSE_DATA - SenseCounts - The number of sense key + ); -Returns: +/** + Parse sense key. - BOOLEAN + @param SenseData The pointer of EFI_SCSI_SENSE_DATA + @param SenseCounts The number of sense key ---*/ -; + @retval TRUE Error + @retval FALSE NOT error +**/ BOOLEAN ScsiDiskIsMediaError ( IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts - ) -/*++ - -Routine Description: - - Parse sense key - -Arguments: - - SenseData - The pointer of EFI_SCSI_SENSE_DATA - SenseCounts - The number of sense key + ); -Returns: +/** + Check sense key to find if hardware error happens. - BOOLEAN + @param SenseData The pointer of EFI_SCSI_SENSE_DATA + @param SenseCounts The number of sense key ---*/ -; + @retval TRUE Hardware error exits. + @retval FALSE NO error. +**/ BOOLEAN ScsiDiskIsHardwareError ( IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts - ) -/*++ - -Routine Description: - - Check sense key to find if hardware error happens - -Arguments: - - SenseData - The pointer of EFI_SCSI_SENSE_DATA - SenseCounts - The number of sense key - -Returns: + ); - BOOLEAN +/** + Check sense key to find if media has changed. ---*/ -; + @param SenseData The pointer of EFI_SCSI_SENSE_DATA + @param SenseCounts The number of sense key + @retval TRUE Media is changed. + @retval FALSE Medit is NOT changed. +**/ BOOLEAN ScsiDiskIsMediaChange ( IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts - ) -/*++ - -Routine Description: - -Routine Description: - - Check sense key to find if media has changed - -Arguments: - - SenseData - The pointer of EFI_SCSI_SENSE_DATA - SenseCounts - The number of sense key + ); -Returns: +/** + Check sense key to find if reset happens. - BOOLEAN + @param SenseData The pointer of EFI_SCSI_SENSE_DATA + @param SenseCounts The number of sense key ---*/ -; + @retval TRUE It is reset before. + @retval FALSE It is NOT reset before. +**/ BOOLEAN ScsiDiskIsResetBefore ( IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts - ) -/*++ - -Routine Description: - - Check sense key to find if reset happens - -Arguments: - - SenseData - The pointer of EFI_SCSI_SENSE_DATA - SenseCounts - The number of sense key + ); -Returns: +/** + Check sense key to find if the drive is ready. - BOOLEAN + @param SenseData The pointer of EFI_SCSI_SENSE_DATA + @param SenseCounts The number of sense key + @param RetryLater The flag means if need a retry ---*/ -; + @retval TRUE Drive is ready. + @retval FALSE Drive is NOT ready. +**/ BOOLEAN ScsiDiskIsDriveReady ( IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts, - OUT BOOLEAN *NeedRetry - ) -/*++ - -Routine Description: - - Check sense key to find if the drive is ready - -Arguments: - - SenseData - The pointer of EFI_SCSI_SENSE_DATA - SenseCounts - The number of sense key - RetryLater - The flag means if need a retry + OUT BOOLEAN *RetryLater + ); -Returns: +/** + Check sense key to find if it has sense key. - BOOLEAN + @param SenseData - The pointer of EFI_SCSI_SENSE_DATA + @param SenseCounts - The number of sense key ---*/ -; + @retval TRUE It has sense key. + @retval FALSE It has NOT any sense key. +**/ BOOLEAN ScsiDiskHaveSenseKey ( IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts - ) -/*++ - -Routine Description: - - Check sense key to find if it has sense key - -Arguments: - - SenseData - The pointer of EFI_SCSI_SENSE_DATA - SenseCounts - The number of sense key - -Returns: + ); - BOOLEAN +/** + Release resource about disk device. ---*/ -; + @param ScsiDiskDevice The pointer of SCSI_DISK_DEV +**/ VOID ReleaseScsiDiskDeviceResources ( IN SCSI_DISK_DEV *ScsiDiskDevice - ) -/*++ - -Routine Description: - - Release resource about disk device - -Arguments: - - ScsiDiskDevice - The pointer of SCSI_DISK_DEV - -Returns: - - NONE - ---*/ -; + ); #endif