From 6191913fb4914f380597904f2025b1deb644e772 Mon Sep 17 00:00:00 2001 From: andrewfish Date: Sat, 8 May 2010 19:26:45 +0000 Subject: 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 --- EmbeddedPkg/Ebl/EfiDevice.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'EmbeddedPkg') diff --git a/EmbeddedPkg/Ebl/EfiDevice.c b/EmbeddedPkg/Ebl/EfiDevice.c index 80dcfcb5cc..922be589bd 100644 --- a/EmbeddedPkg/Ebl/EfiDevice.c +++ b/EmbeddedPkg/Ebl/EfiDevice.c @@ -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); } -- cgit v1.2.3