[edk2] HII menus for multiple PCIe cards of same type and vendor

Subject: [edk2] HII menus for multiple PCIe cards of same type and vendor

From: rangasai C <rangasaic@gmail.com>

To: edk2-devel@lists.sourceforge.net

Date: 2011-09-09 22:02:46

I am writing a PCIe device driver and part of the job of the driver is to display configuration (HII) menus for that card.
I am trying to resolve an issue which occurs when two or more cards of the same type ( from the same vendor) are plugged into the system.
The device driver calls a routine which creates virtual driver handle to be used by the HII database. The routine then installs EFI_HII_CONFIGURATION_ACCESS_PROTOCOL to this virtual driver handle and registers packages ( vfr + uni) to the HII database.
This enables the configuration menus to be displayed in the host fw setup.

Unfortunately, the HII packets are tied to a guid which is is constant during buildtime. Therefore, in case of multiple cards it registers the package from only one card. When it tries to do it from the second card, it notices that an HII driver has already been registered with that guid so it returns an error.
1. Is there a way to dynamically generate a GUID ?
2. Or should I modify my HII driver in such a way that only one HII driver gets loaded and that will take care of rest of the cards it detects, dynamically ( using labels in the vfr ) ?