Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Ye, Ting (ting.ye@intel.com)
Reviewed-By: Wu, Jiaxin <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16278
6f19259b-4bc3-4df7-8a09-
765794883524
Snp->Db = (VOID *) ((UINTN) Address + 2048);\r
\r
//\r
Snp->Db = (VOID *) ((UINTN) Address + 2048);\r
\r
//\r
- // Find the correct memory and io bar.\r
+ // Find the correct BAR to do IO.\r
- Snp->MemoryBarIndex = PCI_MAX_BAR;\r
- Snp->IoBarIndex = PCI_MAX_BAR;\r
+ // Enumerate through the PCI BARs for the device to determine which one is\r
+ // the IO BAR. Save the index of the BAR into the adapter info structure.\r
+ // for regular 32bit BARs, 0 is memory mapped, 1 is io mapped\r
+ //\r
+ Snp->MemoryBarIndex = 0;\r
+ Snp->IoBarIndex = 1;\r
for (BarIndex = 0; BarIndex < PCI_MAX_BAR; BarIndex++) {\r
Status = PciIo->GetBarAttributes (\r
PciIo,\r
for (BarIndex = 0; BarIndex < PCI_MAX_BAR; BarIndex++) {\r
Status = PciIo->GetBarAttributes (\r
PciIo,\r
\r
FreePool (BarDesc);\r
}\r
\r
FreePool (BarDesc);\r
}\r
- if ((Snp->MemoryBarIndex == PCI_MAX_BAR) || (Snp->IoBarIndex == PCI_MAX_BAR)) {\r
- goto Error_DeleteSNP;\r
- }\r
\r
Status = PxeStart (Snp);\r
\r
\r
Status = PxeStart (Snp);\r
\r