Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156353
b: refs/heads/master
c: f6caa14
h: refs/heads/master
i:
  156351: 9d7f6da
v: v3
  • Loading branch information
Mike McCormack authored and David S. Miller committed Aug 4, 2009
1 parent 02ccee3 commit ea1a1c4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 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: 202ff1ec8e53d5dd36e1a5bd4b0a7ed7dbd45087
refs/heads/master: f6caa14aa0b126d4a2933907d1519611b2a8524a
14 changes: 13 additions & 1 deletion trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,8 @@ static int sky2_up(struct net_device *dev)
sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL);
#endif

sky2->restarting = 0;

err = sky2_rx_start(sky2);
if (err)
goto err_out;
Expand All @@ -1500,6 +1502,9 @@ static int sky2_up(struct net_device *dev)

sky2_set_multicast(dev);

/* wake queue incase we are restarting */
netif_wake_queue(dev);

if (netif_msg_ifup(sky2))
printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
return 0;
Expand Down Expand Up @@ -1533,6 +1538,8 @@ static inline int tx_dist(unsigned tail, unsigned head)
/* Number of list elements available for next tx */
static inline int tx_avail(const struct sky2_port *sky2)
{
if (unlikely(sky2->restarting))
return 0;
return sky2->tx_pending - tx_dist(sky2->tx_cons, sky2->tx_prod);
}

Expand Down Expand Up @@ -1818,6 +1825,10 @@ static int sky2_down(struct net_device *dev)
if (netif_msg_ifdown(sky2))
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);

/* explicitly shut off tx incase we're restarting */
sky2->restarting = 1;
netif_tx_disable(dev);

/* Force flow control off */
sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);

Expand Down Expand Up @@ -2359,7 +2370,7 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
{
struct sky2_port *sky2 = netdev_priv(dev);

if (netif_running(dev)) {
if (likely(netif_running(dev) && !sky2->restarting)) {
netif_tx_lock(dev);
sky2_tx_complete(sky2, last);
netif_tx_unlock(dev);
Expand Down Expand Up @@ -4283,6 +4294,7 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
spin_lock_init(&sky2->phy_lock);
sky2->tx_pending = TX_DEF_PENDING;
sky2->rx_pending = RX_DEF_PENDING;
sky2->restarting = 0;

hw->dev[port] = dev;

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/sky2.h
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,7 @@ struct sky2_port {
u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */
u8 rx_csum;
u8 wol;
u8 restarting;
enum flow_control flow_mode;
enum flow_control flow_status;

Expand Down

0 comments on commit ea1a1c4

Please sign in to comment.