locking rework, drop non-napi rx, multiqueue tx, misc cleanups
[openwrt.git] / target / linux / brcm47xx / patches-2.6.22 / 200-b44_ssb_fixup.patch
1 Index: linux-2.6.22-rc4/drivers/net/b44.c
2 ===================================================================
3 --- linux-2.6.22-rc4.orig/drivers/net/b44.c 2007-06-10 21:33:15.000000000 +0100
4 +++ linux-2.6.22-rc4/drivers/net/b44.c 2007-06-10 21:33:23.000000000 +0100
5 @@ -128,7 +128,7 @@
6 unsigned long offset,
7 enum dma_data_direction dir)
8 {
9 - dma_sync_single_range_for_device(&sdev->dev, dma_base,
10 + dma_sync_single_range_for_device(sdev->dev, dma_base,
11 offset & dma_desc_align_mask,
12 dma_desc_sync_size, dir);
13 }
14 @@ -138,7 +138,7 @@
15 unsigned long offset,
16 enum dma_data_direction dir)
17 {
18 - dma_sync_single_range_for_cpu(&sdev->dev, dma_base,
19 + dma_sync_single_range_for_cpu(sdev->dev, dma_base,
20 offset & dma_desc_align_mask,
21 dma_desc_sync_size, dir);
22 }
23 @@ -563,7 +563,7 @@
24
25 BUG_ON(skb == NULL);
26
27 - dma_unmap_single(&bp->sdev->dev,
28 + dma_unmap_single(bp->sdev->dev,
29 pci_unmap_addr(rp, mapping),
30 skb->len,
31 DMA_TO_DEVICE);
32 @@ -603,7 +603,7 @@
33 if (skb == NULL)
34 return -ENOMEM;
35
36 - mapping = dma_map_single(&bp->sdev->dev, skb->data,
37 + mapping = dma_map_single(bp->sdev->dev, skb->data,
38 RX_PKT_BUF_SZ,
39 DMA_FROM_DEVICE);
40
41 @@ -613,18 +613,18 @@
42 mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) {
43 /* Sigh... */
44 if (!dma_mapping_error(mapping))
45 - dma_unmap_single(&bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
46 + dma_unmap_single(bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
47 dev_kfree_skb_any(skb);
48 skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA);
49 if (skb == NULL)
50 return -ENOMEM;
51 - mapping = dma_map_single(&bp->sdev->dev, skb->data,
52 + mapping = dma_map_single(bp->sdev->dev, skb->data,
53 RX_PKT_BUF_SZ,
54 DMA_FROM_DEVICE);
55 if (dma_mapping_error(mapping) ||
56 mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) {
57 if (!dma_mapping_error(mapping))
58 - dma_unmap_single(&bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
59 + dma_unmap_single(bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
60 dev_kfree_skb_any(skb);
61 return -ENOMEM;
62 }
63 @@ -702,7 +702,7 @@
64 dest_idx * sizeof(dest_desc),
65 DMA_BIDIRECTIONAL);
66
67 - dma_sync_single_for_device(&bp->sdev->dev, le32_to_cpu(src_desc->addr),
68 + dma_sync_single_for_device(bp->sdev->dev, le32_to_cpu(src_desc->addr),
69 RX_PKT_BUF_SZ,
70 DMA_FROM_DEVICE);
71 }
72 @@ -724,7 +724,7 @@
73 struct rx_header *rh;
74 u16 len;
75
76 - dma_sync_single_for_cpu(&bp->sdev->dev, map,
77 + dma_sync_single_for_cpu(bp->sdev->dev, map,
78 RX_PKT_BUF_SZ,
79 DMA_FROM_DEVICE);
80 rh = (struct rx_header *) skb->data;
81 @@ -758,7 +758,7 @@
82 skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod);
83 if (skb_size < 0)
84 goto drop_it;
85 - dma_unmap_single(&bp->sdev->dev, map,
86 + dma_unmap_single(bp->sdev->dev, map,
87 skb_size, DMA_FROM_DEVICE);
88 /* Leave out rx_header */
89 skb_put(skb, len+bp->rx_offset);
90 @@ -931,22 +931,22 @@
91 goto err_out;
92 }
93
94 - mapping = dma_map_single(&bp->sdev->dev, skb->data, len, DMA_TO_DEVICE);
95 + mapping = dma_map_single(bp->sdev->dev, skb->data, len, DMA_TO_DEVICE);
96 if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) {
97 /* Chip can't handle DMA to/from >1GB, use bounce buffer */
98 if (!dma_mapping_error(mapping))
99 - dma_unmap_single(&bp->sdev->dev, mapping, len, DMA_TO_DEVICE);
100 + dma_unmap_single(bp->sdev->dev, mapping, len, DMA_TO_DEVICE);
101
102 bounce_skb = __dev_alloc_skb(TX_PKT_BUF_SZ,
103 GFP_ATOMIC|GFP_DMA);
104 if (!bounce_skb)
105 goto err_out;
106
107 - mapping = dma_map_single(&bp->sdev->dev, bounce_skb->data,
108 + mapping = dma_map_single(bp->sdev->dev, bounce_skb->data,
109 len, DMA_TO_DEVICE);
110 if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) {
111 if (!dma_mapping_error(mapping))
112 - dma_unmap_single(&bp->sdev->dev, mapping,
113 + dma_unmap_single(bp->sdev->dev, mapping,
114 len, DMA_TO_DEVICE);
115 dev_kfree_skb_any(bounce_skb);
116 goto err_out;
117 @@ -1046,7 +1046,7 @@
118
119 if (rp->skb == NULL)
120 continue;
121 - dma_unmap_single(&bp->sdev->dev,
122 + dma_unmap_single(bp->sdev->dev,
123 pci_unmap_addr(rp, mapping),
124 RX_PKT_BUF_SZ,
125 DMA_FROM_DEVICE);
126 @@ -1060,7 +1060,7 @@
127
128 if (rp->skb == NULL)
129 continue;
130 - dma_unmap_single(&bp->sdev->dev,
131 + dma_unmap_single(bp->sdev->dev,
132 pci_unmap_addr(rp, mapping),
133 rp->skb->len,
134 DMA_TO_DEVICE);
135 @@ -1085,12 +1085,12 @@
136 memset(bp->tx_ring, 0, B44_TX_RING_BYTES);
137
138 if (bp->flags & B44_FLAG_RX_RING_HACK)
139 - dma_sync_single_for_device(&bp->sdev->dev, bp->rx_ring_dma,
140 + dma_sync_single_for_device(bp->sdev->dev, bp->rx_ring_dma,
141 DMA_TABLE_BYTES,
142 DMA_BIDIRECTIONAL);
143
144 if (bp->flags & B44_FLAG_TX_RING_HACK)
145 - dma_sync_single_for_device(&bp->sdev->dev, bp->tx_ring_dma,
146 + dma_sync_single_for_device(bp->sdev->dev, bp->tx_ring_dma,
147 DMA_TABLE_BYTES,
148 DMA_TO_DEVICE);
149
150 @@ -1112,24 +1112,24 @@
151 bp->tx_buffers = NULL;
152 if (bp->rx_ring) {
153 if (bp->flags & B44_FLAG_RX_RING_HACK) {
154 - dma_unmap_single(&bp->sdev->dev, bp->rx_ring_dma,
155 + dma_unmap_single(bp->sdev->dev, bp->rx_ring_dma,
156 DMA_TABLE_BYTES,
157 DMA_BIDIRECTIONAL);
158 kfree(bp->rx_ring);
159 } else
160 - dma_free_coherent(&bp->sdev->dev, DMA_TABLE_BYTES,
161 + dma_free_coherent(bp->sdev->dev, DMA_TABLE_BYTES,
162 bp->rx_ring, bp->rx_ring_dma);
163 bp->rx_ring = NULL;
164 bp->flags &= ~B44_FLAG_RX_RING_HACK;
165 }
166 if (bp->tx_ring) {
167 if (bp->flags & B44_FLAG_TX_RING_HACK) {
168 - dma_unmap_single(&bp->sdev->dev, bp->tx_ring_dma,
169 + dma_unmap_single(bp->sdev->dev, bp->tx_ring_dma,
170 DMA_TABLE_BYTES,
171 DMA_TO_DEVICE);
172 kfree(bp->tx_ring);
173 } else
174 - dma_free_coherent(&bp->sdev->dev, DMA_TABLE_BYTES,
175 + dma_free_coherent(bp->sdev->dev, DMA_TABLE_BYTES,
176 bp->tx_ring, bp->tx_ring_dma);
177 bp->tx_ring = NULL;
178 bp->flags &= ~B44_FLAG_TX_RING_HACK;
179 @@ -1155,7 +1155,7 @@
180 goto out_err;
181
182 size = DMA_TABLE_BYTES;
183 - bp->rx_ring = dma_alloc_coherent(&bp->sdev->dev, size, &bp->rx_ring_dma, GFP_ATOMIC);
184 + bp->rx_ring = dma_alloc_coherent(bp->sdev->dev, size, &bp->rx_ring_dma, GFP_ATOMIC);
185 if (!bp->rx_ring) {
186 /* Allocation may have failed due to pci_alloc_consistent
187 insisting on use of GFP_DMA, which is more restrictive
188 @@ -1167,7 +1167,7 @@
189 if (!rx_ring)
190 goto out_err;
191
192 - rx_ring_dma = dma_map_single(&bp->sdev->dev, rx_ring,
193 + rx_ring_dma = dma_map_single(bp->sdev->dev, rx_ring,
194 DMA_TABLE_BYTES,
195 DMA_BIDIRECTIONAL);
196
197 @@ -1182,7 +1182,7 @@
198 bp->flags |= B44_FLAG_RX_RING_HACK;
199 }
200
201 - bp->tx_ring = dma_alloc_coherent(&bp->sdev->dev, size, &bp->tx_ring_dma, GFP_ATOMIC);
202 + bp->tx_ring = dma_alloc_coherent(bp->sdev->dev, size, &bp->tx_ring_dma, GFP_ATOMIC);
203 if (!bp->tx_ring) {
204 /* Allocation may have failed due to dma_alloc_coherent
205 insisting on use of GFP_DMA, which is more restrictive
206 @@ -1194,7 +1194,7 @@
207 if (!tx_ring)
208 goto out_err;
209
210 - tx_ring_dma = dma_map_single(&bp->sdev->dev, tx_ring,
211 + tx_ring_dma = dma_map_single(bp->sdev->dev, tx_ring,
212 DMA_TABLE_BYTES,
213 DMA_TO_DEVICE);
214
215 @@ -2314,13 +2314,13 @@
216
217 dev = alloc_etherdev(sizeof(*bp));
218 if (!dev) {
219 - dev_err(&sdev->dev, "Etherdev alloc failed, aborting.\n");
220 + dev_err(sdev->dev, "Etherdev alloc failed, aborting.\n");
221 err = -ENOMEM;
222 goto out;
223 }
224
225 SET_MODULE_OWNER(dev);
226 - SET_NETDEV_DEV(dev,&sdev->dev);
227 + SET_NETDEV_DEV(dev,sdev->dev);
228
229 /* No interesting netdevice features in this card... */
230 dev->features |= 0;
231 @@ -2358,7 +2358,7 @@
232
233 err = b44_get_invariants(bp);
234 if (err) {
235 - dev_err(&sdev->dev,
236 + dev_err(sdev->dev,
237 "Problem fetching invariants of chip, aborting.\n");
238 goto err_out_free_dev;
239 }
240 @@ -2379,7 +2379,7 @@
241
242 err = register_netdev(dev);
243 if (err) {
244 - dev_err(&sdev->dev, "Cannot register net device, aborting.\n");
245 + dev_err(sdev->dev, "Cannot register net device, aborting.\n");
246 goto out;
247 }
248
249 @@ -2458,7 +2458,6 @@
250 rc = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev);
251 if (rc) {
252 printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name);
253 - pci_disable_device(pdev);
254 return rc;
255 }
256
This page took 0.058314 seconds and 5 git commands to generate.