diff -uNr rhinefet.orig/Makefile rhinefet/Makefile --- rhinefet.orig/Makefile 2006-01-13 05:04:18.000000000 +0200 +++ rhinefet/Makefile 2013-06-14 10:30:26.481852386 +0300 @@ -1,6 +1,7 @@ DEBUG = 0 -KSP := /lib/modules/$(shell uname -r)/build \ +KSP := /lib/modules/2.6.29-rt1-up-alt1/build \ + /lib/modules/$(shell uname -r)/build \ /usr/src/linux-$(shell uname -r) \ /usr/src/linux-$(shell uname -r | sed 's/-.*//') \ /usr/src/kernel-headers-$(shell uname -r) \ @@ -17,17 +18,10 @@ endif # check kernel version -KVER := $(shell uname -r | cut -c1-3 | sed 's/2\.[56]/2\.6/') KERVER2=$(shell uname -r | cut -d. -f2) -ifeq ($(KVER), 2.6) - # 2.6 kernel - TARGET = rhinefet.ko - BUILTIN = via-rhine.ko -else - TARGET = rhinefet.o - BUILTIN = via-rhine.o -endif +TARGET = rhinefet.ko +BUILTIN = via-rhine.ko INSTDIR := $(shell find /lib/modules/$(shell uname -r) -name $(TARGET) -printf "%h\n" | sort | head -1) ifeq (,$(INSTDIR)) @@ -49,88 +43,13 @@ SRC = rhine_main.c rhine_proc.c rhine_wol.c rhine_hw.c # build rule -ifeq ($(KVER), 2.6) -# 2.6 kernel - obj-m += rhinefet.o -rhinefet-objs := rhine_main.o rhine_proc.o rhine_wol.o rhine_hw.o +rhinefet-objs := rhine_main.o rhine_wol.o rhine_hw.o rhine_proc.o default: make -C $(KSRC) SUBDIRS=$(shell pwd) modules -else -# 2.2/2.4 kernel - -OBJS := rhine_main.o rhine_proc.o rhine_wol.o rhine_hw.o - -VERSION_FILE := $(KSRC)/include/linux/version.h -CONFIG_FILE := $(KSRC)/include/linux/config.h - -ifeq (,$(wildcard $(VERSION_FILE))) - $(error Linux kernel source not configured - missing version.h) -endif - -ifeq (,$(wildcard $(CONFIG_FILE))) - $(error Linux kernel source not configured - missing config.h) -endif - -ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version))) - CC := kgcc gcc cc -else - CC := gcc cc -endif - -test_cc = $(shell which $(cc) > /dev/null 2>&1 && echo $(cc)) -CC := $(foreach cc, $(CC), $(test_cc)) -CC := $(firstword $(CC)) - -CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe -CFLAGS += -I$(KSRC)/include -I. -Wstrict-prototypes -fomit-frame-pointer -CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \ - echo "-DMODVERSIONS -include $(KSRC)/include/linux/modversions.h") - -.SILENT: $(TARGET) clean - -# look for SMP in config.h -SMP := $(shell $(CC) $(CFLAGS) -E -dM $(CONFIG_FILE) | \ - grep CONFIG_SMP | awk '{ print $$3 }') - -ifneq ($(SMP),1) - SMP := 0 -endif - -ifeq ($(DEBUG),1) - CFLAGS += -DRHINE_DBG -endif - -ifeq ($(SMP), 1) - CFLAGS += -D__SMP__ -endif - -# check x86_64 -SUBARCH := $(shell uname -m) -ifeq ($(SUBARCH),x86_64) - CFLAGS += -mcmodel=kernel -mno-red-zone -endif - -$(TARGET): $(filter-out $(TARGET), $(SRC:.c=.o)) - $(LD) -r $^ -o $@ - echo; echo - echo "**************************************************" - echo "Build options:" - echo " VERSION $(shell uname -r)" - echo -n " SMP " - if [ "$(SMP)" = "1" ]; \ - then echo "Enabled"; else echo "Disabled"; fi - echo "**************************************************" - -endif # ifeq ($(KVER),2.6) - -ifeq ($(KVER), 2.6) - install: default -else - install: clean $(TARGET) -endif +install: default mkdir -p $(MOD_ROOT)$(INSTDIR) install -m 644 -o root $(TARGET) $(MOD_ROOT)$(INSTDIR) @if [ -f $(MOD_ROOT)$(INSTDIR)/$(BUILTIN) ] ; then \ diff -uNr rhinefet.orig/rhine_main.c rhinefet/rhine_main.c --- rhinefet.orig/rhine_main.c 2006-11-06 11:11:28.000000000 +0200 +++ rhinefet/rhine_main.c 2013-06-14 10:16:51.349679598 +0300 @@ -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); @@ -743,8 +743,7 @@ } request_region(pInfo->hw.ioaddr, pInfo->hw.io_size, RHINE_NAME); #endif - rhine_create_proc_entry(pInfo); - + //rhine_create_proc_entry(pInfo); rhine_enable_mmio(&pInfo->hw); @@ -829,6 +828,8 @@ } #endif + rhine_create_proc_entry(pInfo); + rhine_print_info(pInfo); pci_set_drvdata(pcid, pInfo); @@ -1226,7 +1227,7 @@ //drop frame not met IEEE 802.3 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))) ) + (skb->len != htons(*(PU16)(skb_mac_header(skb)+12))) ) { //skb_put(skb, -(pRD->rdesc0.f15Length-4)); skb_put(skb, -(frame_length-4)); @@ -1584,7 +1585,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 +1735,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_PARTIAL)) { + struct iphdr* ip = (struct iphdr*) skb->network_header; if (ip->protocol == IPPROTO_TCP) pHeadTD->tdesc1 |= cpu_to_le32(TCR_TCPCK); else if (ip->protocol == IPPROTO_UDP) @@ -1951,7 +1952,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 -uNr rhinefet.orig/rhine_proc.c rhinefet/rhine_proc.c --- rhinefet.orig/rhine_proc.c 2006-01-13 05:04:20.000000000 +0200 +++ rhinefet/rhine_proc.c 2013-06-14 10:16:51.353679651 +0300 @@ -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; }