1 This patch fixes the network driver cpmac.c for compilation with
2 configuration option CONFIG_NETDEVICES_MULTIQUEUE.
4 These compiler warnings are fixed by the patch:
5 drivers/net/cpmac.c: In function 'cpmac_end_xmit':
6 drivers/net/cpmac.c:630: warning: passing argument 2 of 'netif_subqueue_stopped' makes pointer from integer without a cast
7 drivers/net/cpmac.c:641: warning: passing argument 2 of 'netif_subqueue_stopped' makes pointer from integer without a cast
8 drivers/net/cpmac.c: In function 'cpmac_probe':
9 drivers/net/cpmac.c:1128: warning: unused variable 'i'
11 During runtime, the unpatched driver raises a fatal runtime exception.
12 This is fixed by calling __netif_subqueue_stopped instead
13 of netif_subqueue_stopped, too.
15 Two additional code parts were modified for CONFIG_NETDEVICES_MULTIQUEUE
16 because other drivers do it in the same way.
18 Signed-off-by: Stefan Weil <weil@mail.berlios.de>
20 --- a/drivers/net/cpmac.c
21 +++ b/drivers/net/cpmac.c
23 dev_kfree_skb_irq(desc->skb);
25 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
26 - if (netif_subqueue_stopped(dev, queue))
27 + if (__netif_subqueue_stopped(dev, queue))
28 netif_wake_subqueue(dev, queue);
30 if (netif_queue_stopped(dev))
33 "%s: end_xmit: spurious interrupt\n", dev->name);
34 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
35 - if (netif_subqueue_stopped(dev, queue))
36 + if (__netif_subqueue_stopped(dev, queue))
37 netif_wake_subqueue(dev, queue);
39 if (netif_queue_stopped(dev))
42 static int __devinit cpmac_probe(struct platform_device *pdev)
46 char *mdio_bus_id = "0";
48 struct cpmac_priv *priv;
49 @@ -1152,7 +1152,11 @@
53 +#ifdef CONFIG_NETDEVICES_MULTIQUEUE
54 dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
56 + dev = alloc_etherdev(sizeof(*priv));
60 printk(KERN_ERR "cpmac: Unable to allocate net_device\n");
62 dev->set_multicast_list = cpmac_set_multicast_list;
63 dev->tx_timeout = cpmac_tx_timeout;
64 dev->ethtool_ops = &cpmac_ethtool_ops;
65 +#ifdef CONFIG_NETDEVICES_MULTIQUEUE
66 dev->features |= NETIF_F_MULTI_QUEUE;
69 netif_napi_add(dev, &priv->napi, cpmac_poll, 64);