]> bbs.cooldavid.org Git - net-next-2.6.git/commit - drivers/net/tg3.c
tg3: fix 64 bit counter for ethtool stats
authorStefan Buehler <stbuehler@web.de>
Fri, 15 Aug 2008 21:10:54 +0000 (14:10 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Aug 2008 21:10:54 +0000 (14:10 -0700)
commit816f8b86621000fc82e16ae5f172164de761d5eb
treeb7a6964f422ebb4815314397ae8ed4c69d3fcc70
parent4ba526ced990f4d61ee8d65fe8a6f0745e8e455c
tg3: fix 64 bit counter for ethtool stats

Ethtool stats are 64-bits in length.  net_device_stats members are
unsigned long types.  When gathering information for
a get_ethtool_stats call, the driver will call a driver-private,
inlined get_stat64() function, which returns an unsigned long value.
This call will inadvertently mask off the upper 32-bits of a stat on
32-bit machines.

This patch defines a new get_estat() inline function and modifies the
ESTAT_ADD() macro to use it.

Signed-off-by: Stefan Buehler <stbuehler@web.de>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c