Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159672
b: refs/heads/master
c: 481cea4
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Aug 14, 2009
1 parent 94def3f commit 73414b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 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: af18d8b89930aecc742982634adaf97dfb43ed3b
refs/heads/master: 481cea4a4d72aabe76dbb86b1a64f4e8931eca25
25 changes: 9 additions & 16 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1741,8 +1741,12 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
/*
* Free ring elements from starting at tx_cons until "done"
*
* NB: the hardware will tell us about partial completion of multi-part
* NB:
* 1. The hardware will tell us about partial completion of multi-part
* buffers so make sure not to free skb to early.
* 2. This may run in parallel start_xmit because the it only
* looks at the tail of the queue of FIFO (tx_cons), not
* the head (tx_prod)
*/
static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
{
Expand Down Expand Up @@ -1800,16 +1804,6 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
netif_wake_queue(dev);
}

/* Cleanup all untransmitted buffers, assume transmitter not running */
static void sky2_tx_clean(struct net_device *dev)
{
struct sky2_port *sky2 = netdev_priv(dev);

netif_tx_lock_bh(dev);
sky2_tx_complete(sky2, sky2->tx_prod);
netif_tx_unlock_bh(dev);
}

static void sky2_tx_reset(struct sky2_hw *hw, unsigned port)
{
/* Disable Force Sync bit and Enable Alloc bit */
Expand Down Expand Up @@ -1901,7 +1895,9 @@ static int sky2_down(struct net_device *dev)

sky2_tx_reset(hw, port);

sky2_tx_clean(dev);
/* Free any pending frames stuck in HW queue */
sky2_tx_complete(sky2, sky2->tx_prod);

sky2_rx_clean(sky2);

pci_free_consistent(hw->pdev, RX_LE_BYTES,
Expand Down Expand Up @@ -2378,11 +2374,8 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
{
struct sky2_port *sky2 = netdev_priv(dev);

if (likely(netif_running(dev) && !sky2->restarting)) {
netif_tx_lock(dev);
if (likely(netif_running(dev) && !sky2->restarting))
sky2_tx_complete(sky2, last);
netif_tx_unlock(dev);
}
}

static inline void sky2_skb_rx(const struct sky2_port *sky2,
Expand Down

0 comments on commit 73414b6

Please sign in to comment.