* [3/4][BNX2]: Use constants for stats ticks.
@ 2007-07-16 20:07 Michael Chan
2007-07-17 1:27 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Michael Chan @ 2007-07-16 20:07 UTC (permalink / raw)
To: davem, netdev
[BNX2]: Use constants for stats ticks.
Change all stats related magic numbers to constants.
Signed-off-by: Michael Chan <mchan@broadcom.com>
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 28399d8..2dd002b 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -4123,7 +4123,7 @@ bnx2_init_chip(struct bnx2 *bp)
if (CHIP_NUM(bp) == CHIP_NUM_5708)
REG_WR(bp, BNX2_HC_STATS_TICKS, 0);
else
- REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks & 0xffff00);
+ REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks);
REG_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */
if (CHIP_ID(bp) == CHIP_ID_5706_A1)
@@ -5798,8 +5798,9 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
if (bp->stats_ticks != 0 && bp->stats_ticks != USEC_PER_SEC)
bp->stats_ticks = USEC_PER_SEC;
}
- if (bp->stats_ticks > 0xffff00) bp->stats_ticks = 0xffff00;
- bp->stats_ticks &= 0xffff00;
+ if (bp->stats_ticks > BNX2_HC_STATS_TICKS_HC_STAT_TICKS)
+ bp->stats_ticks = BNX2_HC_STATS_TICKS_HC_STAT_TICKS;
+ bp->stats_ticks &= BNX2_HC_STATS_TICKS_HC_STAT_TICKS;
if (netif_running(bp->dev)) {
bnx2_netif_stop(bp);
@@ -6696,7 +6697,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->rx_ticks_int = 18;
bp->rx_ticks = 18;
- bp->stats_ticks = 1000000 & 0xffff00;
+ bp->stats_ticks = USEC_PER_SEC & BNX2_HC_STATS_TICKS_HC_STAT_TICKS;
bp->timer_interval = HZ;
bp->current_interval = HZ;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [3/4][BNX2]: Use constants for stats ticks.
2007-07-16 20:07 [3/4][BNX2]: Use constants for stats ticks Michael Chan
@ 2007-07-17 1:27 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-07-17 1:27 UTC (permalink / raw)
To: mchan; +Cc: netdev
From: "Michael Chan" <mchan@broadcom.com>
Date: Mon, 16 Jul 2007 13:07:46 -0700
> [BNX2]: Use constants for stats ticks.
>
> Change all stats related magic numbers to constants.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-17 1:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-16 20:07 [3/4][BNX2]: Use constants for stats ticks Michael Chan
2007-07-17 1:27 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).