mirror of https://github.com/acidanthera/audk.git
Change BlockIo drivers to return EFI_NO_MEDIA or EFI_MEDIA_CHANGED even the 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@11585 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
fcf5e49dc9
commit
5d7ca12492
|
@ -225,16 +225,7 @@ FddReadWriteBlocks (
|
|||
FdcFreeCache (FdcDev);
|
||||
}
|
||||
}
|
||||
//
|
||||
// Check the Parameter is valid
|
||||
//
|
||||
if (Buffer == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (BufferSize == 0) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
//
|
||||
// Set the drive motor on
|
||||
//
|
||||
|
@ -268,6 +259,11 @@ FddReadWriteBlocks (
|
|||
return EFI_MEDIA_CHANGED;
|
||||
}
|
||||
|
||||
if (BufferSize == 0) {
|
||||
MotorOff (FdcDev);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (Operation == WRITE) {
|
||||
if (Media->ReadOnly) {
|
||||
MotorOff (FdcDev);
|
||||
|
@ -277,6 +273,11 @@ FddReadWriteBlocks (
|
|||
//
|
||||
// Check the parameters for this read/write operation
|
||||
//
|
||||
if (Buffer == NULL) {
|
||||
MotorOff (FdcDev);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (BufferSize % BlockSize != 0) {
|
||||
MotorOff (FdcDev);
|
||||
return EFI_BAD_BUFFER_SIZE;
|
||||
|
|
Loading…
Reference in New Issue