UEFI Spec 2.3.1: OpenProtocol() Boot Service BY_DRIVER: Used by a driver to gain access to a protocol interface. When this mode is used, the driver’s Stop() function will be called by DisconnectController() if the protocol interface is reinstalled or uninstalled. Once a protocol interface is opened by a driver with this attribute, no other drivers will be allowed to open the same protocol interface with the BY_DRIVER attribute.
The shell can dump out information about Open Protocols, and driver relationships in general, using OpenProtocolInformation() boot service. Andrew Fish On Sep 18, 2012, at 8:18 AM, Jordan Justen wrote: > On Tue, Sep 18, 2012 at 3:51 AM, Laszlo Ersek <[email protected]> wrote: >> Hi, >> >> "9.2 Driver Binding Protocol Template" in the Driver Writer’s Guide >> for UEFI 2.3.1 (v1.01) says, >> >> Although the thought of initializing something as soon as it is >> supported in the Supported() service of the driver seems to make >> sense, the Supported() service is intended only to be a quick check >> to find out if a driver can make a connection to the specified >> controller, find out if it has already been called (started and in >> use), or if it is in use exclusively by another component. The >> Supported() service must return an error if the controller is >> already in use or is in use exclusively by another component. >> >> How do I detect if Start() has already been called for this Controller >> (which is a PCI device BTW). I figured my driver could keep a list of >> already driven Controllers, but "18 PCI Driver Design Guidelines" comes >> with several examples and none of them implement something like this, as >> far as I can see. >> >> My current Supported() function starts by calling gBS->OpenProtocol() >> with gEfiPciIoProtocolGuid. This operation is undone at the end of >> Supported(), but not undone at the end of a successful Start(). So, may >> I expect the PciIo protocol to keep track of driven Controllers for me? >> Consequently, may I expect OpenProtocol() in my Supported() function to >> return EFI_ALREADY_STARTED (which I then forward outwards from Supported())? > > Yes, the UEFI Boot Services/DXE Core will keep track of which protocol > instances are "open". > > -Jordan > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > edk2-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
