AR7 ethernet: small post-merge cleanups and fixes

Signed-off-by: Matteo Croce <technoboy85@gmail.com>
Signed-off-by: Eugene Konev <ejka@imfi.kspu.ru>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Matteo Croce and committed by Jeff Garzik 6cd043d9 02bae212

+12 -19
+12 -19
drivers/net/cpmac.c
··· 460 460 struct cpmac_desc *desc; 461 461 struct cpmac_priv *priv = netdev_priv(dev); 462 462 463 - if (unlikely(skb_padto(skb, ETH_ZLEN))) { 464 - if (netif_msg_tx_err(priv) && net_ratelimit()) 465 - printk(KERN_WARNING 466 - "%s: tx: padding failed, dropping\n", dev->name); 467 - spin_lock(&priv->lock); 468 - dev->stats.tx_dropped++; 469 - spin_unlock(&priv->lock); 470 - return -ENOMEM; 471 - } 463 + if (unlikely(skb_padto(skb, ETH_ZLEN))) 464 + return NETDEV_TX_OK; 472 465 473 466 len = max(skb->len, ETH_ZLEN); 474 - queue = skb_get_queue_mapping(skb); 467 + queue = skb->queue_mapping; 475 468 #ifdef CONFIG_NETDEVICES_MULTIQUEUE 476 469 netif_stop_subqueue(dev, queue); 477 470 #else ··· 474 481 desc = &priv->desc_ring[queue]; 475 482 if (unlikely(desc->dataflags & CPMAC_OWN)) { 476 483 if (netif_msg_tx_err(priv) && net_ratelimit()) 477 - printk(KERN_WARNING "%s: tx dma ring full, dropping\n", 484 + printk(KERN_WARNING "%s: tx dma ring full\n", 478 485 dev->name); 479 - spin_lock(&priv->lock); 480 - dev->stats.tx_dropped++; 481 - spin_unlock(&priv->lock); 482 - dev_kfree_skb_any(skb); 483 - return -ENOMEM; 486 + return NETDEV_TX_BUSY; 484 487 } 485 488 486 489 spin_lock(&priv->lock); ··· 498 509 cpmac_dump_skb(dev, skb); 499 510 cpmac_write(priv->regs, CPMAC_TX_PTR(queue), (u32)desc->mapping); 500 511 501 - return 0; 512 + return NETDEV_TX_OK; 502 513 } 503 514 504 515 static void cpmac_end_xmit(struct net_device *dev, int queue) ··· 635 646 int i; 636 647 if (unlikely(!priv->desc_ring)) 637 648 return; 638 - for (i = 0; i < CPMAC_QUEUES; i++) 649 + for (i = 0; i < CPMAC_QUEUES; i++) { 650 + priv->desc_ring[i].dataflags = 0; 639 651 if (priv->desc_ring[i].skb) { 640 652 dev_kfree_skb_any(priv->desc_ring[i].skb); 641 653 if (netif_subqueue_stopped(dev, i)) 642 654 netif_wake_subqueue(dev, i); 643 655 } 656 + } 644 657 } 645 658 646 659 static void cpmac_hw_error(struct work_struct *work) ··· 718 727 #ifdef CONFIG_NETDEVICES_MULTIQUEUE 719 728 for (i = 0; i < CPMAC_QUEUES; i++) 720 729 if (priv->desc_ring[i].skb) { 730 + priv->desc_ring[i].dataflags = 0; 721 731 dev_kfree_skb_any(priv->desc_ring[i].skb); 722 732 netif_wake_subqueue(dev, i); 723 733 break; 724 734 } 725 735 #else 736 + priv->desc_ring[0].dataflags = 0; 726 737 if (priv->desc_ring[0].skb) 727 738 dev_kfree_skb_any(priv->desc_ring[0].skb); 728 739 netif_wake_queue(dev); ··· 787 794 { 788 795 struct cpmac_priv *priv = netdev_priv(dev); 789 796 790 - if (dev->flags && IFF_UP) 797 + if (netif_running(dev)) 791 798 return -EBUSY; 792 799 priv->ring_size = ring->rx_pending; 793 800 return 0;