> On Apr 23, 2015, at 8:37 AM, KSilva <[email protected]> wrote:
>
> I will try to do a better explanation:
>
> #1 I know to use the connectController() and disconnectController(), so I
> want to find Sata Controller and disconnect it.
>
> #2 But i found any problems:
> How can i to find this specific handle?! without <Sata>protocol 'cause
> SATA CONTROLLER doesn't have in UEFI.
>
> For example:
>
> [AA] SATA CONTROLLER
> [AB] WDC HDD
>
> I need to do the disconnect of the "AA" to AtaPassThru to connect with the
> HDD and manage it, but ..using just Application.efi
> I don't have for example a way to use SataProtocol;
>
> gBS->LocateHandleBuffer(ByProtocol,SataProtocolGuid,NULL,bufferSize,handleSata);
>
>
> Then, i only know to find ALL Handle and disconnect it.
>
> #3 - Using Shell i can to do it. But my application has to be independent of
> the Shell
>
How are you picking the SATA controller? The names in the shell are coming from
the ComponentName/ComponentName2 protocol that the drivers produce.
If you want to test for other conditions there are library functions in the
UefiLib:
https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Library/UefiLib.h
<https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Library/UefiLib.h>
/**
Tests whether a controller handle is being managed by a specific driver.
This function tests whether the driver specified by DriverBindingHandle is
currently managing the controller specified by ControllerHandle. This test
is performed by evaluating if the the protocol specified by ProtocolGuid is
present on ControllerHandle and is was opened by DriverBindingHandle with an
attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
If ProtocolGuid is NULL, then ASSERT().
@param ControllerHandle A handle for a controller to test.
@param DriverBindingHandle Specifies the driver binding handle for the
driver.
@param ProtocolGuid Specifies the protocol that the driver specified
by DriverBindingHandle opens in its Start()
function.
@retval EFI_SUCCESS ControllerHandle is managed by the driver
specified by DriverBindingHandle.
@retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
specified by DriverBindingHandle.
**/
EFI_STATUS
EFIAPI
EfiTestManagedDevice (
IN CONST EFI_HANDLE ControllerHandle,
IN CONST EFI_HANDLE DriverBindingHandle,
IN CONST EFI_GUID *ProtocolGuid
);
/**
Tests whether a child handle is a child device of the controller.
This function tests whether ChildHandle is one of the children of
ControllerHandle. This test is performed by checking to see if the protocol
specified by ProtocolGuid is present on ControllerHandle and opened by
ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
If ProtocolGuid is NULL, then ASSERT().
@param ControllerHandle A handle for a (parent) controller to test.
@param ChildHandle A child handle to test.
@param ProtocolGuid Supplies the protocol that the child controller
opens on its parent controller.
@retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
@retval EFI_UNSUPPORTED ChildHandle is not a child of the
ControllerHandle.
**/
EFI_STATUS
EFIAPI
EfiTestChildHandle (
IN CONST EFI_HANDLE ControllerHandle,
IN CONST EFI_HANDLE ChildHandle,
IN CONST EFI_GUID *ProtocolGuid
);
Thanks,
Andrew Fish
>
> ------------------------------------------------------------------------------
> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
> Develop your own process in accordance with the BPMN 2 standard
> Learn Process modeling best practices with Bonita BPM through live exercises
> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel