diff options
author | Michael Chan <mchan@broadcom.com> | 2008-11-12 19:02:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-12 19:02:45 -0500 |
commit | 40105c0b0753515711318db87d36c8338dc74490 (patch) | |
tree | fba1e682769648d1856ce1d09f1481c7d2eae170 | |
parent | d8026d939495c105cf747c0196a8fa738cf2ad20 (diff) |
bnx2: Reorganize timeout constants.
Move all related timeout constants to the same location. BNX2
prefix is also added to make them more consistent.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bnx2.c | 8 | ||||
-rw-r--r-- | drivers/net/bnx2.h | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index a52ffdc3b40a..84563b0b660e 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -1656,7 +1656,7 @@ bnx2_setup_serdes_phy(struct bnx2 *bp, u8 port) | |||
1656 | * exchanging base pages plus 3 next pages and | 1656 | * exchanging base pages plus 3 next pages and |
1657 | * normally completes in about 120 msec. | 1657 | * normally completes in about 120 msec. |
1658 | */ | 1658 | */ |
1659 | bp->current_interval = SERDES_AN_TIMEOUT; | 1659 | bp->current_interval = BNX2_SERDES_AN_TIMEOUT; |
1660 | bp->serdes_an_pending = 1; | 1660 | bp->serdes_an_pending = 1; |
1661 | mod_timer(&bp->timer, jiffies + bp->current_interval); | 1661 | mod_timer(&bp->timer, jiffies + bp->current_interval); |
1662 | } else { | 1662 | } else { |
@@ -2278,7 +2278,7 @@ bnx2_fw_sync(struct bnx2 *bp, u32 msg_data, int ack, int silent) | |||
2278 | return 0; | 2278 | return 0; |
2279 | 2279 | ||
2280 | /* wait for an acknowledgement. */ | 2280 | /* wait for an acknowledgement. */ |
2281 | for (i = 0; i < (FW_ACK_TIME_OUT_MS / 10); i++) { | 2281 | for (i = 0; i < (BNX2_FW_ACK_TIME_OUT_MS / 10); i++) { |
2282 | msleep(10); | 2282 | msleep(10); |
2283 | 2283 | ||
2284 | val = bnx2_shmem_rd(bp, BNX2_FW_MB); | 2284 | val = bnx2_shmem_rd(bp, BNX2_FW_MB); |
@@ -5705,7 +5705,7 @@ bnx2_5708_serdes_timer(struct bnx2 *bp) | |||
5705 | bnx2_read_phy(bp, bp->mii_bmcr, &bmcr); | 5705 | bnx2_read_phy(bp, bp->mii_bmcr, &bmcr); |
5706 | if (bmcr & BMCR_ANENABLE) { | 5706 | if (bmcr & BMCR_ANENABLE) { |
5707 | bnx2_enable_forced_2g5(bp); | 5707 | bnx2_enable_forced_2g5(bp); |
5708 | bp->current_interval = SERDES_FORCED_TIMEOUT; | 5708 | bp->current_interval = BNX2_SERDES_FORCED_TIMEOUT; |
5709 | } else { | 5709 | } else { |
5710 | bnx2_disable_forced_2g5(bp); | 5710 | bnx2_disable_forced_2g5(bp); |
5711 | bp->serdes_an_pending = 2; | 5711 | bp->serdes_an_pending = 2; |
@@ -6522,7 +6522,7 @@ bnx2_nway_reset(struct net_device *dev) | |||
6522 | 6522 | ||
6523 | spin_lock_bh(&bp->phy_lock); | 6523 | spin_lock_bh(&bp->phy_lock); |
6524 | 6524 | ||
6525 | bp->current_interval = SERDES_AN_TIMEOUT; | 6525 | bp->current_interval = BNX2_SERDES_AN_TIMEOUT; |
6526 | bp->serdes_an_pending = 1; | 6526 | bp->serdes_an_pending = 1; |
6527 | mod_timer(&bp->timer, jiffies + bp->current_interval); | 6527 | mod_timer(&bp->timer, jiffies + bp->current_interval); |
6528 | } | 6528 | } |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 2b9649ae6307..34ca47812af4 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -6679,8 +6679,6 @@ struct bnx2_napi { | |||
6679 | struct bnx2_tx_ring_info tx_ring; | 6679 | struct bnx2_tx_ring_info tx_ring; |
6680 | }; | 6680 | }; |
6681 | 6681 | ||
6682 | #define BNX2_TIMER_INTERVAL HZ | ||
6683 | |||
6684 | struct bnx2 { | 6682 | struct bnx2 { |
6685 | /* Fields used in the tx and intr/napi performance paths are grouped */ | 6683 | /* Fields used in the tx and intr/napi performance paths are grouped */ |
6686 | /* together in the beginning of the structure. */ | 6684 | /* together in the beginning of the structure. */ |
@@ -6728,7 +6726,11 @@ struct bnx2 { | |||
6728 | 6726 | ||
6729 | /* End of fields used in the performance code paths. */ | 6727 | /* End of fields used in the performance code paths. */ |
6730 | 6728 | ||
6731 | int current_interval; | 6729 | unsigned int current_interval; |
6730 | #define BNX2_TIMER_INTERVAL HZ | ||
6731 | #define BNX2_SERDES_AN_TIMEOUT (HZ / 3) | ||
6732 | #define BNX2_SERDES_FORCED_TIMEOUT (HZ / 10) | ||
6733 | |||
6732 | struct timer_list timer; | 6734 | struct timer_list timer; |
6733 | struct work_struct reset_task; | 6735 | struct work_struct reset_task; |
6734 | 6736 | ||
@@ -6860,8 +6862,6 @@ struct bnx2 { | |||
6860 | #define PHY_LOOPBACK 2 | 6862 | #define PHY_LOOPBACK 2 |
6861 | 6863 | ||
6862 | u8 serdes_an_pending; | 6864 | u8 serdes_an_pending; |
6863 | #define SERDES_AN_TIMEOUT (HZ / 3) | ||
6864 | #define SERDES_FORCED_TIMEOUT (HZ / 10) | ||
6865 | 6865 | ||
6866 | u8 mac_addr[8]; | 6866 | u8 mac_addr[8]; |
6867 | 6867 | ||
@@ -6959,14 +6959,14 @@ struct fw_info { | |||
6959 | /* This value (in milliseconds) determines the frequency of the driver | 6959 | /* This value (in milliseconds) determines the frequency of the driver |
6960 | * issuing the PULSE message code. The firmware monitors this periodic | 6960 | * issuing the PULSE message code. The firmware monitors this periodic |
6961 | * pulse to determine when to switch to an OS-absent mode. */ | 6961 | * pulse to determine when to switch to an OS-absent mode. */ |
6962 | #define DRV_PULSE_PERIOD_MS 250 | 6962 | #define BNX2_DRV_PULSE_PERIOD_MS 250 |
6963 | 6963 | ||
6964 | /* This value (in milliseconds) determines how long the driver should | 6964 | /* This value (in milliseconds) determines how long the driver should |
6965 | * wait for an acknowledgement from the firmware before timing out. Once | 6965 | * wait for an acknowledgement from the firmware before timing out. Once |
6966 | * the firmware has timed out, the driver will assume there is no firmware | 6966 | * the firmware has timed out, the driver will assume there is no firmware |
6967 | * running and there won't be any firmware-driver synchronization during a | 6967 | * running and there won't be any firmware-driver synchronization during a |
6968 | * driver reset. */ | 6968 | * driver reset. */ |
6969 | #define FW_ACK_TIME_OUT_MS 1000 | 6969 | #define BNX2_FW_ACK_TIME_OUT_MS 1000 |
6970 | 6970 | ||
6971 | 6971 | ||
6972 | #define BNX2_DRV_RESET_SIGNATURE 0x00000000 | 6972 | #define BNX2_DRV_RESET_SIGNATURE 0x00000000 |