summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Scsi
AgeCommit message (Collapse)AuthorFilesLines
2016-05-20MdeModulePkg ScsiDiskDxe: Add Erase Block Protocol support for UFS devicesHao Wu3-27/+761
This patch implements the EFI_ERASE_BLOCK_PROTOCOL in ScsiDiskDxe driver. For now, the codes support the erase block feature only on Universal Flash Storage (UFS) devices. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-05-05MdeModulePkg: ScsiDiskDxe: cope with broken "Supported VPD Pages" VPD pageLaszlo Ersek1-0/+37
The USB flash drive with Vendor ID 0x1516 (CompUSA) and Product ID 0x6221 returns a broken "Supported VPD Pages" VPD page. In particular, the PageLength field has the invalid value 0x0602 (decimal 1538). This prevents the loop from terminating that scans for the Block Limits VPD page code in ScsiDiskInquiryDevice(): for (Index = 0; Index < PageLength; Index++) { because the Index variable has type UINT8, and it wraps from 255 to 0, without ever reaching PageLength (1538), and because EFI_SCSI_PAGE_CODE_BLOCK_LIMITS_VPD does not occur at offsets 0 through 255. * The fix is not to change the type of Index to UINT16 or a wider type. Namely, section 7.8.14 Supported VPD Pages VPD page in the "SCSI Primary Commands - 4" (SPC-4) specification names the following requirement: The supported VPD page list shall contain a list of all VPD page codes (see 7.8) implemented by the logical unit in ascending order beginning with page code 00h. Since page codes are 8-bit unsigned quantities, it follows that the maximum size for the Supported VPD Pages VPD page is 0x100 bytes, in which every possible page code (0x00 through 0xFF) will be found, before the UINT8 offset wraps around. (EFI_SCSI_SUPPORTED_VPD_PAGES_VPD_PAGE.SupportedVpdPageList is correctly sized as well, in "MdePkg/Include/IndustryStandard/Scsi.h".) * Instead, add sanity checks that enforce the above requirement. If the device breaks the spec, simply fall back to the "Block Limits page absent" case. Cc: Feng Tian <feng.tian@intel.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1330955 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-03-29MdeModulePkg ScsiDiskDxe: Fix hang issue when reconnecting an ISCSI deviceHao Wu1-5/+13
The 'Reset' function for BlockIO(2) in ScsiDiskDxe should return EFI_SUCCESS instead of EFI_DEVICE_ERROR when a device does not support reset feature. Otherwise, a 'reconnect -r' action when an ISCSI device is attached will cause system hang. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-01-07MdeModulePkg/ScsiDisk: Increase the value of SCSI_DISK_TIMEOUT to 30sFeng Tian1-1/+5
As ScsiDisk and ScsiBus driver are used to manage SCSI or ATAPI devices, the timeout value is updated to 30s to follow ATA/ATAPI spec in which the device may take up to 30s to respond command. The change is used to solve device compatibility issue found with a TEAC DV-W28S-WZ3 slim DVD plus a SONY AccuCORE DVD-R media in which the DVD spends 8s to response READ_CAPACITY cmd after resetting the host machine. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19612 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22MdeModulePkg ScsiBusDxe: Raise the Tpl of async IO callback to TPL_NOTIFYHao Wu1-1/+1
Raise the Tpl of async SCSI I/O callback function to TPL_NOTIFY to match the behavior in ScsiDiskDxe driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19454 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22MdeModulePkg ScsiDiskDxe: Raise the Tpl of async IO callback to TPL_NOTIFYHao Wu2-12/+105
When reading data from non-blockingly from a CD-ROM logic partition, the procedure can be shown by the following call stack: (The write process is similar) |-------------------| | DiskIoDxe (logic) |<---Raise Tpl to TPL_CALLBACK |-------------------| | | Sub-task 1 (UnderRun) succeeds | | |-----------------| |-----------------| |-----------------| +--->| PartitionDxe |---->| DiskIoDxe (Phy) |---->| ScsiDiskDxe | | |-----------------| |-----------------| |-----------------| | | Sub-task 2 (OverRun) fails | | |-----------------| |-----------------| |-----------------| +--->| PartitionDxe |---->| DiskIoDxe (Phy) |---->| ScsiDiskDxe | | |-----------------| |-----------------| |-----------------| | ^ | | More subtasks... Wait indefinitely | |<---Restore Tpl | Completes In PartitionDxe, if the 'Lba' and 'BufferSize' parameters passed to function PartitionReadBlocksEx() are invalid, the function will issue a blocking ReadDisk call (in function ProbeMediaStatusEx()). In DiskIoDxe, blocking I/O request will wait for all the non-blocking I/O requests to complete first before sending down the blocking request. If the Tpl of the async I/O callback in ScsiDiskDxe is TPL_CALLBACK and Sub-task 1 (UnderRun) succeeds but Sub-task 2 (OverRun) fails with an invalid parameter, DiskIoDxe will wait indefinitely for the event created by ScsiDiskDxe of Sub-task 1 to signal. Hence, this commit will raise the Tpl of async IO callback in ScsiDiskDxe to TPL_NOTIFY so that the indefinite wait in DiskIoDxe can be avoided. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19452 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22MdeModulePkg ScsiDiskDxe: Add retry scheme for async SCSI I/O commandHao Wu1-8/+58
Some SCSI devices will return EFI_DEVICE_ERROR or EFI_TIMEOUT when the data length of a SCSI I/O command is too large. This commit will repeatedly retry sending the SCSI command with a data length half of its previous value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19451 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22MdeModulePkg ScsiDiskDxe: Fix async request retry times info lost issueHao Wu2-0/+32
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19450 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22MdeModulePkg ScsiDiskDxe: Close event when SCSI command failsHao Wu1-0/+24
The functions ScsiRead10CommandEx(), ScsiWrite10CommandEx(), ScsiRead16CommandEx() and ScsiWrite16CommandEx() in UefiScsiLib will not signal the event passed from ScsiDiskDxe when error occurs. In this case, ScsiDiskDxe should close the event passing to these APIs in UefiScsiLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19449 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22MdeModulePkg ScsiBusDxe: Only signal caller event when PassThru() succeedsHao Wu1-2/+3
In ScsiExecuteSCSICommand(), when SCSI devices do not support non-blocking I/O but an event is passed from caller (UefiScsiLib), the function will execute the SCSI I/O command in a blocking manner and signal the caller event when the command completes. Originally, caller event from UefiScsiLib will be signaled if the SCSI command fails. UefiScsiLib will continue to signal its caller (BlockIO2 request from ScsiDiskDxe driver), which is not aligned with the UEFI spec that event will not be signaled when BlockIO2 request returns with error. This commit will signal ScsiExecuteSCSICommand()'s caller event only when the SCSI command succeeds. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19447 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22MdeModulePkg ScsiDiskDxe: Modify WriteBlocks(Ex)() to follow UEFI specHao Wu1-0/+10
The functions ScsiDiskWriteBlocks(Ex) in ScsiDiskDxe/ScsiDisk.c do not check whether the device is allow to be written originally. This commit will add read-only check to follow the UEFI spec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19445 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22MdeModulePkg ScsiDiskDxe: Modify FlushBlocksEx() to follow UEFI specHao Wu2-10/+71
The function ScsiDiskFlushBlocksEx() in ScsiDiskDxe/ScsiDisk.c originally always returns EFI_SUCCESS, which is not aligned with the UEFI spec. This commit adds addtional checks to see if the media in the device is changed or removed. Check for whether the device can be written is also added. Corresponding status will be returned according to the check result. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19444 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22MdeModulePkg ScsiDiskDxe: Set block I/O media of SCSI CDROM to read-onlyHao Wu1-0/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19443 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15MdeModulePkg: Convert all .uni files to utf-8Jordan Justen4-0/+0
To convert these files I ran: $ python3 BaseTools/Scripts/ConvertUni.py MdeModulePkg Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19257 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-11MdeModulePkg ScsiBusDxe: Fix caller event may nerver be signaledHao Wu1-9/+37
For function ScsiExecuteSCSICommand(), when the 'Event' parameter is not NULL but the target SCSI device does not support non-blocking I/O, it will execute a blocking I/O operation instead. However, after the SCSI operation is done, the 'Event' is not signaled to inform the caller. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19217 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-11MdeModulePkg ScsiDiskDxe: Add BlockIO2 SupportHao Wu4-14/+1767
Together with EFI_BLOCK_IO_PROTOCOL, EFI_BLOCK_IO2_PROTOCOL is installed as well in ScsiDiskDxe. Block I/O 2 functions are implemented: Reset ReadBlocksEx WriteBlocksEx FlushBlocksEx Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19215 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-10MdeModulePkg: ScsiDiskDxe: adapt SectorCount when shortening transfersLaszlo Ersek1-0/+41
The specification of the EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru() function documents the EFI_BAD_BUFFER_SIZE return status, and the EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN host adapter status. These allow an EFI_EXT_SCSI_PASS_THRU_PROTOCOL implementation to request higher layers in the stack (in this instance, UefiScsiLib and ScsiDiskDxe) to break up the transfer into smaller pieces. These conditions percolate up the stack correctly: the retry loops in ScsiDiskDxe's ScsiDiskReadSectors() and ScsiDiskWriteSectors() functions correctly and transparently update the transfer size (ByteCount), accommodating any shortening requested by lower levels of the stack. After the loop -- if the request ultimately succeeds -- SectorCount is even recalculated from the final ByteCount, to see how many sectors the outer loop should advance. However, the inner (ie. retry) loops both have the same error: when the underlying protocols request the transfer to be shortened, the decrease in transfer size (ie. ByteCount) should immediately be reflected in SectorCount. Otherwise the sector count encoded in the CDB will exceed the transfer size, which is a permanent error. This issue has been witnessed while booting en_windows_8.1_pro_n_vl_with_update_x86_dvd_6051127.iso on the 32-bit build of OVMF, from a virtio-scsi CD-ROM: (1) "cdboot.efi" correctly requested (from far atop) a long read: Timeout=940000000 CdbLength=10 DataDir=Read InTransferLength=134215680 OutTransferLength=0 SenseDataLength=108 Cdb: 28 00 00 00 25 DD 00 FF FF 00 ^ ^^^^^^^^^^^ ^^^^^ | | | | | number of 2KB sectors to read, | | corresponding to 2048 * 65535 = 134215680 bytes | | (see InTransferLength above) | | | LBA to read from | READ (10) (2) In turn, the EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru() function provided by "OvmfPkg/VirtioScsiDxe/VirtioScsi.c" asked for the request to be shortened: InTransferLength=16776704 OutTransferLength=16776704 SenseDataLength=0 HostAdapterStatus=EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN TargetStatus=0 Status=EFI_BAD_BUFFER_SIZE (3) Then ScsiDiskReadSectors() in "MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c" retried the request with correctly shortened transfer length, but incorrectly unchanged sector count: Timeout=940000000 CdbLength=10 DataDir=Read InTransferLength=16776704 <--- updated as requested OutTransferLength=0 SenseDataLength=108 Cdb: 28 00 00 00 25 DD 00 FF FF 00 ^ ^^^^^^^^^^^ ^^^^^ | | | | | not changed! | | | LBA to read from | READ (10) (4) Since 65535 sectors of 2KB each wouldn't fit in a buffer of approx. 16MB, QEMU's virtio-scsi controller unconditionally rejected this request with VIRTIO_SCSI_S_OVERRUN, which VirtioScsiDxe then mapped to: InTransferLength=16776704 OutTransferLength=0 SenseDataLength=0 HostAdapterStatus=EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN TargetStatus=0 Status=EFI_DEVICE_ERROR (5) After two more tries of the same, ScsiDiskDxe passed up the error, which ultimately caused "cdboot.efi" to BSOD. Many thanks to Larry Cleeton from Microsoft for helping debug "cdboot.efi". Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18438 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-10MdeModulePkg: ScsiDiskDxe: recognize EFI_BAD_BUFFER_SIZELaszlo Ersek1-4/+4
Acting specifically upon this error condition from UefiScsiLib (and ultimately from EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru()) in the - ScsiDiskRead10(), - ScsiDiskWrite10(), - ScsiDiskRead16(), - ScsiDiskWrite16() functions allows us to retry these operations from ScsiDiskReadSectors() and ScsiDiskWriteSectors(), with adjusted transfer sizes, without investigating further error details like Host Adapter Status, Target Status, and Sense Data. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18437 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-29MdeModulePkg: fix some issues in ScsiDisk to co-work with UFS stackFeng Tian2-12/+15
The changes in ScsiDisk include: 1. Add UFS disk info support. 2. Remove the wrong block size calculation. 3. Get sense data for TEST_UNIT_READY cmd immediately rather than sending a REQUEST_SENSE cmd again. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17247 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-23MdeModulePkg/ScsiDisk: Set correct value to the Media->IoAlign field of ↵Feng Tian1-10/+11
BlockIo protocol instance. Media->IoAlign field of BlockIo protocol instance installed by this driver should be set to the value of ScsiIo->IoAlign. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17195 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-30MdeModulePkg/ScsiDiskDxe: Fix the build warning/error "unreachable statement"Olivier Martin1-1/+0
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16190 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-03MdeModulePkg: Convert non DOS format files to DOS format and remove unused ↵Gao, Liming2-0/+0
module UNI files. 1. Module UNI and Package UNI files are not DOS format. Convert them to DOS format. 2. Remove unused SectionExtractionDxeModStrs.uni and SectionExtractionPeiModStrs.uni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16044 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-28MdeModulePkg: INF/DEC file updates to EDK II packagesZeng, Star4-0/+0
2. Add MODULE_UNI_FILE file that contains the localized Abstract and Description of a module. a. Addresses an information gap between INF files and the UEFI Distribution Packaging Specification XML schema b. There will be an associated update to UPT in BaseTools to consume MODULE_UNI_FILE and associated UNI file during UDP creation that performs the INF -> XML conversion. c. There will be an associated update to UPT in BaseTools to produce MODULE_UNI_FILE and associated UNI file during UDP installation that performs the XML -> INF conversion. 3. Add Module Extra UNI file that provides the localized Name of a module. a. [UserExtensions.TianoCore."ExtraFiles"] provides an easy method for a module to specify extra files not listed in [Sources] or [Binaries] sections to be added to a UDP without having to list the files in the UPT package information data file. b. There will be an associated update to UPT in BaseTools to package up files listed in [UserExtensions.TianoCore."ExtraFiles"] during UDP creation. c. UNI file contains localized name of a module to go along with the localized Abstract and Description from the MODULE_UNI_FILE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zeng, Star <star.zeng@intel.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15963 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-28MdeModulePkg: INF/DEC file updates to EDK II packagesZeng, Star2-12/+24
1. Usage information in INF file comment blocks are either incomplete or incorrect. This includes usage information for Protocols/PPIs/GUIDs/PCDs/HOBs/Events/BootModes. The syntax for usage information in comment blocks is defined in the EDK II Module Information (INF) Specification Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zeng, Star <star.zeng@intel.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15962 6f19259b-4bc3-4df7-8a09-765794883524
2014-04-30MdeModulePkg/ScsiDisk: Using back-off algorithm to dynamically adjust ↵Tian, Feng2-113/+160
transfer length in a single SCSI/ATAPI transfer to reach best device compatibility. Besides this, the patch also fixed: 1) Wrong return value in SenseDataLength field of packet field of EFI_EXT_SCSI_PASS_THRU protocol, it should reflect real sense data length we got. 2) Wrong logic in ScsiDiskRequestSenseKeys that the logic makes SenseData pointer unaligned compared with BlockIo.Media.IoAlign field. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tian, Feng <feng.tian@intel.com> Reviewed-by: Zeng, Star <star.zeng@intel.com> Reviewed-by: Fu, Siyuan <siyuan.fu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15491 6f19259b-4bc3-4df7-8a09-765794883524
2014-02-11MdeModulePkg/ScsiDisk:If the SCSI device target status is in ↵Tian, Feng1-57/+278
CHECK_CONDITION, then parse sense data to decide which actions need to be done. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tian, Feng <feng.tian@intel.com> Reviewed-by: Fu, Siyuan <siyuan.fu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15215 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-05MdeMdeModulePkg/Scsi: Enlarge SCSI cmd timeout to a more reasonable ↵Feng Tian4-15/+30
experience value to cover more devices Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Elvin Li <elvin.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14521 6f19259b-4bc3-4df7-8a09-765794883524
2013-01-04MdeModulePkg/AtaBus&ScsiBus: Dynamically calculate how long shall we wait ↵erictian1-2/+60
for the finish of a read/write operation according to the actual transfer length Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Elvin Li <elvin.li@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14028 6f19259b-4bc3-4df7-8a09-765794883524
2012-10-30Add missing status code in several modules.li-elvin3-24/+71
Signed-off-by: Li Elvin <elvin.li@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com> Reviewed-by: Gao Liming <liming.gao@intel.com> Reviewed-by: Tian Feng <feng.tian@intel.com> Reviewed-by: Fan Jeff <jeff.fan@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13890 6f19259b-4bc3-4df7-8a09-765794883524
2012-03-06MdeModulePkg: When media_change happens at Partition.Start(), the lower ↵erictian1-1/+5
driver (ScsiDisk) should immediately return EFI_MEDIA_CHANGE but not EFI_SUCCESS. This way is used to avoid the interrupted Partition.Start() closes those opened protocols(DiskIo and DevicePath protocol) who are using by the re-entered partition driver at the same handle. Signed-off-by: erictian Reviewed-by: rsun3 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13082 6f19259b-4bc3-4df7-8a09-765794883524
2011-11-25Allocate aligned buffer to satisfy the IoAlign requirement of high level ↵lzeng142-47/+181
protocol. Signed-off-by: lzeng14 Reviewed-by: erictian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12788 6f19259b-4bc3-4df7-8a09-765794883524
2011-11-03MdeModulePkg: ATA performance tuning.erictian1-3/+2
1. Boost IDE mode boot when slave device is absent. 2. Use D2H FIS to check if the PIO OUT/DMA IN/DMA OUT transfer is finished or error happened. ATA PIO IN has special check as it may just receive PIO SETUP FIS for success case. 3. Add command status register check for IDE DMA transfer. 4. ScsiDiskReadCapacity() in ScsiDisk should return EFI_SUCCESS if SENSE Data request is success. Signed-off-by: erictian Reviewed-by: rsun3 Reviewed-by: xdu2 Reviewed-by: mdkinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12658 6f19259b-4bc3-4df7-8a09-765794883524
2011-09-18Clean up the private GUID definition in module Level.lgao42-16/+11
0. Remove the unused private GUID from module source files. 1. Use gEfiCallerIdGuid replace of the private module GUID. 2. Add the public header files to define HII FormSet and PackageList GUID used in every HII driver. 3. Move two EBC protocols for debug purpose from EBC driver to MdeModulePkg Include directory. Signed-off-by: lgao4 Reviewed-by: ydong10 gdong1 tye jfan12 wli12 rsun3 jyao1 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12373 6f19259b-4bc3-4df7-8a09-765794883524
2011-09-07Media detection logic is enhanced to be more robust.erictian1-70/+86
Signed-off-by: erictian Reviewed-by: hhuan13 Reviewed-by: mdkinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12289 6f19259b-4bc3-4df7-8a09-765794883524
2011-07-06Fix the comments to follow UEFI Spec regarding how to check an EFI_HANDLE is ↵niruiyu4-8/+8
valid/invalid. Signed-off-by: niruiyu Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11987 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-20Fix potential null pointer dereferenceerictian1-6/+6
Signed-off-by: erictian Reviewed-by: ydong10 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11859 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-14ScsiBus/ScsiDisk enhancement for no_media state.erictian2-87/+144
Ahci enumeration logic tuning for boot performance. Signed-off-by:erictian Reviewed-by:qianouyang, hhuan13 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11820 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-23Change Partition/ScsiDxe driver to produce Block IO revision 3.niruiyu1-40/+98
Signed-off-by: niruiyu Reviewed-by: erictian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11692 6f19259b-4bc3-4df7-8a09-765794883524
2011-04-25Change BlockIo drivers to return EFI_NO_MEDIA or EFI_MEDIA_CHANGED even the ↵niruiyu1-23/+25
Buffer/BufferSize/Lba is invalid so that caller can probe the media status easier. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11584 6f19259b-4bc3-4df7-8a09-765794883524
2010-10-19return EFI_DEVICE_ERROR if the Status value is not EFI_SUCCESS.erictian1-0/+10
it's because BlockIo.Reset() only has two possible values: EFI_SUCCESS and EFI_DEVICE_ERROR according to UEFI2.3 spec git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10956 6f19259b-4bc3-4df7-8a09-765794883524
2010-09-15Refine soma code to make code run safely.ydong102-3/+3
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10877 6f19259b-4bc3-4df7-8a09-765794883524
2010-08-23Change the check condition for 16 byte command, when HDD size is > 2TB, use ↵li-elvin2-48/+53
16 byte command instead. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10817 6f19259b-4bc3-4df7-8a09-765794883524
2010-08-04According to SCSI spec, ANSI version is 3 bits, so 0x7 should be used to get ↵li-elvin2-5/+5
correct ANSI version. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10773 6f19259b-4bc3-4df7-8a09-765794883524
2010-06-04Change MaxBlock to HEX value to avoid GCC build failure.li-elvin1-4/+4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10566 6f19259b-4bc3-4df7-8a09-765794883524
2010-05-28If SCSI version support Read/Write (16) command, use both commands to access ↵li-elvin2-41/+244
disk especially for above 2TB. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10550 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-24Update the copyright notice formathhtian8-16/+16
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10420 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-241. Correct File header to ## @filelgao42-8/+8
2. Remove unnecessary .common] postfix on section. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10052 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-11Coding style fix and minor improvements.rsun32-21/+21
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9977 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-02when remaining device path is not NULL, check if it's the device managed by ↵erictian1-2/+5
bus driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9904 6f19259b-4bc3-4df7-8a09-765794883524
2010-01-19Improve coding style in MdeModulePkg.rsun31-5/+7
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9793 6f19259b-4bc3-4df7-8a09-765794883524