mirror of https://github.com/acidanthera/audk.git
Removed connect/disconnect in device command and replace with simple BlockIo readblocks to probe for media change. This relies on ReinstallProtocolInterface() calls in the BlockIo drivers to make the filesystems reload.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10468 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
4da3058929
commit
6191913fb4
|
@ -227,16 +227,10 @@ EblDeviceCmd (
|
|||
File = EfiDeviceOpenByType (EfiOpenBlockIo, Index);
|
||||
if (File != NULL) {
|
||||
if (File->FsBlockIoMedia->RemovableMedia) {
|
||||
if (File->FsBlockIoMedia->MediaPresent) {
|
||||
// Probe to see if media is present
|
||||
Status = File->FsBlockIo->ReadBlocks (File->FsBlockIo, File->FsBlockIo->Media->MediaId, (EFI_LBA)0, 0, NULL);
|
||||
if (Status == EFI_NO_MEDIA) {
|
||||
gBS->DisconnectController (File->EfiHandle, NULL, NULL);
|
||||
}
|
||||
} else {
|
||||
// Probe for media insertion and connect partition and filesystem drivers if needed
|
||||
gBS->ConnectController (File->EfiHandle, NULL, NULL, TRUE);
|
||||
}
|
||||
// Probe to see if media is present (or not) or media changed
|
||||
// this causes the ReinstallProtocolInterface() to fire in the
|
||||
// block io driver to update the system about media change events
|
||||
File->FsBlockIo->ReadBlocks (File->FsBlockIo, File->FsBlockIo->Media->MediaId, (EFI_LBA)0, 0, NULL);
|
||||
}
|
||||
EfiClose (File);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue