pci: Add PCI LRDT tag size and section size

This patch adds a preprocessor constant to describe the PCI VPD large
resource data type tag size and an inline function to extract the large
resource section size from the large resource data type tag.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Matt Carlson
2010-02-26 14:04:39 +00:00
committed by David S. Miller
parent 2ea186ae53
commit a2ce766238
3 changed files with 25 additions and 10 deletions

View File

@@ -7773,15 +7773,17 @@ bnx2_read_vpd_fw_ver(struct bnx2 *bp)
unsigned int block_end;
if (val == 0x82 || val == 0x91) {
i = (i + 3 + (data[i + 1] + (data[i + 2] << 8)));
i += PCI_VPD_LRDT_TAG_SIZE +
pci_vpd_lrdt_size(&data[i]);
continue;
}
if (val != 0x90)
goto vpd_done;
block_end = (i + 3 + (data[i + 1] + (data[i + 2] << 8)));
i += 3;
block_end = (i + PCI_VPD_LRDT_TAG_SIZE +
pci_vpd_lrdt_size(&data[i]));
i += PCI_VPD_LRDT_TAG_SIZE;
if (block_end > BNX2_VPD_LEN)
goto vpd_done;