moko: Fix 2.6.28 boot.
[openwrt.git] / target / linux / ar7 / patches-2.6.26 / 900-cpmac_multiqueue.patch
1 This patch fixes the network driver cpmac.c for compilation with
2 configuration option CONFIG_NETDEVICES_MULTIQUEUE.
3
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'
10
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.
14
15 Two additional code parts were modified for CONFIG_NETDEVICES_MULTIQUEUE
16 because other drivers do it in the same way.
17
18 Signed-off-by: Stefan Weil <weil@mail.berlios.de>
19
20 --- a/drivers/net/cpmac.c
21 +++ b/drivers/net/cpmac.c
22 @@ -627,7 +627,7 @@ static void cpmac_end_xmit(struct net_de
23 dev_kfree_skb_irq(desc->skb);
24 desc->skb = NULL;
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);
29 #else
30 if (netif_queue_stopped(dev))
31 @@ -638,7 +638,7 @@ static void cpmac_end_xmit(struct net_de
32 printk(KERN_WARNING
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);
38 #else
39 if (netif_queue_stopped(dev))
40 @@ -1124,7 +1124,7 @@ static int external_switch;
41
42 static int __devinit cpmac_probe(struct platform_device *pdev)
43 {
44 - int rc, phy_id, i;
45 + int rc, phy_id;
46 char *mdio_bus_id = "0";
47 struct resource *mem;
48 struct cpmac_priv *priv;
49 @@ -1152,7 +1152,11 @@ static int __devinit cpmac_probe(struct
50 }
51 }
52
53 +#ifdef CONFIG_NETDEVICES_MULTIQUEUE
54 dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
55 +#else
56 + dev = alloc_etherdev(sizeof(*priv));
57 +#endif
58
59 if (!dev) {
60 printk(KERN_ERR "cpmac: Unable to allocate net_device\n");
61 @@ -1179,7 +1183,9 @@ static int __devinit cpmac_probe(struct
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;
67 +#endif
68
69 netif_napi_add(dev, &priv->napi, cpmac_poll, 64);
70
This page took 0.042943 seconds and 5 git commands to generate.