A patch for rhinefet netcard driver

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
diff -ru orig/rhine_main.c hacked/rhine_main.c
--- orig/rhine_main.c 2006-11-06 12:11:28.000000000 +0300
+++ hacked/rhine_main.c 2009-08-12 10:31:39.000000000 +0400
@@ -678,7 +678,7 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
/* Chain it all together */
- SET_MODULE_OWNER(dev);
+ //SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pcid->dev);
#endif
pInfo = netdev_priv(dev);
@@ -1224,7 +1224,7 @@
skb->protocol = eth_type_trans(skb, skb->dev);
//drop frame not met IEEE 802.3
- if (pInfo->hw.flags & RHINE_FLAGS_VAL_PKT_LEN) {
+ /*if (pInfo->hw.flags & RHINE_FLAGS_VAL_PKT_LEN) {
if ( (skb->protocol == htons(ETH_P_802_2)) &&
(skb->len != htons(*(PU16)(skb->mac.raw + 12))) )
{
@@ -1233,7 +1233,7 @@
pStats->rx_length_errors++;
return FALSE;
}
- }
+ }*/
pci_unmap_single(pInfo->pcid,pRDInfo->skb_dma,
pInfo->hw.rx_buf_sz, PCI_DMA_FROMDEVICE);
@@ -1584,7 +1584,7 @@
rhine_init_pci(pInfo);
rhine_init_adapter(pInfo, RHINE_INIT_COLD);
- i=request_irq(pInfo->pcid->irq, &rhine_intr, SA_SHIRQ, dev->name, dev);
+ i=request_irq(pInfo->pcid->irq, &rhine_intr, IRQF_SHARED, dev->name, dev);
if (i)
return i;
@@ -1734,8 +1734,8 @@
#ifdef RHINE_TX_CSUM_SUPPORT
if ((pInfo->hw.flags & RHINE_FLAGS_TX_CSUM) &&
- (skb->ip_summed == CHECKSUM_HW)) {
- struct iphdr* ip=skb->nh.iph;
+ (skb->ip_summed == CHECKSUM_COMPLETE)) {
+ struct iphdr* ip = ip_hdr(skb);
if (ip->protocol == IPPROTO_TCP)
pHeadTD->tdesc1 |= cpu_to_le32(TCR_TCPCK);
else if (ip->protocol == IPPROTO_UDP)
@@ -1951,7 +1951,7 @@
static int __init rhine_init_module(void)
{
int ret;
- ret=pci_module_init(&rhine_driver);
+ ret=pci_register_driver(&rhine_driver);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
#ifdef CONFIG_PM
diff -ru orig/rhine_proc.c hacked/rhine_proc.c
--- orig/rhine_proc.c 2006-01-13 06:04:20.000000000 +0300
+++ hacked/rhine_proc.c 2009-08-12 10:34:46.000000000 +0400
@@ -239,14 +239,14 @@
int len=strlen(RHINE_PROC_DIR_NAME);
if (rhine_dir==NULL) {
- for (rhine_dir = proc_net->subdir; rhine_dir;rhine_dir = rhine_dir->next) {
+ for (rhine_dir = init_net.proc_net->subdir; rhine_dir;rhine_dir = rhine_dir->next) {
if ((rhine_dir->namelen == len) &&
(!memcmp(rhine_dir->name, RHINE_PROC_DIR_NAME, len)))
break;
}
if (rhine_dir==NULL) {
- rhine_dir=create_proc_entry(RHINE_PROC_DIR_NAME,S_IFDIR,proc_net);
+ rhine_dir=create_proc_entry(RHINE_PROC_DIR_NAME,S_IFDIR,init_net.proc_net);
ptr=create_proc_entry("version",S_IFREG|S_IRUGO,rhine_dir);
ptr->data=NULL;
ptr->write_proc=NULL;
@@ -279,7 +279,7 @@
return;
remove_proc_entry("version",rhine_dir);
- remove_proc_entry(RHINE_PROC_DIR_NAME,proc_net);
+ remove_proc_entry(RHINE_PROC_DIR_NAME,init_net.proc_net);
rhine_dir=NULL;
}