In your driver binding supported() of "Platform specific Sata controller driver", check the class code (PCI config space offset 09/0a/0bh) after getting the PciIo instance to see if it's the device you want to manage. If not, then it's not you want
PS: which platform are you running? Why your platform could have Pci bus and non-pci sata/usb host controller co-exist at the same time? Thanks Feng -----Original Message----- From: edk2-devel [mailto:[email protected]] On Behalf Of Shaveta Leekha Sent: Tuesday, May 3, 2016 2:55 PM To: [email protected] Subject: [edk2] Two PCI IO protocols getting produced by same GUID, how to open correct one? Hi, I have a scenario where two separate drivers are installing/producing "PCI IO" protocol with same GUID (gEfiPciIoProtocolGuid). Where: (1) One of the PCI Io protocol instance is produced by "MdeModulePkg/Bus/Pci/PciBus" driver for real PCI devices to use( like E1000/NIC card to use) (2) Other PCI Io protocol instance is produced by "Pci Emulation" layer created for USB and SATA kind of controllers. This protocol (APIs) is intended to be used by USB and SATA controller drivers. Now when I use "OpenProtocol" in my "Platform specific Sata controller driver" using: Status = gBS->OpenProtocol ( Controller, &gEfiPciIoProtocolGuid, (VOID **) &PciIo, This->DriverBindingHandle, Controller, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); How can I make sure that PCI Io protocol that is produced by "PciEmulation" layer driver is getting opened? As "gEfiPciIoProtocolGuid" is same for both protocol instances. How to handle such scenarios? Thanks and Regards, Shaveta _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

