Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 106103
Collapse All | Expand All

(-)hcfpcimodem-1.06full/modules/GPL/oscompat.h (+12 lines)
Lines 543-546 Link Here
543
#define PCI_SLOT_NAME(x)  (x)->dev.bus_id
543
#define PCI_SLOT_NAME(x)  (x)->dev.bus_id
544
#endif
544
#endif
545
545
546
#ifdef FOUND_CLASS_SIMPLE
547
#define CLASS_DEVICE_CREATE(class, dev, device, fmt, rest) class_simple_device_add(class, dev, device, fmt, rest)
548
#define CLASS_DESTROY(class) class_simple_destroy(class)
549
#define CLASS_DEVICE_DESTROY(class, dev) class_simple_device_remove(dev)
550
#define CLASS_CREATE(owner, name) class_simple_create(owner, name)
551
#else
552
#define CLASS_DEVICE_CREATE(class, dev, device, fmt, rest) class_device_create(class, dev, device, fmt, rest)
553
#define CLASS_DESTROY(class) class_destroy(class)
554
#define CLASS_DEVICE_DESTROY(class, dev) class_device_destroy(class, dev)
555
#define CLASS_CREATE(owner, name) class_create(owner, name)
556
#endif
557
546
#endif /* __OSCOMPAT_H */
558
#endif /* __OSCOMPAT_H */
(-)hcfpcimodem-1.06full/modules/Makefile (+13 lines)
Lines 48-53 Link Here
48
KMODS_DIR := /lib/modules/$(KERNELVER)
48
KMODS_DIR := /lib/modules/$(KERNELVER)
49
CNXT_MODS_DIR := $(KMODS_DIR)/extra
49
CNXT_MODS_DIR := $(KMODS_DIR)/extra
50
50
51
# On SuSE 9.0 and up, CNXT_KERNELSRC points to an incomplete kernel source
52
# directory and some include files are not available in this tree
53
SUSE_OBJ_TREE := $(shell if grep -q '^KERNELSRC ' "${CNXT_KERNELSRC}/Makefile" && [ -d "${CNXT_KERNELSRC}" ]; then echo "yes"; else echo "no"; fi)
54
55
ifeq ($(SUSE_OBJ_TREE),yes)
56
REAL_KERNELSRC := $(shell grep '^KERNELSRC ' "${CNXT_KERNELSRC}/Makefile" | awk '{print $3}')
57
else
58
REAL_KERNELSRC := $(CNXT_KERNELSRC)
59
endif
60
51
FOUND_PCI_DEV_SLOT_NAME := $(shell grep -q 'slot_name' ${CNXT_KERNELSRC}/include/linux/pci.h 2> /dev/null && echo -DFOUND_PCI_DEV_SLOT_NAME)
61
FOUND_PCI_DEV_SLOT_NAME := $(shell grep -q 'slot_name' ${CNXT_KERNELSRC}/include/linux/pci.h 2> /dev/null && echo -DFOUND_PCI_DEV_SLOT_NAME)
52
CFLAGS+= $(FOUND_PCI_DEV_SLOT_NAME)
62
CFLAGS+= $(FOUND_PCI_DEV_SLOT_NAME)
53
63
Lines 57-62 Link Here
57
KO= ko
67
KO= ko
58
KBUILD_EXTMOD_SUPPORTED := $(shell egrep -q 'KBUILD_EXTMOD|KERNEL_SOURCE|KERNELSRC' ${CNXT_KERNELSRC}/Makefile 2>/dev/null && echo yes || echo no)
68
KBUILD_EXTMOD_SUPPORTED := $(shell egrep -q 'KBUILD_EXTMOD|KERNEL_SOURCE|KERNELSRC' ${CNXT_KERNELSRC}/Makefile 2>/dev/null && echo yes || echo no)
59
69
70
FOUND_CLASS_SIMPLE := $(shell grep -q 'class_simple_device_add' ${REAL_KERNELSRC}/include/linux/device.h 2> /dev/null && echo -DFOUND_CLASS_SIMPLE)
71
CFLAGS+= $(FOUND_CLASS_SIMPLE)
72
60
else
73
else
61
KO= o
74
KO= o
62
# Configure compiler (on some systems, kgcc must be used to compile kernel code)
75
# Configure compiler (on some systems, kgcc must be used to compile kernel code)
(-)hcfpcimodem-1.06full/modules/osdiag.c (-6 / +10 lines)
Lines 30-36 Link Here
30
static struct list_head diag_instance_list = LIST_HEAD_INIT(diag_instance_list);
30
static struct list_head diag_instance_list = LIST_HEAD_INIT(diag_instance_list);
31
static spinlock_t diag_lock = SPIN_LOCK_UNLOCKED;
31
static spinlock_t diag_lock = SPIN_LOCK_UNLOCKED;
32
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
32
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
33
#ifdef FOUND_CLASS_SIMPLE
33
static struct class_simple *diag_class;
34
static struct class_simple *diag_class;
35
#else
36
static struct class *diag_class;
37
#endif
34
#endif
38
#endif
35
39
36
#define common_instance_header \
40
#define common_instance_header \
Lines 659-665 Link Here
659
#else
663
#else
660
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
664
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
661
	if (!IS_ERR(diag_class)) {
665
	if (!IS_ERR(diag_class)) {
662
	    class_simple_device_add(diag_class, MKDEV(diagmajor, pDiag->hwInstNum), hwDevLink, CNXTTARGET"diag%d", pDiag->hwInstNum);
666
	    CLASS_DEVICE_CREATE(diag_class, MKDEV(diagmajor, pDiag->hwInstNum), hwDevLink, CNXTTARGET"diag%d", pDiag->hwInstNum);
663
	}
667
	}
664
#endif
668
#endif
665
669
Lines 764-770 Link Here
764
    }
768
    }
765
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
769
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
766
    if (!IS_ERR(diag_class))
770
    if (!IS_ERR(diag_class))
767
	class_simple_device_remove(MKDEV(diagmajor, pDiag->hwInstNum));
771
	CLASS_DEVICE_DESTROY(diag_class, MKDEV(diagmajor, pDiag->hwInstNum));
768
#endif
772
#endif
769
#endif
773
#endif
770
774
Lines 834-847 Link Here
834
    devfs_remove(CNXTTARGET"diagdmp");
838
    devfs_remove(CNXTTARGET"diagdmp");
835
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
839
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
836
    if (!IS_ERR(diag_class))
840
    if (!IS_ERR(diag_class))
837
	class_simple_device_remove(MKDEV(diagmajor, CNXTDIAGDMPMINOR));
841
	CLASS_DEVICE_DESTROY(diag_class, MKDEV(diagmajor, CNXTDIAGDMPMINOR));
838
#endif
842
#endif
839
#endif
843
#endif
840
#endif /* DMP || DMP_RETAIL */
844
#endif /* DMP || DMP_RETAIL */
841
845
842
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
846
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
843
    if (!IS_ERR(diag_class))
847
    if (!IS_ERR(diag_class))
844
	class_simple_destroy(diag_class);
848
	CLASS_DESTROY(diag_class);
845
#endif
849
#endif
846
    if(diagmajor > 0)
850
    if(diagmajor > 0)
847
	unregister_chrdev(diagmajor, CNXTTARGET"diag");
851
	unregister_chrdev(diagmajor, CNXTTARGET"diag");
Lines 865-871 Link Here
865
    }
869
    }
866
870
867
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
871
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
868
    diag_class = class_simple_create(THIS_MODULE, CNXTTARGET"diag");
872
    diag_class = CLASS_CREATE(THIS_MODULE, CNXTTARGET"diag");
869
    if (IS_ERR(diag_class)) {
873
    if (IS_ERR(diag_class)) {
870
	printk(KERN_ERR "%s: cannot create simple class (%ld)\n", __FUNCTION__, PTR_ERR(diag_class));
874
	printk(KERN_ERR "%s: cannot create simple class (%ld)\n", __FUNCTION__, PTR_ERR(diag_class));
871
	if(diagmajor > 0)
875
	if(diagmajor > 0)
Lines 884-890 Link Here
884
#else
888
#else
885
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
889
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2)
886
    if (!IS_ERR(diag_class)) {
890
    if (!IS_ERR(diag_class)) {
887
	class_simple_device_add(diag_class, MKDEV(diagmajor, CNXTDIAGDMPMINOR), NULL, CNXTTARGET"diagdmp");
891
	CLASS_DEVICE_CREATE(diag_class, MKDEV(diagmajor, CNXTDIAGDMPMINOR), NULL, CNXTTARGET"diagdmp");
888
    }
892
    }
889
#endif
893
#endif
890
    devfs_mk_cdev(MKDEV(diagmajor, CNXTDIAGDMPMINOR), S_IFCHR | S_IRUSR | S_IWUSR, CNXTTARGET"diagdmp");
894
    devfs_mk_cdev(MKDEV(diagmajor, CNXTDIAGDMPMINOR), S_IFCHR | S_IRUSR | S_IWUSR, CNXTTARGET"diagdmp");

Return to bug 106103