Please find the replies and doubts in-lined.

Regards,
Shaveta

-----Original Message-----
From: Tian, Feng [mailto:[email protected]] 
Sent: Tuesday, May 03, 2016 1:02 PM
To: Shaveta Leekha <[email protected]>; [email protected]
Cc: Tian, Feng <[email protected]>
Subject: RE: Two PCI IO protocols getting produced by same GUID, how to open 
correct one?

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

[Shaveta] Doing the same, the moment I OpenProtocol, I read class code to check 
for the device(In my SATA controller driver).
But the issue is that, if some real device on PCI like NIC card open this PCI 
IO(Emulated protocol instance)?


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?

[Shaveta]
Yes on LS2080 platform, we have real PCI controllers that have E1000 card on 
them(used for networking purposes)
And USB and SATA controllers are on-board.
So to provide SATA and USB, a PCIe emulation layer, a PCI IO protocol is 
installed in PciEmulation code.


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

Reply via email to