summaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2010-02-26 14:04:39 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-28 00:43:30 -0800
commita2ce766238f72ff7337606c0bc96803c30c9e05c (patch)
tree5968e585402263556481075a49599dc697aeab49 /drivers/net/tg3.c
parent2ea186ae533c7b4f4c56811b69d3e40a6209a9c0 (diff)
downloadlinux-a2ce766238f72ff7337606c0bc96803c30c9e05c.tar.bz2
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>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 0d06e4007f44..5fccbe459949 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -12590,19 +12590,18 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
unsigned int block_end;
if (val == 0x82 || val == 0x91) {
- i = (i + 3 +
- (vpd_data[i + 1] +
- (vpd_data[i + 2] << 8)));
+ i += PCI_VPD_LRDT_TAG_SIZE +
+ pci_vpd_lrdt_size(&vpd_data[i]);
continue;
}
if (val != 0x90)
goto out_not_found;
- block_end = (i + 3 +
- (vpd_data[i + 1] +
- (vpd_data[i + 2] << 8)));
- i += 3;
+ block_end = i + PCI_VPD_LRDT_TAG_SIZE +
+ pci_vpd_lrdt_size(&vpd_data[i]);
+
+ i += PCI_VPD_LRDT_TAG_SIZE;
if (block_end > TG3_NVM_VPD_LEN)
goto out_not_found;