Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122739
b: refs/heads/master
c: 12dea57
h: refs/heads/master
i:
  122737: e57b6ce
  122735: fe2d52f
v: v3
  • Loading branch information
Dai Haruki authored and David S. Miller committed Dec 16, 2008
1 parent 6d243b9 commit daf566f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 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: b46a8454cd304b5376ba00d3457a612720e47269
refs/heads/master: 12dea57be552a291e93827baeffbb91e33f587a6
5 changes: 3 additions & 2 deletions trunk/drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,8 @@ void gfar_start(struct net_device *dev)

/* Unmask the interrupts we look for */
gfar_write(&regs->imask, IMASK_DEFAULT);

dev->trans_start = jiffies;
}

/* Bring the controller up and running */
Expand Down Expand Up @@ -1233,8 +1235,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
status = txbdp->status & TXBD_WRAP;

/* Set up checksumming */
if (likely((dev->features & NETIF_F_IP_CSUM)
&& (CHECKSUM_PARTIAL == skb->ip_summed))) {
if (CHECKSUM_PARTIAL == skb->ip_summed) {
fcb = gfar_add_fcb(skb, txbdp);
status |= TXBD_TOE;
gfar_tx_checksum(skb, fcb);
Expand Down
23 changes: 12 additions & 11 deletions trunk/drivers/net/gianfar_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,12 @@ static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rva
spin_lock(&priv->rxlock);

gfar_halt(dev);
gfar_clean_rx_ring(dev, priv->rx_ring_size);

spin_unlock(&priv->rxlock);
spin_unlock_irqrestore(&priv->txlock, flags);

gfar_clean_rx_ring(dev, priv->rx_ring_size);

/* Now we take down the rings to rebuild them */
stop_gfar(dev);
}
Expand All @@ -476,9 +477,10 @@ static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rva
priv->tx_ring_size = rvals->tx_pending;

/* Rebuild the rings with the new size */
if (dev->flags & IFF_UP)
if (dev->flags & IFF_UP) {
err = startup_gfar(dev);

netif_wake_queue(dev);
}
return err;
}

Expand All @@ -498,11 +500,12 @@ static int gfar_set_rx_csum(struct net_device *dev, uint32_t data)
spin_lock(&priv->rxlock);

gfar_halt(dev);
gfar_clean_rx_ring(dev, priv->rx_ring_size);

spin_unlock(&priv->rxlock);
spin_unlock_irqrestore(&priv->txlock, flags);

gfar_clean_rx_ring(dev, priv->rx_ring_size);

/* Now we take down the rings to rebuild them */
stop_gfar(dev);
}
Expand All @@ -511,9 +514,10 @@ static int gfar_set_rx_csum(struct net_device *dev, uint32_t data)
priv->rx_csum_enable = data;
spin_unlock_irqrestore(&priv->bflock, flags);

if (dev->flags & IFF_UP)
if (dev->flags & IFF_UP) {
err = startup_gfar(dev);

netif_wake_queue(dev);
}
return err;
}

Expand All @@ -529,22 +533,19 @@ static uint32_t gfar_get_rx_csum(struct net_device *dev)

static int gfar_set_tx_csum(struct net_device *dev, uint32_t data)
{
unsigned long flags;
struct gfar_private *priv = netdev_priv(dev);

if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_CSUM))
return -EOPNOTSUPP;

spin_lock_irqsave(&priv->txlock, flags);
gfar_halt(dev);
netif_tx_lock_bh(dev);

if (data)
dev->features |= NETIF_F_IP_CSUM;
else
dev->features &= ~NETIF_F_IP_CSUM;

gfar_start(dev);
spin_unlock_irqrestore(&priv->txlock, flags);
netif_tx_unlock_bh(dev);

return 0;
}
Expand Down

0 comments on commit daf566f

Please sign in to comment.