rhinefet netcard driver patch for 2.6.31 kernel

  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
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Only in rhinefet: .rhinefet.ko.cmd
Only in rhinefet: .rhinefet.mod.o.cmd
Only in rhinefet: .rhinefet.o.cmd
Only in rhinefet: .rhine_hw.o.cmd
diff -ur orig/rhine_main.c rhinefet/rhine_main.c
--- orig/rhine_main.c 2006-11-06 12:11:28.000000000 +0300
+++ rhinefet/rhine_main.c 2009-09-27 00:09:46.000000000 +0400
@@ -633,6 +633,15 @@
}
}
+static const struct net_device_ops rhine_netdev_ops = {
+ .ndo_open = rhine_open,
+ .ndo_start_xmit = rhine_xmit,
+ .ndo_stop = rhine_close,
+ .ndo_get_stats = rhine_get_stats,
+ .ndo_set_multicast_list = rhine_set_multi,
+ .ndo_do_ioctl = rhine_ioctl,
+};
+
static int
rhine_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
{
@@ -678,7 +687,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);
@@ -773,12 +782,13 @@
for (i=0; i<6; i++)
dev->dev_addr[i] = CSR_READ_1(&pInfo->hw, MAC_REG_PAR+i);
dev->irq = pcid->irq;
- dev->open = rhine_open;
+ dev->netdev_ops = &rhine_netdev_ops;
+ /*dev->open = rhine_open;
dev->hard_start_xmit = rhine_xmit;
dev->stop = rhine_close;
dev->get_stats = rhine_get_stats;
dev->set_multicast_list = rhine_set_multi;
- dev->do_ioctl = rhine_ioctl;
+ dev->do_ioctl = rhine_ioctl;*/
#ifdef RHINE_ZERO_COPY_SUPPORT
dev->features |= NETIF_F_SG;
@@ -1224,7 +1234,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 +1243,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 +1594,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 +1744,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 +1961,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
Only in rhinefet: .rhine_main.o.cmd
diff -ur orig/rhine_proc.c rhinefet/rhine_proc.c
--- orig/rhine_proc.c 2006-01-13 06:04:20.000000000 +0300
+++ rhinefet/rhine_proc.c 2009-09-27 00:09: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;
}
Only in rhinefet: .rhine_proc.o.cmd
Only in rhinefet: .rhine_wol.o.cmd
Only in rhinefet: .tmp_versions