Merge branch 'next-i2c' of git://git.fluff.org/bjdooks/linux
[pandora-kernel.git] / drivers / staging / octeon / ethernet-rx.c
index cb38f9e..1a7c19a 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/ip.h>
 #include <linux/string.h>
 #include <linux/prefetch.h>
+#include <linux/ratelimit.h>
 #include <linux/smp.h>
 #include <net/dst.h>
 #ifdef CONFIG_XFRM
@@ -41,7 +42,7 @@
 #include <net/xfrm.h>
 #endif /* CONFIG_XFRM */
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 #include <asm/octeon/octeon.h>
 
@@ -186,13 +187,13 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
 
                        if (*ptr == 0xd5) {
                                /*
-                                  DEBUGPRINT("Port %d received 0xd5 preamble\n", work->ipprt);
+                                 printk_ratelimited("Port %d received 0xd5 preamble\n", work->ipprt);
                                 */
                                work->packet_ptr.s.addr += i + 1;
                                work->len -= i + 5;
                        } else if ((*ptr & 0xf) == 0xd) {
                                /*
-                                  DEBUGPRINT("Port %d received 0x?d preamble\n", work->ipprt);
+                                 printk_ratelimited("Port %d received 0x?d preamble\n", work->ipprt);
                                 */
                                work->packet_ptr.s.addr += i;
                                work->len -= i + 4;
@@ -203,9 +204,9 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
                                        ptr++;
                                }
                        } else {
-                               DEBUGPRINT("Port %d unknown preamble, packet "
-                                          "dropped\n",
-                                    work->ipprt);
+                               printk_ratelimited("Port %d unknown preamble, packet "
+                                                  "dropped\n",
+                                                  work->ipprt);
                                /*
                                   cvmx_helper_dump_packet(work);
                                 */
@@ -214,8 +215,8 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
                        }
                }
        } else {
-               DEBUGPRINT("Port %d receive error code %d, packet dropped\n",
-                          work->ipprt, work->word2.snoip.err_code);
+               printk_ratelimited("Port %d receive error code %d, packet dropped\n",
+                                  work->ipprt, work->word2.snoip.err_code);
                cvm_oct_free_work(work);
                return 1;
        }
@@ -334,8 +335,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
                         */
                        skb = dev_alloc_skb(work->len);
                        if (!skb) {
-                               DEBUGPRINT("Port %d failed to allocate skbuff, packet dropped\n",
-                                          work->ipprt);
+                               printk_ratelimited("Port %d failed to allocate "
+                                                  "skbuff, packet dropped\n",
+                                                  work->ipprt);
                                cvm_oct_free_work(work);
                                continue;
                        }
@@ -429,7 +431,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
                        } else {
                                /* Drop any packet received for a device that isn't up */
                                /*
-                               DEBUGPRINT("%s: Device not up, packet dropped\n",
+                                 printk_ratelimited("%s: Device not up, packet dropped\n",
                                           dev->name);
                                */
 #ifdef CONFIG_64BIT
@@ -444,7 +446,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
                         * Drop any packet received for a device that
                         * doesn't exist.
                         */
-                       DEBUGPRINT("Port %d not controlled by Linux, packet dropped\n",
+                       printk_ratelimited("Port %d not controlled by Linux, packet dropped\n",
                                   work->ipprt);
                        dev_kfree_skb_irq(skb);
                }