> On May 27, 2016, at 7:23 AM, valerij zaporogeci <[email protected]> wrote: > > > Hi, there. Sorry for my english.
I'm a native English speaker but I'm a little dyslexic so I've been known to mangle English too. > I was asking questions on > Fw_Os_Forum, but was redirected here, as it turned my questions might > be more relevant here than there. Hope so. > My question is about ConnectController semantics. > The specification says: > "If Recursive is FALSE, then this function returns after all drivers > have been connected to ControllerHandle. If Recursive is TRUE, then > ConnectController() is called recursively on all of the child > controllers of ControllerHandle. The child controllers can be > identified by searching the handle database for all the controllers > that have opened ControllerHandle with an attribute of > EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER" > > So when I were seeking child controllers I should look for those who > have open with BY_CHILD_CONTROLLER on ControllerHandle. But which > protocol? All installed on ControllerHandle? > EFI_DRIVER_BINDING_PROTOCOL? > 1st what are you trying to do, the answer may be different. The relationship is tracked by meta data associated with the handle. You can use the EFI Boot Service OpenProtocolInformation() to get more info. You can use LocateHandleBuffer(), ProtocolsPerHandle(), and OpenProtocolInformation() to dump out the entire Handle/Protocol database. The edk2 Shell has some useful commands for showing this relationship so you might start there if you want to see the code, or you can use the shell commands to show you the relationship. There is a spec for the UEFI Shell is located here: http://www.uefi.org/specifications > Next, I hope I understood right, but I'm not sure. Suppose > ConnectController finds a driver in the highest precedence group, let > it be the first - Context Override, it calls Supported() on that > driver (handle) and it returns SUCCESS, and then it calls Start() and > that returns SUCCESS. Should ConnectController stop trying all the > rest candidates for ControllerHandle after that? I'm not sure what you are asking? From a driver point of view it should not matter you just produce the Driver Binding Supported()/Start()/Stop(). The UEFI spec defines the precedence rules and that is the behavior you can depend on. When exactly Supported() gets called could be implementation dependent. The driver that gets the Start() call is deterministic. The best thing to do is assume Supported() gets call a lot and to be as efficient as possible. This is the edk2 implementation of ConnectController(): https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c#L50 I'd also point out that doing a "connect all", calling ConnectController() on all the handles in the system. Would cause a drivers Supported() routine to get called a lot in a short period of time. Thanks, Andrew Fish > Thanks. > _______________________________________________ > edk2-devel mailing list > [email protected] > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_mailman_listinfo_edk2-2Ddevel&d=CwICAg&c=Hw-EJUFt2_D9PK5csBJ29kRV40HqSDXWTLPyZ6W8u84&r=4sdzHKz0eU1vXqaUySVmyA&m=kjnFaTjjXqcSXP-YBgHHJfPQmsLapjRFP1eJsBUdbMI&s=HabPPOfoWEkCITS-yXvsGOCbbv2JXLSsTwe-G6lEp7E&e= > _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

