aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 718cf77e345a..601f93e482c6 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1185,7 +1185,7 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu)
1185 int frame_size = new_mtu + ETH_HLEN; 1185 int frame_size = new_mtu + ETH_HLEN;
1186 1186
1187 if (priv->vlan_enable) 1187 if (priv->vlan_enable)
1188 frame_size += VLAN_ETH_HLEN; 1188 frame_size += VLAN_HLEN;
1189 1189
1190 if (gfar_uses_fcb(priv)) 1190 if (gfar_uses_fcb(priv))
1191 frame_size += GMAC_FCB_LEN; 1191 frame_size += GMAC_FCB_LEN;
@@ -1299,11 +1299,11 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id)
1299 1299
1300 /* If we are coalescing the interrupts, reset the timer */ 1300 /* If we are coalescing the interrupts, reset the timer */
1301 /* Otherwise, clear it */ 1301 /* Otherwise, clear it */
1302 if (priv->txcoalescing) 1302 if (likely(priv->txcoalescing)) {
1303 gfar_write(&priv->regs->txic, 0);
1303 gfar_write(&priv->regs->txic, 1304 gfar_write(&priv->regs->txic,
1304 mk_ic_value(priv->txcount, priv->txtime)); 1305 mk_ic_value(priv->txcount, priv->txtime));
1305 else 1306 }
1306 gfar_write(&priv->regs->txic, 0);
1307 1307
1308 spin_unlock(&priv->txlock); 1308 spin_unlock(&priv->txlock);
1309 1309
@@ -1417,11 +1417,11 @@ irqreturn_t gfar_receive(int irq, void *dev_id)
1417 1417
1418 /* If we are coalescing interrupts, update the timer */ 1418 /* If we are coalescing interrupts, update the timer */
1419 /* Otherwise, clear it */ 1419 /* Otherwise, clear it */
1420 if (priv->rxcoalescing) 1420 if (likely(priv->rxcoalescing)) {
1421 gfar_write(&priv->regs->rxic, 0);
1421 gfar_write(&priv->regs->rxic, 1422 gfar_write(&priv->regs->rxic,
1422 mk_ic_value(priv->rxcount, priv->rxtime)); 1423 mk_ic_value(priv->rxcount, priv->rxtime));
1423 else 1424 }
1424 gfar_write(&priv->regs->rxic, 0);
1425 1425
1426 spin_unlock_irqrestore(&priv->rxlock, flags); 1426 spin_unlock_irqrestore(&priv->rxlock, flags);
1427#endif 1427#endif
@@ -1526,9 +1526,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
1526 rmb(); 1526 rmb();
1527 skb = priv->rx_skbuff[priv->skb_currx]; 1527 skb = priv->rx_skbuff[priv->skb_currx];
1528 1528
1529 if (!(bdp->status & 1529 if ((bdp->status & RXBD_LAST) && !(bdp->status & RXBD_ERR)) {
1530 (RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET
1531 | RXBD_CRCERR | RXBD_OVERRUN | RXBD_TRUNCATED))) {
1532 /* Increment the number of packets */ 1530 /* Increment the number of packets */
1533 dev->stats.rx_packets++; 1531 dev->stats.rx_packets++;
1534 howmany++; 1532 howmany++;
@@ -1595,11 +1593,11 @@ static int gfar_poll(struct napi_struct *napi, int budget)
1595 1593
1596 /* If we are coalescing interrupts, update the timer */ 1594 /* If we are coalescing interrupts, update the timer */
1597 /* Otherwise, clear it */ 1595 /* Otherwise, clear it */
1598 if (priv->rxcoalescing) 1596 if (likely(priv->rxcoalescing)) {
1597 gfar_write(&priv->regs->rxic, 0);
1599 gfar_write(&priv->regs->rxic, 1598 gfar_write(&priv->regs->rxic,
1600 mk_ic_value(priv->rxcount, priv->rxtime)); 1599 mk_ic_value(priv->rxcount, priv->rxtime));
1601 else 1600 }
1602 gfar_write(&priv->regs->rxic, 0);
1603 } 1601 }
1604 1602
1605 return howmany; 1603 return howmany;