diff options
author | Michael Chan <mchan@broadcom.com> | 2008-07-15 01:38:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-15 01:38:23 -0400 |
commit | a2f138900d5c342742c369293edaf92d2173c92e (patch) | |
tree | 50bdd69b9661ba9f8f15d9fc39516310097a1612 /drivers | |
parent | 7bb0a04fcd610e5db59690332b2a46b6068c8bc3 (diff) |
bnx2: Add ack parameter to bnx2_fw_sync().
ack=1 means wait for firmware acknowledgement, and ack=0
means don't wait. All current callers will set it to 1.
In the next patch, new calls will set ack=0.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bnx2.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 989d4b6168d8..4dfd43917aea 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -1491,7 +1491,7 @@ bnx2_phy_get_pause_adv(struct bnx2 *bp) | |||
1491 | return adv; | 1491 | return adv; |
1492 | } | 1492 | } |
1493 | 1493 | ||
1494 | static int bnx2_fw_sync(struct bnx2 *, u32, int); | 1494 | static int bnx2_fw_sync(struct bnx2 *, u32, int, int); |
1495 | 1495 | ||
1496 | static int | 1496 | static int |
1497 | bnx2_setup_remote_phy(struct bnx2 *bp, u8 port) | 1497 | bnx2_setup_remote_phy(struct bnx2 *bp, u8 port) |
@@ -1544,7 +1544,7 @@ bnx2_setup_remote_phy(struct bnx2 *bp, u8 port) | |||
1544 | bnx2_shmem_wr(bp, BNX2_DRV_MB_ARG0, speed_arg); | 1544 | bnx2_shmem_wr(bp, BNX2_DRV_MB_ARG0, speed_arg); |
1545 | 1545 | ||
1546 | spin_unlock_bh(&bp->phy_lock); | 1546 | spin_unlock_bh(&bp->phy_lock); |
1547 | bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_CMD_SET_LINK, 0); | 1547 | bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_CMD_SET_LINK, 1, 0); |
1548 | spin_lock_bh(&bp->phy_lock); | 1548 | spin_lock_bh(&bp->phy_lock); |
1549 | 1549 | ||
1550 | return 0; | 1550 | return 0; |
@@ -2262,7 +2262,7 @@ bnx2_set_phy_loopback(struct bnx2 *bp) | |||
2262 | } | 2262 | } |
2263 | 2263 | ||
2264 | static int | 2264 | static int |
2265 | bnx2_fw_sync(struct bnx2 *bp, u32 msg_data, int silent) | 2265 | bnx2_fw_sync(struct bnx2 *bp, u32 msg_data, int ack, int silent) |
2266 | { | 2266 | { |
2267 | int i; | 2267 | int i; |
2268 | u32 val; | 2268 | u32 val; |
@@ -2272,6 +2272,9 @@ bnx2_fw_sync(struct bnx2 *bp, u32 msg_data, int silent) | |||
2272 | 2272 | ||
2273 | bnx2_shmem_wr(bp, BNX2_DRV_MB, msg_data); | 2273 | bnx2_shmem_wr(bp, BNX2_DRV_MB, msg_data); |
2274 | 2274 | ||
2275 | if (!ack) | ||
2276 | return 0; | ||
2277 | |||
2275 | /* wait for an acknowledgement. */ | 2278 | /* wait for an acknowledgement. */ |
2276 | for (i = 0; i < (FW_ACK_TIME_OUT_MS / 10); i++) { | 2279 | for (i = 0; i < (FW_ACK_TIME_OUT_MS / 10); i++) { |
2277 | msleep(10); | 2280 | msleep(10); |
@@ -3610,7 +3613,8 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) | |||
3610 | } | 3613 | } |
3611 | 3614 | ||
3612 | if (!(bp->flags & BNX2_FLAG_NO_WOL)) | 3615 | if (!(bp->flags & BNX2_FLAG_NO_WOL)) |
3613 | bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT3 | wol_msg, 0); | 3616 | bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT3 | wol_msg, |
3617 | 1, 0); | ||
3614 | 3618 | ||
3615 | pmcsr &= ~PCI_PM_CTRL_STATE_MASK; | 3619 | pmcsr &= ~PCI_PM_CTRL_STATE_MASK; |
3616 | if ((CHIP_ID(bp) == CHIP_ID_5706_A0) || | 3620 | if ((CHIP_ID(bp) == CHIP_ID_5706_A0) || |
@@ -4309,7 +4313,7 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) | |||
4309 | udelay(5); | 4313 | udelay(5); |
4310 | 4314 | ||
4311 | /* Wait for the firmware to tell us it is ok to issue a reset. */ | 4315 | /* Wait for the firmware to tell us it is ok to issue a reset. */ |
4312 | bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT0 | reset_code, 1); | 4316 | bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT0 | reset_code, 1, 1); |
4313 | 4317 | ||
4314 | /* Deposit a driver reset signature so the firmware knows that | 4318 | /* Deposit a driver reset signature so the firmware knows that |
4315 | * this is a soft reset. */ | 4319 | * this is a soft reset. */ |
@@ -4370,7 +4374,7 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) | |||
4370 | } | 4374 | } |
4371 | 4375 | ||
4372 | /* Wait for the firmware to finish its initialization. */ | 4376 | /* Wait for the firmware to finish its initialization. */ |
4373 | rc = bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT1 | reset_code, 0); | 4377 | rc = bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT1 | reset_code, 1, 0); |
4374 | if (rc) | 4378 | if (rc) |
4375 | return rc; | 4379 | return rc; |
4376 | 4380 | ||
@@ -4596,7 +4600,7 @@ bnx2_init_chip(struct bnx2 *bp) | |||
4596 | REG_WR(bp, BNX2_MISC_NEW_CORE_CTL, val); | 4600 | REG_WR(bp, BNX2_MISC_NEW_CORE_CTL, val); |
4597 | } | 4601 | } |
4598 | rc = bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT2 | BNX2_DRV_MSG_CODE_RESET, | 4602 | rc = bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT2 | BNX2_DRV_MSG_CODE_RESET, |
4599 | 0); | 4603 | 1, 0); |
4600 | 4604 | ||
4601 | REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS, BNX2_MISC_ENABLE_DEFAULT); | 4605 | REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS, BNX2_MISC_ENABLE_DEFAULT); |
4602 | REG_RD(bp, BNX2_MISC_ENABLE_SET_BITS); | 4606 | REG_RD(bp, BNX2_MISC_ENABLE_SET_BITS); |