Allegato "r8168-8.005.00.hardy.diff.txt"
Scarica 1 diff -c ./r8168.h ../../r8168-8.005.00.new/src/r8168.h
2 *** ./r8168.h 2008-01-09 05:27:22.000000000 -0800
3 --- ../../r8168-8.005.00.new/src/r8168.h 2008-04-14 15:20:55.000000000 -0700
4 ***************
5 *** 942,947 ****
6 --- 942,948 ----
7 void __iomem *mmio_addr; /* memory map physical address */
8 struct pci_dev *pci_dev; /* Index of PCI device */
9 struct net_device *dev;
10 + struct napi_struct napi;
11 struct net_device_stats stats; /* statistics of net device */
12 spinlock_t lock; /* spin lock flag */
13 spinlock_t phy_lock; /* spin lock flag for GPHY */
14 diff -c ./r8168_n.c ../../r8168-8.005.00.new/src/r8168_n.c
15 *** ./r8168_n.c 2008-01-09 05:28:01.000000000 -0800
16 --- ../../r8168-8.005.00.new/src/r8168_n.c 2008-04-14 15:30:02.000000000 -0700
17 ***************
18 *** 168,174 ****
19 static void rtl8168_set_rx_mode(struct net_device *dev);
20 static void rtl8168_tx_timeout(struct net_device *dev);
21 static struct net_device_stats *rtl8168_get_stats(struct net_device *dev);
22 ! static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, void __iomem *);
23 static int rtl8168_change_mtu(struct net_device *dev, int new_mtu);
24 static void rtl8168_down(struct net_device *dev);
25
26 --- 168,174 ----
27 static void rtl8168_set_rx_mode(struct net_device *dev);
28 static void rtl8168_tx_timeout(struct net_device *dev);
29 static struct net_device_stats *rtl8168_get_stats(struct net_device *dev);
30 ! static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, void __iomem *, u32 budget);
31 static int rtl8168_change_mtu(struct net_device *dev, int new_mtu);
32 static void rtl8168_down(struct net_device *dev);
33
34 ***************
35 *** 184,190 ****
36
37
38 #ifdef CONFIG_R8168_NAPI
39 ! static int rtl8168_poll(struct net_device *dev, int *budget);
40 #endif
41
42 static u16 rtl8168_intr_mask =
43 --- 184,190 ----
44
45
46 #ifdef CONFIG_R8168_NAPI
47 ! static int rtl8168_poll(struct napi_struct *napi, int budget);
48 #endif
49
50 static u16 rtl8168_intr_mask =
51 ***************
52 *** 2266,2273 ****
53 #endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
54 goto err_out;
55 }
56 !
57 ! SET_MODULE_OWNER(dev);
58 SET_NETDEV_DEV(dev, &pdev->dev);
59 tp = netdev_priv(dev);
60 tp->dev = dev;
61 --- 2266,2274 ----
62 #endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
63 goto err_out;
64 }
65 ! #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) && defined(SET_MODULE_OWNER)
66 ! SET_MODULE_OWNER(dev);
67 ! #endif
68 SET_NETDEV_DEV(dev, &pdev->dev);
69 tp = netdev_priv(dev);
70 tp->dev = dev;
71 ***************
72 *** 2567,2574 ****
73 dev->do_ioctl = rtl8168_do_ioctl;
74
75 #ifdef CONFIG_R8168_NAPI
76 ! dev->poll = rtl8168_poll;
77 ! dev->weight = R8168_NAPI_WEIGHT;
78 #endif
79
80 #ifdef CONFIG_R8168_VLAN
81 --- 2568,2576 ----
82 dev->do_ioctl = rtl8168_do_ioctl;
83
84 #ifdef CONFIG_R8168_NAPI
85 ! /* dev->poll = rtl8168_poll; */
86 ! /* dev->weight = R8168_NAPI_WEIGHT; */
87 ! netif_napi_add(dev, &tp->napi, rtl8168_poll, R8168_NAPI_WEIGHT);
88 #endif
89
90 #ifdef CONFIG_R8168_VLAN
91 ***************
92 *** 2699,2704 ****
93 --- 2701,2708 ----
94 INIT_DELAYED_WORK(&tp->task, NULL);
95 #endif
96
97 + napi_enable(&tp->napi);
98 +
99 rtl8168_hw_start(dev);
100
101 if (tp->esd_flag == 0) {
102 ***************
103 *** 3073,3081 ****
104 goto out;
105
106 #ifdef NAPI
107 ! netif_poll_enable(dev);
108 #endif
109 !
110 rtl8168_hw_start(dev);
111
112 out:
113 --- 3077,3085 ----
114 goto out;
115
116 #ifdef NAPI
117 ! /* netif_poll_enable(dev);*/
118 #endif
119 ! napi_enable(&tp->napi);
120 rtl8168_hw_start(dev);
121
122 out:
123 ***************
124 *** 3328,3341 ****
125
126 /* Wait for any pending NAPI task to complete */
127 #ifdef NAPI
128 ! netif_poll_disable(dev);
129 #endif
130 !
131 rtl8168_irq_mask_and_ack(ioaddr);
132
133 #ifdef NAPI
134 ! netif_poll_enable(dev);
135 #endif
136 }
137
138 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
139 --- 3332,3346 ----
140
141 /* Wait for any pending NAPI task to complete */
142 #ifdef NAPI
143 ! /* netif_poll_disable(dev);*/
144 #endif
145 ! napi_disable(&tp->napi);
146 rtl8168_irq_mask_and_ack(ioaddr);
147
148 #ifdef NAPI
149 ! /* netif_poll_enable(dev);*/
150 #endif
151 + napi_enable(&tp->napi);
152 }
153
154 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
155 ***************
156 *** 3391,3397 ****
157
158 rtl8168_wait_for_quiescence(dev);
159
160 ! rtl8168_rx_interrupt(dev, tp, tp->mmio_addr);
161 rtl8168_tx_clear(tp);
162
163 if (tp->dirty_rx == tp->cur_rx) {
164 --- 3396,3402 ----
165
166 rtl8168_wait_for_quiescence(dev);
167
168 ! rtl8168_rx_interrupt(dev, tp, tp->mmio_addr, ~(u32)0);
169 rtl8168_tx_clear(tp);
170
171 if (tp->dirty_rx == tp->cur_rx) {
172 ***************
173 *** 3776,3782 ****
174 static int
175 rtl8168_rx_interrupt(struct net_device *dev,
176 struct rtl8168_private *tp,
177 ! void __iomem *ioaddr)
178 {
179 unsigned int cur_rx, rx_left;
180 unsigned int delta, count = 0;
181 --- 3781,3788 ----
182 static int
183 rtl8168_rx_interrupt(struct net_device *dev,
184 struct rtl8168_private *tp,
185 ! void __iomem *ioaddr,
186 ! u32 budget)
187 {
188 unsigned int cur_rx, rx_left;
189 unsigned int delta, count = 0;
190 ***************
191 *** 3787,3793 ****
192
193 cur_rx = tp->cur_rx;
194 rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx;
195 ! rx_left = rtl8168_rx_quota(rx_left, (u32) dev->quota);
196
197 if ((tp->RxDescArray == NULL) || (tp->Rx_skbuff == NULL)) {
198 goto rx_out;
199 --- 3793,3799 ----
200
201 cur_rx = tp->cur_rx;
202 rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx;
203 ! rx_left = rtl8168_rx_quota(rx_left, budget);
204
205 if ((tp->RxDescArray == NULL) || (tp->Rx_skbuff == NULL)) {
206 goto rx_out;
207 ***************
208 *** 3983,3990 ****
209 RTL_W16(IntrMask, rtl8168_intr_mask & ~rtl8168_napi_event);
210 tp->intr_mask = ~rtl8168_napi_event;
211
212 ! if (likely(netif_rx_schedule_prep(dev)))
213 __netif_rx_schedule(dev);
214 else if (netif_msg_intr(tp)) {
215 printk(KERN_INFO "%s: interrupt %04x taken in poll\n",
216 dev->name, status);
217 --- 3989,3999 ----
218 RTL_W16(IntrMask, rtl8168_intr_mask & ~rtl8168_napi_event);
219 tp->intr_mask = ~rtl8168_napi_event;
220
221 ! /* if (likely(netif_rx_schedule_prep(dev)))
222 __netif_rx_schedule(dev);
223 + */
224 + if (likely(netif_rx_schedule_prep(dev, &tp->napi)))
225 + __netif_rx_schedule(dev, &tp->napi);
226 else if (netif_msg_intr(tp)) {
227 printk(KERN_INFO "%s: interrupt %04x taken in poll\n",
228 dev->name, status);
229 ***************
230 *** 3993,3999 ****
231 #else
232 /* Rx interrupt */
233 if (status & (RxOK | RxDescUnavail | RxFIFOOver)) {
234 ! rtl8168_rx_interrupt(dev, tp, ioaddr);
235 }
236 /* Tx interrupt */
237 if (status & (TxOK | TxErr))
238 --- 4002,4008 ----
239 #else
240 /* Rx interrupt */
241 if (status & (RxOK | RxDescUnavail | RxFIFOOver)) {
242 ! rtl8168_rx_interrupt(dev, tp, ioaddr, ~(u32)0);
243 }
244 /* Tx interrupt */
245 if (status & (TxOK | TxErr))
246 ***************
247 *** 4029,4049 ****
248
249 #ifdef CONFIG_R8168_NAPI
250 static int
251 ! rtl8168_poll(struct net_device *dev,
252 ! int *budget)
253 {
254 ! unsigned int work_done, work_to_do = min(*budget, dev->quota);
255 struct rtl8168_private *tp = netdev_priv(dev);
256 void __iomem *ioaddr = tp->mmio_addr;
257
258 ! work_done = rtl8168_rx_interrupt(dev, tp, ioaddr);
259 rtl8168_tx_interrupt(dev, tp, ioaddr);
260
261 ! *budget -= work_done;
262 dev->quota -= work_done;
263
264 ! if (work_done < work_to_do) {
265 ! netif_rx_complete(dev);
266 tp->intr_mask = rtl8168_intr_mask;
267 /*
268 * 20040426: the barrier is not strictly required but the
269 --- 4038,4063 ----
270
271 #ifdef CONFIG_R8168_NAPI
272 static int
273 ! rtl8168_poll(struct napi_struct *napi,
274 ! int budget)
275 {
276 ! /* unsigned int work_done, work_to_do = min(*budget, dev->quota);
277 struct rtl8168_private *tp = netdev_priv(dev);
278 + */
279 + struct rtl8168_private *tp = container_of(napi, struct rtl8168_private, napi);
280 + struct net_device *dev = tp->dev;
281 void __iomem *ioaddr = tp->mmio_addr;
282 + int work_done;
283
284 ! work_done = rtl8168_rx_interrupt(dev, tp, ioaddr, (u32) budget);
285 rtl8168_tx_interrupt(dev, tp, ioaddr);
286
287 ! /* *budget -= work_done;
288 dev->quota -= work_done;
289 + */
290
291 ! if (work_done < budget) {
292 ! netif_rx_complete(dev, napi);
293 tp->intr_mask = rtl8168_intr_mask;
294 /*
295 * 20040426: the barrier is not strictly required but the
296 ***************
297 *** 4055,4061 ****
298 RTL_W16(IntrMask, rtl8168_intr_mask);
299 }
300
301 ! return (work_done >= work_to_do);
302 }
303 #endif
304
305 --- 4069,4075 ----
306 RTL_W16(IntrMask, rtl8168_intr_mask);
307 }
308
309 ! return work_done;
310 }
311 #endif
312
313 ***************
314 *** 4083,4090 ****
315
316 if (!poll_locked) {
317 #ifdef NAPI
318 ! netif_poll_disable(dev);
319 #endif
320 poll_locked++;
321 }
322
323 --- 4097,4105 ----
324
325 if (!poll_locked) {
326 #ifdef NAPI
327 ! /* netif_poll_disable(dev);*/
328 #endif
329 + napi_disable(&tp->napi);
330 poll_locked++;
331 }
332
333 ***************
334 *** 4123,4129 ****
335 free_irq(dev->irq, dev);
336
337 #ifdef NAPI
338 ! netif_poll_enable(dev);
339 #endif
340
341 pci_free_consistent(pdev, R8168_RX_RING_BYTES, tp->RxDescArray,
342 --- 4138,4144 ----
343 free_irq(dev->irq, dev);
344
345 #ifdef NAPI
346 ! /* netif_poll_enable(dev);*/
347 #endif
348
349 pci_free_consistent(pdev, R8168_RX_RING_BYTES, tp->RxDescArray,
Allegati
Per riferirsi agli allegati di una pagina, usare attachment:NOME_FILE, come mostrato qui sotto nell'elenco degli allegati. NON usare l'URL che si trova in corrispondenza del collegamento [scarica], potrebbe cambiare in futuro.Non รจ consentito inserire allegati su questa pagina.