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:
andrewfish 2010-05-08 19:26:45 +00:00
parent 4da3058929
commit 6191913fb4
1 changed files with 4 additions and 10 deletions

View File

@ -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);
}