refresh madwifi patches, fix an issue with napi polling (thx SeG)
[openwrt.git] / package / madwifi / patches / 300-napi_polling.patch
1 Index: madwifi-trunk-r3314/ath/if_ath.c
2 ===================================================================
3 --- madwifi-trunk-r3314.orig/ath/if_ath.c       2008-02-20 21:56:33.725243076 +0100
4 +++ madwifi-trunk-r3314/ath/if_ath.c    2008-02-20 21:57:34.912729951 +0100
5 @@ -184,7 +184,11 @@
6         struct sk_buff *, int, int, u_int64_t);
7  static void ath_setdefantenna(struct ath_softc *, u_int);
8  static struct ath_txq *ath_txq_setup(struct ath_softc *, int, int);
9 -static void ath_rx_tasklet(TQUEUE_ARG);
10 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
11 +static int ath_rx_poll(struct napi_struct *napi, int budget);
12 +#else
13 +static int ath_rx_poll(struct net_device *dev, int *budget);
14 +#endif
15  static int ath_hardstart(struct sk_buff *, struct net_device *);
16  static int ath_mgtstart(struct ieee80211com *, struct sk_buff *);
17  #ifdef ATH_SUPERG_COMP
18 @@ -374,6 +378,9 @@
19                 u_int32_t new_clamped_maxtxpower);
20  static u_int32_t ath_get_real_maxtxpower(struct ath_softc *sc);
21  
22 +static void ath_poll_disable(struct net_device *dev);
23 +static void ath_poll_enable(struct net_device *dev);
24 +
25  /* calibrate every 30 secs in steady state but check every second at first. */
26  static int ath_calinterval = ATH_SHORT_CALINTERVAL;
27  static int ath_countrycode = CTRY_DEFAULT;     /* country code */
28 @@ -545,7 +552,6 @@
29  
30         atomic_set(&sc->sc_txbuf_counter, 0);
31  
32 -       ATH_INIT_TQUEUE(&sc->sc_rxtq,     ath_rx_tasklet,       dev);
33         ATH_INIT_TQUEUE(&sc->sc_txtq,     ath_tx_tasklet,       dev);
34         ATH_INIT_TQUEUE(&sc->sc_bmisstq,  ath_bmiss_tasklet,    dev);
35         ATH_INIT_TQUEUE(&sc->sc_bstucktq, ath_bstuck_tasklet,   dev);
36 @@ -819,6 +825,12 @@
37         dev->set_mac_address = ath_set_mac_address;
38         dev->change_mtu = ath_change_mtu;
39         dev->tx_queue_len = ATH_TXBUF - ATH_TXBUF_MGT_RESERVED;
40 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
41 +       netif_napi_add(dev, &sc->sc_napi, ath_rx_poll, 64);
42 +#else
43 +       dev->poll = ath_rx_poll;
44 +       dev->weight = 64;
45 +#endif
46  #ifdef USE_HEADERLEN_RESV
47         dev->hard_header_len += sizeof(struct ieee80211_qosframe) +
48                                 sizeof(struct llc) +
49 @@ -2213,6 +2225,7 @@
50                 (status & HAL_INT_GLOBAL)       ? " HAL_INT_GLOBAL"     : ""
51                 );
52  
53 +       sc->sc_isr = status;
54         status &= sc->sc_imask;                 /* discard unasked for bits */
55         /* As soon as we know we have a real interrupt we intend to service, 
56          * we will check to see if we need an initial hardware TSF reading. 
57 @@ -2270,7 +2283,23 @@
58                 }
59                 if (status & (HAL_INT_RX | HAL_INT_RXPHY)) {
60                         ath_uapsd_processtriggers(sc, hw_tsf);
61 -                       ATH_SCHEDULE_TQUEUE(&sc->sc_rxtq, &needmark);
62 +                       sc->sc_isr &= ~HAL_INT_RX;
63 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
64 +                       if (netif_rx_schedule_prep(dev, &sc->sc_napi))
65 +#else
66 +                       if (netif_rx_schedule_prep(dev))
67 +#endif
68 +                       {
69 +#ifndef ATH_PRECISE_TSF
70 +                               sc->sc_imask &= ~HAL_INT_RX;
71 +                               ath_hal_intrset(ah, sc->sc_imask);
72 +#endif
73 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
74 +                               __netif_rx_schedule(dev, &sc->sc_napi);
75 +#else
76 +                               __netif_rx_schedule(dev);
77 +#endif
78 +                       }
79                 }
80                 if (status & HAL_INT_TX) {
81  #ifdef ATH_SUPERG_DYNTURBO
82 @@ -2296,6 +2325,11 @@
83                                 }
84                         }
85  #endif
86 +                       /* disable transmit interrupt */
87 +                       sc->sc_isr &= ~HAL_INT_TX;
88 +                       ath_hal_intrset(ah, sc->sc_imask & ~HAL_INT_TX);
89 +                       sc->sc_imask &= ~HAL_INT_TX;
90 +
91                         ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, &needmark);
92                 }
93                 if (status & HAL_INT_BMISS) {
94 @@ -2508,6 +2542,7 @@
95         if (sc->sc_tx99 != NULL)
96                 sc->sc_tx99->start(sc->sc_tx99);
97  #endif
98 +       ath_poll_enable(dev);
99  
100  done:
101         ATH_UNLOCK(sc);
102 @@ -2548,6 +2583,9 @@
103                 if (sc->sc_tx99 != NULL)
104                         sc->sc_tx99->stop(sc->sc_tx99);
105  #endif
106 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
107 +               ath_poll_disable(dev);
108 +#endif
109                 netif_stop_queue(dev);  /* XXX re-enabled by ath_newstate */
110                 dev->flags &= ~IFF_RUNNING;     /* NB: avoid recursion */
111                 ieee80211_stop_running(ic);     /* stop all VAPs */
112 @@ -4006,6 +4044,39 @@
113         return ath_keyset(sc, k, mac, vap->iv_bss);
114  }
115  
116 +static void ath_poll_disable(struct net_device *dev)
117 +{
118 +       struct ath_softc *sc = dev->priv;
119 +
120 +       /*
121 +        * XXX Using in_softirq is not right since we might
122 +        * be called from other soft irq contexts than
123 +        * ath_rx_poll
124 +        */
125 +       if (!in_softirq()) {
126 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
127 +               napi_disable(&sc->sc_napi);
128 +#else
129 +               netif_poll_disable(dev);
130 +#endif
131 +       }
132 +}
133 +
134 +static void ath_poll_enable(struct net_device *dev)
135 +{
136 +       struct ath_softc *sc = dev->priv;
137 +
138 +       /* NB: see above */
139 +       if (!in_softirq()) {
140 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
141 +               napi_enable(&sc->sc_napi);
142 +#else
143 +               netif_poll_enable(dev);
144 +#endif
145 +       }
146 +}
147 +
148 +
149  /*
150   * Block/unblock tx+rx processing while a key change is done.
151   * We assume the caller serializes key management operations
152 @@ -4023,13 +4094,7 @@
153          * When called from the rx tasklet we cannot use
154          * tasklet_disable because it will block waiting
155          * for us to complete execution.
156 -        *
157 -        * XXX Using in_softirq is not right since we might
158 -        * be called from other soft irq contexts than
159 -        * ath_rx_tasklet.
160          */
161 -       if (!in_softirq())
162 -               tasklet_disable(&sc->sc_rxtq);
163         netif_stop_queue(dev);
164  }
165  
166 @@ -4040,9 +4105,9 @@
167         struct ath_softc *sc = dev->priv;
168  
169         DPRINTF(sc, ATH_DEBUG_KEYCACHE, "End\n");
170 -       netif_wake_queue(dev);
171 -       if (!in_softirq())              /* NB: see above */
172 -               tasklet_enable(&sc->sc_rxtq);
173 +
174 +       if (dev->flags&IFF_RUNNING)
175 +               netif_wake_queue(dev);
176  }
177  
178  /*
179 @@ -6347,13 +6412,23 @@
180         sc->sc_rxotherant = 0;
181  }
182  
183 -static void
184 -ath_rx_tasklet(TQUEUE_ARG data)
185 +static int
186 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
187 +ath_rx_poll(struct napi_struct *napi, int budget)
188 +#else
189 +ath_rx_poll(struct net_device *dev, int *budget)
190 +#endif
191  {
192  #define        PA2DESC(_sc, _pa) \
193         ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \
194                 ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr)))
195 -       struct net_device *dev = (struct net_device *)data;
196 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
197 +       struct ath_softc *sc = container_of(napi, struct ath_softc, sc_napi);
198 +       struct net_device *dev = sc->sc_dev;
199 +       u_int rx_limit = budget;
200 +#else
201 +       u_int rx_limit = dev->quota;
202 +#endif
203         struct ath_buf *bf;
204         struct ath_softc *sc = dev->priv;
205         struct ieee80211com *ic = &sc->sc_ic;
206 @@ -6365,8 +6440,10 @@
207         unsigned int len;
208         int type;
209         u_int phyerr;
210 +       u_int processed = 0, early_stop = 0;
211  
212         DPRINTF(sc, ATH_DEBUG_RX_PROC, "invoked\n");
213 +process_rx_again:
214         do {
215                 bf = STAILQ_FIRST(&sc->sc_rxbuf);
216                 if (bf == NULL) {               /* XXX ??? can this happen */
217 @@ -6390,6 +6467,15 @@
218                         /* NB: never process the self-linked entry at the end */
219                         break;
220                 }
221 +
222 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
223 +               processed++;
224 +#endif
225 +               if (rx_limit-- < 0) {
226 +                       early_stop = 1;
227 +                       break;
228 +               }
229 +
230                 skb = bf->bf_skb;
231                 if (skb == NULL) {
232                         EPRINTF(sc, "Dropping; buffer contains NULL skbuff.\n");
233 @@ -6437,6 +6523,7 @@
234                                 sc->sc_stats.ast_rx_phyerr++;
235                                 phyerr = rs->rs_phyerr & 0x1f;
236                                 sc->sc_stats.ast_rx_phy[phyerr]++;
237 +                               goto rx_next;
238                         }
239                         if (rs->rs_status & HAL_RXERR_DECRYPT) {
240                                 /*
241 @@ -6632,9 +6719,38 @@
242                 STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list);
243                 ATH_RXBUF_UNLOCK_IRQ(sc);
244         } while (ath_rxbuf_init(sc, bf) == 0);
245 +       if (!early_stop) {
246 +               unsigned long flags;
247 +               /* Check if more data is received while we were
248 +                * processing the descriptor chain.
249 +                */
250 +#ifndef ATH_PRECISE_TSF
251 +               local_irq_save(flags);
252 +               if (sc->sc_isr & HAL_INT_RX) {
253 +                       u_int64_t hw_tsf = ath_hal_gettsf64(ah);
254 +                       sc->sc_isr &= ~HAL_INT_RX;
255 +                       local_irq_restore(flags);
256 +                       ath_uapsd_processtriggers(sc, hw_tsf);
257 +                       goto process_rx_again;
258 +               }
259 +#endif
260 +#ifndef ATH_PRECISE_TSF
261 +               sc->sc_imask |= HAL_INT_RX;
262 +               ath_hal_intrset(ah, sc->sc_imask);
263 +               local_irq_restore(flags);
264 +#endif
265 +       }
266 +
267 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
268 +       netif_rx_complete(dev, napi);
269 +#else
270 +       netif_rx_complete(dev);
271 +       *budget -= processed;
272 +#endif
273  
274         /* rx signal state monitoring */
275         ath_hal_rxmonitor(ah, &sc->sc_halstats, &sc->sc_curchan);
276 +       return early_stop;
277  #undef PA2DESC
278  }
279  
280 @@ -8285,12 +8401,24 @@
281  {
282         struct net_device *dev = (struct net_device *)data;
283         struct ath_softc *sc = dev->priv;
284 +       unsigned long flags;
285  
286 +process_tx_again:
287         if (txqactive(sc->sc_ah, 0))
288                 ath_tx_processq(sc, &sc->sc_txq[0]);
289         if (txqactive(sc->sc_ah, sc->sc_cabq->axq_qnum))
290                 ath_tx_processq(sc, sc->sc_cabq);
291  
292 +       local_irq_save(flags);
293 +       if (sc->sc_isr & HAL_INT_TX) {
294 +               sc->sc_isr &= ~HAL_INT_TX;
295 +               local_irq_restore(flags);
296 +               goto process_tx_again;
297 +       }
298 +       sc->sc_imask |= HAL_INT_TX;
299 +       ath_hal_intrset(sc->sc_ah, sc->sc_imask);
300 +       local_irq_restore(flags);
301 +
302         netif_wake_queue(dev);
303  
304         if (sc->sc_softled)
305 @@ -8306,7 +8434,9 @@
306  {
307         struct net_device *dev = (struct net_device *)data;
308         struct ath_softc *sc = dev->priv;
309 +       unsigned long flags;
310  
311 +process_tx_again:
312         /*
313          * Process each active queue.
314          */
315 @@ -8327,6 +8457,16 @@
316         if (sc->sc_uapsdq && txqactive(sc->sc_ah, sc->sc_uapsdq->axq_qnum))
317                 ath_tx_processq(sc, sc->sc_uapsdq);
318  
319 +       local_irq_save(flags);
320 +       if (sc->sc_isr & HAL_INT_TX) {
321 +               sc->sc_isr &= ~HAL_INT_TX;
322 +               local_irq_restore(flags);
323 +               goto process_tx_again;
324 +       }
325 +       sc->sc_imask |= HAL_INT_TX;
326 +       ath_hal_intrset(sc->sc_ah, sc->sc_imask);
327 +       local_irq_restore(flags);
328 +
329         netif_wake_queue(dev);
330  
331         if (sc->sc_softled)
332 @@ -8342,13 +8482,25 @@
333         struct net_device *dev = (struct net_device *)data;
334         struct ath_softc *sc = dev->priv;
335         unsigned int i;
336 +       unsigned long flags;
337  
338         /* Process each active queue. This includes sc_cabq, sc_xrtq and
339          * sc_uapsdq */
340 +process_tx_again:
341         for (i = 0; i < HAL_NUM_TX_QUEUES; i++)
342                 if (ATH_TXQ_SETUP(sc, i) && txqactive(sc->sc_ah, i))
343                         ath_tx_processq(sc, &sc->sc_txq[i]);
344  
345 +       local_irq_save(flags);
346 +       if (sc->sc_isr & HAL_INT_TX) {
347 +               sc->sc_isr &= ~HAL_INT_TX;
348 +               local_irq_restore(flags);
349 +               goto process_tx_again;
350 +       }
351 +       sc->sc_imask |= HAL_INT_TX;
352 +       ath_hal_intrset(sc->sc_ah, sc->sc_imask);
353 +       local_irq_restore(flags);
354 +
355         netif_wake_queue(dev);
356  
357         if (sc->sc_softled)
358 @@ -8423,6 +8575,7 @@
359  ath_draintxq(struct ath_softc *sc)
360  {
361         struct ath_hal *ah = sc->sc_ah;
362 +       int npend = 0;
363         unsigned int i;
364  
365         /* XXX return value */
366 @@ -10281,9 +10434,9 @@
367         dev->mtu = mtu;
368         if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) {
369                 /* NB: the rx buffers may need to be reallocated */
370 -               tasklet_disable(&sc->sc_rxtq);
371 +               ath_poll_disable(dev);
372                 error = ath_reset(dev);
373 -               tasklet_enable(&sc->sc_rxtq);
374 +               ath_poll_enable(dev);
375         }
376         ATH_UNLOCK(sc);
377  
378 Index: madwifi-trunk-r3314/ath/if_athvar.h
379 ===================================================================
380 --- madwifi-trunk-r3314.orig/ath/if_athvar.h    2008-02-20 21:56:33.733243528 +0100
381 +++ madwifi-trunk-r3314/ath/if_athvar.h 2008-02-20 21:57:34.892728811 +0100
382 @@ -53,6 +53,10 @@
383  # include      <asm/bitops.h>
384  #endif
385  
386 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
387 +#define irqs_disabled()                        0
388 +#endif
389 +
390  /*
391   * Deduce if tasklets are available.  If not then
392   * fall back to using the immediate work queue.
393 @@ -616,6 +620,9 @@
394  struct ath_softc {
395         struct ieee80211com sc_ic;              /* NB: must be first */
396         struct net_device *sc_dev;
397 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
398 +       struct napi_struct sc_napi;
399 +#endif
400         void __iomem *sc_iobase;                /* address of the device */
401         struct semaphore sc_lock;               /* dev-level lock */
402         struct net_device_stats sc_devstats;    /* device statistics */
403 @@ -730,7 +737,6 @@
404         struct ath_buf *sc_rxbufcur;            /* current rx buffer */
405         u_int32_t *sc_rxlink;                   /* link ptr in last RX desc */
406         spinlock_t sc_rxbuflock;
407 -       struct ATH_TQ_STRUCT sc_rxtq;           /* rx intr tasklet */
408         struct ATH_TQ_STRUCT sc_rxorntq;        /* rxorn intr tasklet */
409         u_int8_t sc_defant;                     /* current default antenna */
410         u_int8_t sc_rxotherant;                 /* RXs on non-default antenna */
411 @@ -745,6 +751,7 @@
412         u_int sc_txintrperiod;                  /* tx interrupt batching */
413         struct ath_txq sc_txq[HAL_NUM_TX_QUEUES];
414         struct ath_txq *sc_ac2q[WME_NUM_AC];    /* WME AC -> h/w qnum */
415 +       HAL_INT sc_isr;                         /* unmasked ISR state */
416         struct ATH_TQ_STRUCT sc_txtq;           /* tx intr tasklet */
417         u_int8_t sc_grppoll_str[GRPPOLL_RATE_STR_LEN];
418         struct ath_descdma sc_bdma;             /* beacon descriptors */
419 @@ -858,6 +865,8 @@
420  #define        ATH_TXBUF_LOCK_CHECK(_sc)
421  #endif
422  
423 +#define ATH_DISABLE_INTR               local_irq_disable
424 +#define ATH_ENABLE_INTR                local_irq_enable
425  
426  #define        ATH_RXBUF_LOCK_INIT(_sc)        spin_lock_init(&(_sc)->sc_rxbuflock)
427  #define        ATH_RXBUF_LOCK_DESTROY(_sc)
428 Index: madwifi-trunk-r3314/net80211/ieee80211_input.c
429 ===================================================================
430 --- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c 2008-02-20 21:56:33.741243986 +0100
431 +++ madwifi-trunk-r3314/net80211/ieee80211_input.c      2008-02-20 21:57:34.896729040 +0100
432 @@ -1198,7 +1198,7 @@
433                         /* attach vlan tag */
434                         struct ieee80211_node *ni_tmp = SKB_CB(skb)->ni;
435                         if (vlan_hwaccel_receive_skb(skb, vap->iv_vlgrp, ni->ni_vlan) == NET_RX_DROP) {
436 -                               /* If netif_rx dropped the packet because 
437 +                               /* If netif_receive_skb dropped the packet because
438                                  * device was too busy */
439                                 if (ni_tmp != NULL) {
440                                         /* node reference was leaked */
441 @@ -1209,8 +1209,8 @@
442                         skb = NULL; /* SKB is no longer ours */
443                 } else {
444                         struct ieee80211_node *ni_tmp = SKB_CB(skb)->ni;
445 -                       if (netif_rx(skb) == NET_RX_DROP) {
446 -                               /* If netif_rx dropped the packet because 
447 +                       if (netif_receive_skb(skb) == NET_RX_DROP) {
448 +                               /* If netif_receive_skb dropped the packet because
449                                  * device was too busy */
450                                 if (ni_tmp != NULL) {
451                                         /* node reference was leaked */
452 @@ -2322,8 +2322,8 @@
453                 skb1->protocol = __constant_htons(0x0019);  /* ETH_P_80211_RAW */
454  
455                 ni_tmp = SKB_CB(skb1)->ni;
456 -               if (netif_rx(skb1) == NET_RX_DROP) {
457 -                       /* If netif_rx dropped the packet because 
458 +               if (netif_receive_skb(skb1) == NET_RX_DROP) {
459 +                       /* If netif_receive_skb dropped the packet because
460                          * device was too busy */
461                         if (ni_tmp != NULL) {
462                                 /* node reference was leaked */
463 Index: madwifi-trunk-r3314/net80211/ieee80211_monitor.c
464 ===================================================================
465 --- madwifi-trunk-r3314.orig/net80211/ieee80211_monitor.c       2008-02-20 21:56:33.749244442 +0100
466 +++ madwifi-trunk-r3314/net80211/ieee80211_monitor.c    2008-02-20 21:57:34.900729266 +0100
467 @@ -584,8 +584,8 @@
468                         skb1->protocol = 
469                                 __constant_htons(0x0019); /* ETH_P_80211_RAW */
470  
471 -                       if (netif_rx(skb1) == NET_RX_DROP) {
472 -                               /* If netif_rx dropped the packet because 
473 +                       if (netif_receive_skb(skb1) == NET_RX_DROP) {
474 +                               /* If netif_receive_skb dropped the packet because
475                                  * device was too busy, reclaim the ref. in 
476                                  * the skb. */
477                                 if (SKB_CB(skb1)->ni != NULL)
478 Index: madwifi-trunk-r3314/net80211/ieee80211_skb.c
479 ===================================================================
480 --- madwifi-trunk-r3314.orig/net80211/ieee80211_skb.c   2008-02-20 21:56:33.757244897 +0100
481 +++ madwifi-trunk-r3314/net80211/ieee80211_skb.c        2008-02-20 21:57:34.904729495 +0100
482 @@ -73,7 +73,7 @@
483  #undef dev_queue_xmit
484  #undef kfree_skb
485  #undef kfree_skb_fast
486 -#undef netif_rx
487 +#undef netif_receive_skb
488  #undef pskb_copy
489  #undef skb_clone
490  #undef skb_copy
491 @@ -638,8 +638,8 @@
492                 grp, vlan_tag);
493  }
494  
495 -int netif_rx_debug(struct sk_buff *skb, const char* func, int line) {
496 -       return netif_rx(untrack_skb(skb, 0, func, line, __func__, __LINE__));
497 +int netif_receive_skb_debug(struct sk_buff *skb, const char* func, int line) {
498 +       return netif_receive_skb(untrack_skb(skb, 0, func, line, __func__, __LINE__));
499  }
500  
501  struct sk_buff * alloc_skb_debug(unsigned int length, gfp_t gfp_mask,
502 @@ -760,7 +760,7 @@
503  }
504  
505  EXPORT_SYMBOL(vlan_hwaccel_receive_skb_debug);
506 -EXPORT_SYMBOL(netif_rx_debug);
507 +EXPORT_SYMBOL(netif_receive_skb_debug);
508  EXPORT_SYMBOL(alloc_skb_debug);
509  EXPORT_SYMBOL(dev_alloc_skb_debug);
510  EXPORT_SYMBOL(skb_clone_debug);
511 Index: madwifi-trunk-r3314/net80211/ieee80211_skb.h
512 ===================================================================
513 --- madwifi-trunk-r3314.orig/net80211/ieee80211_skb.h   2008-02-20 21:56:33.765245356 +0100
514 +++ madwifi-trunk-r3314/net80211/ieee80211_skb.h        2008-02-20 21:57:34.908729722 +0100
515 @@ -116,7 +116,7 @@
516  int  vlan_hwaccel_receive_skb_debug(struct sk_buff *skb, 
517                                     struct vlan_group *grp, unsigned short vlan_tag, 
518                                     const char* func, int line);
519 -int netif_rx_debug(struct sk_buff *skb, const char* func, int line);
520 +int netif_receive_skb_debug(struct sk_buff *skb, const char* func, int line);
521  struct sk_buff * alloc_skb_debug(unsigned int length, gfp_t gfp_mask,
522                                  const char *func, int line);
523  struct sk_buff * dev_alloc_skb_debug(unsigned int length,
524 @@ -151,7 +151,7 @@
525  #undef dev_queue_xmit
526  #undef kfree_skb
527  #undef kfree_skb_fast
528 -#undef netif_rx
529 +#undef netif_receive_skb
530  #undef pskb_copy
531  #undef skb_clone
532  #undef skb_copy
533 @@ -168,8 +168,8 @@
534         skb_copy_expand_debug(_skb, _newheadroom, _newtailroom, _gfp_mask, __func__, __LINE__)
535  #define vlan_hwaccel_receive_skb(_skb, _grp, _tag) \
536         vlan_hwaccel_receive_skb_debug(_skb, _grp, _tag, __func__, __LINE__)
537 -#define netif_rx(_skb) \
538 -       netif_rx_debug(_skb, __func__, __LINE__)
539 +#define netif_receive_skb(_skb) \
540 +       netif_receive_skb_debug(_skb, __func__, __LINE__)
541  #define        alloc_skb(_length, _gfp_mask) \
542         alloc_skb_debug(_length, _gfp_mask, __func__, __LINE__)
543  #define        dev_alloc_skb(_length) \