Ticket #4122: 900-cpmac_multiqueue.patch

File 900-cpmac_multiqueue.patch, 2.1 KB (added by anonymous, 9 years ago)
  • drivers/net/cpmac.c

    This patch fixes the network driver cpmac.c for compilation with
    configuration option CONFIG_NETDEVICES_MULTIQUEUE.
    
    These compiler warnings are fixed by the patch:
    drivers/net/cpmac.c: In function 'cpmac_end_xmit':
    drivers/net/cpmac.c:630: warning: passing argument 2 of 'netif_subqueue_stopped' makes pointer from integer without a cast
    drivers/net/cpmac.c:641: warning: passing argument 2 of 'netif_subqueue_stopped' makes pointer from integer without a cast
    drivers/net/cpmac.c: In function 'cpmac_probe':
    drivers/net/cpmac.c:1128: warning: unused variable 'i'
    
    During runtime, the unpatched driver raises a fatal runtime exception.
    This is fixed by calling __netif_subqueue_stopped instead
    of netif_subqueue_stopped, too.
    
    Two additional code parts were modified for CONFIG_NETDEVICES_MULTIQUEUE
    because other drivers do it in the same way.
    
            Signed-off-by: Stefan Weil <weil@mail.berlios.de>
    
    a b  
    621621 
    622622                dev_kfree_skb_irq(desc->skb); 
    623623                desc->skb = NULL; 
    624                 if (netif_subqueue_stopped(dev, queue)) 
     624                if (__netif_subqueue_stopped(dev, queue)) 
    625625                        netif_wake_subqueue(dev, queue); 
    626626        } else { 
    627627                if (netif_msg_tx_err(priv) && net_ratelimit()) 
    628628                        printk(KERN_WARNING 
    629629                               "%s: end_xmit: spurious interrupt\n", dev->name); 
    630                 if (netif_subqueue_stopped(dev, queue)) 
     630                if (__netif_subqueue_stopped(dev, queue)) 
    631631                        netif_wake_subqueue(dev, queue); 
    632632        } 
    633633} 
     
    737737 
    738738static void cpmac_hw_error(struct work_struct *work) 
    739739{ 
    740         int i; 
    741740        struct cpmac_priv *priv = 
    742741                container_of(work, struct cpmac_priv, reset_work); 
    743742 
     
    824823 
    825824static void cpmac_tx_timeout(struct net_device *dev) 
    826825{ 
    827         int i; 
    828826        struct cpmac_priv *priv = netdev_priv(dev); 
    829827 
    830828        spin_lock(&priv->lock); 
     
    11031101 
    11041102static int __devinit cpmac_probe(struct platform_device *pdev) 
    11051103{ 
    1106         int rc, phy_id, i; 
     1104        int rc, phy_id; 
    11071105        char *mdio_bus_id = "0"; 
    11081106        struct resource *mem; 
    11091107        struct cpmac_priv *priv; 
     
    11321130        } 
    11331131 
    11341132        dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES); 
     1133        //~ dev = alloc_etherdev(sizeof(*priv)); 
    11351134 
    11361135        if (!dev) { 
    11371136                printk(KERN_ERR "cpmac: Unable to allocate net_device\n");