Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266874
b: refs/heads/master
c: a9097a9
h: refs/heads/master
v: v3
  • Loading branch information
Giuseppe CAVALLARO authored and David S. Miller committed Oct 19, 2011
1 parent 2281833 commit ad24d31
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79ee1dc32b945ad71248332f3a3b355332ad3376
refs/heads/master: a9097a9666fd7b08fd2a152b2a0b6c8d48639bb2
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/stmicro/stmmac/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ struct stmmac_priv {

u32 msg_enable;
spinlock_t lock;
spinlock_t tx_lock;
int wolopts;
int wolenabled;
int wol_irq;
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ static void stmmac_tx(struct stmmac_priv *priv)
{
unsigned int txsize = priv->dma_tx_size;

spin_lock(&priv->tx_lock);

while (priv->dirty_tx != priv->cur_tx) {
int last;
unsigned int entry = priv->dirty_tx % txsize;
Expand Down Expand Up @@ -651,6 +653,7 @@ static void stmmac_tx(struct stmmac_priv *priv)
}
netif_tx_unlock(priv->dev);
}
spin_unlock(&priv->tx_lock);
}

static inline void stmmac_enable_irq(struct stmmac_priv *priv)
Expand Down Expand Up @@ -1078,6 +1081,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_BUSY;
}

spin_lock(&priv->tx_lock);

entry = priv->cur_tx % txsize;

#ifdef STMMAC_XMIT_DEBUG
Expand Down Expand Up @@ -1166,6 +1171,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)

priv->hw->dma->enable_dma_transmission(priv->ioaddr);

spin_unlock(&priv->tx_lock);

return NETDEV_TX_OK;
}

Expand Down Expand Up @@ -1731,6 +1738,7 @@ static int stmmac_probe(struct net_device *dev)
"please, use ifconfig or nwhwconfig!\n");

spin_lock_init(&priv->lock);
spin_lock_init(&priv->tx_lock);

ret = register_netdev(dev);
if (ret) {
Expand Down

0 comments on commit ad24d31

Please sign in to comment.