Upgrade rb532 to .23, provide generic GPIO API to this board
[openwrt/openwrt.git] / target / linux / rb532 / patches / 240-via_rhine_performance.patch
index e7cdf8ae24cbdbea9077b8f0ab34581c3422c465..90d365759f65d6a0a229fb69959a149c4de9335a 100644 (file)
@@ -1,27 +1,31 @@
-diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c
---- linux.old/drivers/net/via-rhine.c  2006-11-29 22:57:37.000000000 +0100
-+++ linux.dev/drivers/net/via-rhine.c  2006-12-14 03:39:01.000000000 +0100
-@@ -33,6 +33,7 @@
+--- linux-2.6.23.12/drivers/net/via-rhine.c    2007-12-18 22:55:57.000000000 +0100
++++ linux-2.6.23.12.new/drivers/net/via-rhine.c        2008-01-11 08:58:58.000000000 +0100
+@@ -33,6 +33,8 @@
  #define DRV_VERSION   "1.4.3"
  #define DRV_RELDATE   "2007-03-06"
  
 +#define PKT_ALIGN 1
++
  
  /* A few user-configurable values.
     These may be modified when a driver module is loaded. */
-@@ -40,9 +41,11 @@
+@@ -40,6 +42,7 @@
  static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */
  static int max_interrupt_work = 20;
  
 +#ifndef PKT_ALIGN
  /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
     Setting to > 1518 effectively disables this feature. */
+ #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \
+@@ -49,6 +52,7 @@
+ #else
  static int rx_copybreak;
-+#endif
+ #endif
++#endif /* PKT_ALIGN */
  
  /* Work-around for broken BIOSes: they are unable to get the chip back out of
     power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */
-@@ -105,6 +108,7 @@
+@@ -111,6 +115,7 @@
  #include <asm/io.h>
  #include <asm/irq.h>
  #include <asm/uaccess.h>
@@ -29,7 +33,7 @@ diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c
  #include <linux/dmi.h>
  
  /* These identify the driver base version and may not be removed. */
-@@ -124,12 +128,14 @@
+@@ -130,12 +135,14 @@
  
  module_param(max_interrupt_work, int, 0);
  module_param(debug, int, 0);
@@ -46,7 +50,7 @@ diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c
  
  /*
                Theory of Operation
-@@ -924,7 +930,7 @@
+@@ -927,7 +934,7 @@
  
        /* Fill in the Rx buffers.  Handle allocation failure gracefully. */
        for (i = 0; i < RX_RING_SIZE; i++) {
@@ -55,17 +59,18 @@ diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c
                rp->rx_skbuff[i] = skb;
                if (skb == NULL)
                        break;
-@@ -1482,6 +1488,9 @@
+@@ -1484,7 +1491,9 @@
+                       struct sk_buff *skb;
                        /* Length should omit the CRC */
                        int pkt_len = data_size - 4;
+-
 +#ifdef PKT_ALIGN
 +                      int i;
 +#else
                        /* Check if the packet is long enough to accept without
                           copying to a minimally-sized skbuff. */
                        if (pkt_len < rx_copybreak &&
-@@ -1501,7 +1510,9 @@
+@@ -1503,7 +1512,9 @@
                                                               rp->rx_skbuff_dma[entry],
                                                               rp->rx_buf_sz,
                                                               PCI_DMA_FROMDEVICE);
@@ -76,19 +81,18 @@ diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c
                                skb = rp->rx_skbuff[entry];
                                if (skb == NULL) {
                                        printk(KERN_ERR "%s: Inconsistent Rx "
-@@ -1515,6 +1526,14 @@
+@@ -1517,6 +1528,14 @@
                                                 rp->rx_skbuff_dma[entry],
                                                 rp->rx_buf_sz,
                                                 PCI_DMA_FROMDEVICE);
-+#ifdef PKT_ALIGN              
++#ifdef PKT_ALIGN
 +                              /* align the data to the ip header - should be faster than copying the entire packet */
 +                              for (i = pkt_len - (pkt_len % 4); i >= 0; i -= 4) {
 +                                      put_unaligned(*((u32 *) (skb->data + i)), (u32 *) (skb->data + i + 2));
 +                              }
 +                              skb->data += 2;
 +                              skb->tail += 2;
-+#endif        
++#endif
                        }
                        skb->protocol = eth_type_trans(skb, dev);
  #ifdef CONFIG_VIA_RHINE_NAPI
-