Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170436
b: refs/heads/master
c: 3272686
h: refs/heads/master
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Oct 6, 2009
1 parent f027253 commit 030669d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0acb6fde5fc84009be1c7efc0aaa8e69e394a2e2
refs/heads/master: 3272686c98da64d6eeaa2434782f42270b110758
19 changes: 14 additions & 5 deletions trunk/drivers/net/igb/e1000_mbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,16 @@ static s32 igb_poll_for_msg(struct e1000_hw *hw, u16 mbx_id)
if (!countdown || !mbx->ops.check_for_msg)
goto out;

while (mbx->ops.check_for_msg(hw, mbx_id)) {
while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) {
countdown--;
if (!countdown)
break;
udelay(mbx->usec_delay);
}

/* if we failed, all future posted messages fail until reset */
if (!countdown)
mbx->timeout = 0;
out:
return countdown ? 0 : -E1000_ERR_MBX;
}
Expand All @@ -168,12 +172,16 @@ static s32 igb_poll_for_ack(struct e1000_hw *hw, u16 mbx_id)
if (!countdown || !mbx->ops.check_for_ack)
goto out;

while (mbx->ops.check_for_ack(hw, mbx_id)) {
while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) {
countdown--;
if (!countdown)
break;
udelay(mbx->usec_delay);
}

/* if we failed, all future posted messages fail until reset */
if (!countdown)
mbx->timeout = 0;
out:
return countdown ? 0 : -E1000_ERR_MBX;
}
Expand Down Expand Up @@ -217,12 +225,13 @@ static s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_
static s32 igb_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
{
struct e1000_mbx_info *mbx = &hw->mbx;
s32 ret_val = 0;
s32 ret_val = -E1000_ERR_MBX;

if (!mbx->ops.write)
/* exit if either we can't write or there isn't a defined timeout */
if (!mbx->ops.write || !mbx->timeout)
goto out;

/* send msg*/
/* send msg */
ret_val = mbx->ops.write(hw, msg, size, mbx_id);

/* if msg sent wait until we receive an ack */
Expand Down

0 comments on commit 030669d

Please sign in to comment.