1 diff -ur linux.old/drivers/net/via-rhine.c linux.dev/drivers/net/via-rhine.c
2 --- linux.old/drivers/net/via-rhine.c 2006-11-29 22:57:37.000000000 +0100
3 +++ linux.dev/drivers/net/via-rhine.c 2006-12-14 03:39:01.000000000 +0100
5 #define DRV_VERSION "1.4.3"
6 #define DRV_RELDATE "2007-03-06"
10 /* A few user-configurable values.
11 These may be modified when a driver module is loaded. */
13 static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */
14 static int max_interrupt_work = 20;
17 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
18 Setting to > 1518 effectively disables this feature. */
19 static int rx_copybreak;
22 /* Work-around for broken BIOSes: they are unable to get the chip back out of
23 power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */
27 #include <asm/uaccess.h>
28 +#include <asm/unaligned.h>
29 #include <linux/dmi.h>
31 /* These identify the driver base version and may not be removed. */
34 module_param(max_interrupt_work, int, 0);
35 module_param(debug, int, 0);
36 -module_param(rx_copybreak, int, 0);
37 module_param(avoid_D3, bool, 0);
38 MODULE_PARM_DESC(max_interrupt_work, "VIA Rhine maximum events handled per interrupt");
39 MODULE_PARM_DESC(debug, "VIA Rhine debug level (0-7)");
40 -MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames");
41 MODULE_PARM_DESC(avoid_D3, "Avoid power state D3 (work-around for broken BIOSes)");
43 +module_param(rx_copybreak, int, 0);
44 +MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames");
51 /* Fill in the Rx buffers. Handle allocation failure gracefully. */
52 for (i = 0; i < RX_RING_SIZE; i++) {
53 - struct sk_buff *skb = dev_alloc_skb(rp->rx_buf_sz);
54 + struct sk_buff *skb = dev_alloc_skb(rp->rx_buf_sz + 4);
55 rp->rx_skbuff[i] = skb;
59 /* Length should omit the CRC */
60 int pkt_len = data_size - 4;
65 /* Check if the packet is long enough to accept without
66 copying to a minimally-sized skbuff. */
67 if (pkt_len < rx_copybreak &&
69 rp->rx_skbuff_dma[entry],
76 skb = rp->rx_skbuff[entry];
78 printk(KERN_ERR "%s: Inconsistent Rx "
79 @@ -1515,6 +1526,14 @@
80 rp->rx_skbuff_dma[entry],
84 + /* align the data to the ip header - should be faster than copying the entire packet */
85 + for (i = pkt_len - (pkt_len % 4); i >= 0; i -= 4) {
86 + put_unaligned(*((u32 *) (skb->data + i)), (u32 *) (skb->data + i + 2));
92 skb->protocol = eth_type_trans(skb, dev);
93 #ifdef CONFIG_VIA_RHINE_NAPI