diff options
author | Michael Chan <mchan@broadcom.com> | 2007-07-16 21:27:10 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-18 04:46:48 -0400 |
commit | 7ea6920ee9480118e2bd2d712d667820703f55cd (patch) | |
tree | 1632d3080943db805d30d6bb6934b5d8bc6f901a /drivers/net/bnx2.c | |
parent | c2d3db8c7cbb94e77461627085b85d74dc64d716 (diff) |
[BNX2]: Use constants for stats ticks.
Change all stats related magic numbers to constants.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 28399d8d8d2b..2dd002b338cb 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -4123,7 +4123,7 @@ bnx2_init_chip(struct bnx2 *bp) | |||
4123 | if (CHIP_NUM(bp) == CHIP_NUM_5708) | 4123 | if (CHIP_NUM(bp) == CHIP_NUM_5708) |
4124 | REG_WR(bp, BNX2_HC_STATS_TICKS, 0); | 4124 | REG_WR(bp, BNX2_HC_STATS_TICKS, 0); |
4125 | else | 4125 | else |
4126 | REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks & 0xffff00); | 4126 | REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks); |
4127 | REG_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */ | 4127 | REG_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */ |
4128 | 4128 | ||
4129 | if (CHIP_ID(bp) == CHIP_ID_5706_A1) | 4129 | if (CHIP_ID(bp) == CHIP_ID_5706_A1) |
@@ -5798,8 +5798,9 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal) | |||
5798 | if (bp->stats_ticks != 0 && bp->stats_ticks != USEC_PER_SEC) | 5798 | if (bp->stats_ticks != 0 && bp->stats_ticks != USEC_PER_SEC) |
5799 | bp->stats_ticks = USEC_PER_SEC; | 5799 | bp->stats_ticks = USEC_PER_SEC; |
5800 | } | 5800 | } |
5801 | if (bp->stats_ticks > 0xffff00) bp->stats_ticks = 0xffff00; | 5801 | if (bp->stats_ticks > BNX2_HC_STATS_TICKS_HC_STAT_TICKS) |
5802 | bp->stats_ticks &= 0xffff00; | 5802 | bp->stats_ticks = BNX2_HC_STATS_TICKS_HC_STAT_TICKS; |
5803 | bp->stats_ticks &= BNX2_HC_STATS_TICKS_HC_STAT_TICKS; | ||
5803 | 5804 | ||
5804 | if (netif_running(bp->dev)) { | 5805 | if (netif_running(bp->dev)) { |
5805 | bnx2_netif_stop(bp); | 5806 | bnx2_netif_stop(bp); |
@@ -6696,7 +6697,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
6696 | bp->rx_ticks_int = 18; | 6697 | bp->rx_ticks_int = 18; |
6697 | bp->rx_ticks = 18; | 6698 | bp->rx_ticks = 18; |
6698 | 6699 | ||
6699 | bp->stats_ticks = 1000000 & 0xffff00; | 6700 | bp->stats_ticks = USEC_PER_SEC & BNX2_HC_STATS_TICKS_HC_STAT_TICKS; |
6700 | 6701 | ||
6701 | bp->timer_interval = HZ; | 6702 | bp->timer_interval = HZ; |
6702 | bp->current_interval = HZ; | 6703 | bp->current_interval = HZ; |