Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15753
b: refs/heads/master
c: 2224795
h: refs/heads/master
i:
  15751: a2057d5
v: v3
  • Loading branch information
shemminger@osdl.org authored and Jeff Garzik committed Dec 1, 2005
1 parent ae1d105 commit 0ee06a2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 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: 018d1c667ef4dce5299dd79d38447840789c97d6
refs/heads/master: 2224795d7e4c7f7e44fe21f0fa067d62539308fb
26 changes: 16 additions & 10 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,9 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
struct net_device *dev = sky2->netdev;
unsigned i;

if (done == sky2->tx_cons)
return;

if (unlikely(netif_msg_tx_done(sky2)))
printk(KERN_DEBUG "%s: tx done, up to %u\n",
dev->name, done);
Expand Down Expand Up @@ -1711,16 +1714,18 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2,
goto resubmit;
}

/* Transmit ring index in reported status block is encoded as:
*
* | TXS2 | TXA2 | TXS1 | TXA1
/*
* Check for transmit complete
*/
static inline u16 tx_index(u8 port, u32 status, u16 len)
static inline void sky2_tx_check(struct sky2_hw *hw, int port)
{
if (port == 0)
return status & 0xfff;
else
return ((status >> 24) & 0xff) | (len & 0xf) << 8;
struct net_device *dev = hw->dev[port];

if (dev && netif_running(dev)) {
sky2_tx_complete(netdev_priv(dev),
sky2_read16(hw, port == 0
? STAT_TXA1_RIDX : STAT_TXA2_RIDX));
}
}

/*
Expand Down Expand Up @@ -1803,8 +1808,7 @@ static int sky2_poll(struct net_device *dev0, int *budget)
break;

case OP_TXINDEXLE:
sky2_tx_complete(sky2,
tx_index(sky2->port, status, length));
/* pick up transmit status later */
break;

default:
Expand All @@ -1816,6 +1820,8 @@ static int sky2_poll(struct net_device *dev0, int *budget)
}

exit_loop:
sky2_tx_check(hw, 0);
sky2_tx_check(hw, 1);

mmiowb();

Expand Down

0 comments on commit 0ee06a2

Please sign in to comment.