Alexei, Martin, Has any progress been made towards a fix? I now am down to only one error, specifically the error regarding the mdev object, plus the warning regarding an unused variable, removing the other instances of __devinit and __devexit_p eliminated the other errors, however I'm still wondering if there isn't something I'm missing in the kernel module API layout now... And what is wrong with the mdev object? --Matt On Jan 7, 2014 8:41 AM, "Marvin Stodolsky" <marvin.stodolsky@xxxxxxxxx> wrote: > > Alexei, > > Can you help? This is beyond my skill level > > MarvS > > On Tue, Jan 7, 2014 at 1:04 AM, Isan/Matt/Koryn <isangaft220@xxxxxxxxx> wrote: > > Dear board users; > > I have tried and tried again to build from > > martian-full-20100123.tar.gz, however it seems it can no longer be > > built, even with the no_const patch (my kernel has grsec patches) from > > Gentoo bugzilla (https://bugs.gentoo.org/show_bug.cgi?id=447434) as > > well as the Makefile patch (located here: > > http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-dialup/martian-modem/files/martian-modem-20100123-makefile.patch?content-type=text%2Fplain&revision=1.1) > > to fix kernel version detection. > > > > My current system is as follows: > > $ uname -a: > > Linux security 3.10.25-0-grsec #1-Alpine SMP Mon Dec 30 12:48:08 UTC > > 2013 i686 Linux > > $ lspci (note Alpinelinux uses busybox, which does not seem to print > > any more useful information than hardware identifiers, when using > > lspci/lsusb) > > 00:00.0 Class 0600: 1039:0746 > > 00:01.0 Class 0604: 1039:0002 > > 00:02.0 Class 0601: 1039:0964 > > 00:02.5 Class 0101: 1039:5513 > > 00:03.0 Class 0c03: 1039:7001 > > 00:03.1 Class 0c03: 1039:7001 > > 00:03.2 Class 0c03: 1039:7001 > > 00:03.3 Class 0c03: 1039:7002 > > 00:09.0 Class 0200: 8086:1229 > > 00:0a.0 Class 0200: 8086:100c > > 00:0b.0 Class 0780: 11c1:0442 > > 00:0c.0 Class 0703: 10b9:5459 > > 00:0d.0 Class 0280: 1814:0701 > > 00:0e.0 Class 0200: 10ec:8169 > > 01:00.0 Class 0300: 10de:0322 > > > > The compile log is as follows: > > security:~/martian-full-20100123# make > > make -C kmodule/ modules > > make[1]: Entering directory '/root/martian-full-20100123/kmodule' > > make -C /lib/modules/3.10.25-0-grsec/build > > M="/root/martian-full-20100123/kmodule" modules > > make[2]: Entering directory '/usr/src/linux-headers-3.10.25-0-grsec' > > CC [M] /root/martian-full-20100123/kmodule/martian.o > > /root/martian-full-20100123/kmodule/martian.c: In function 'martian_isr': > > /root/martian-full-20100123/kmodule/martian.c:135:27: warning: value > > computed is not used [-Wunused-value] > > process_stream (mdev) && (rd7 &= ~4); > > ^ > > /root/martian-full-20100123/kmodule/martian.c: In function 'martian_open': > > /root/martian-full-20100123/kmodule/martian.c:187:9: error: implicit > > declaration of function 'PDE' [-Werror=implicit-function-declaration] > > struct proc_dir_entry *entry = PDE (inode); > > ^ > > /root/martian-full-20100123/kmodule/martian.c:187:33: warning: > > initialization makes pointer from integer without a cast [enabled by > > default] > > struct proc_dir_entry *entry = PDE (inode); > > ^ > > /root/martian-full-20100123/kmodule/martian.c:188:49: error: > > dereferencing pointer to incomplete type > > struct martian *mdev = (struct martian *) entry->data; > > ^ > > /root/martian-full-20100123/kmodule/martian.c: At top level: > > /root/martian-full-20100123/kmodule/martian.c:596:1: error: expected > > '=', ',', ';', 'asm' or '__attribute__' before 'martian_configure_isr' > > martian_configure_isr (struct martian *mdev) > > ^ > > /root/martian-full-20100123/kmodule/martian.c:618:1: error: expected > > '=', ',', ';', 'asm' or '__attribute__' before > > 'martian_configure_params' > > martian_configure_params (struct martian *mdev) > > ^ > > /root/martian-full-20100123/kmodule/martian.c: In function 'martian_add': > > /root/martian-full-20100123/kmodule/martian.c:715:2: error: implicit > > declaration of function 'martian_configure_isr' > > [-Werror=implicit-function-declaration] > > martian_configure_isr (mdev); > > ^ > > /root/martian-full-20100123/kmodule/martian.c:716:2: error: implicit > > declaration of function 'martian_configure_params' > > [-Werror=implicit-function-declaration] > > martian_configure_params (mdev); > > ^ > > /root/martian-full-20100123/kmodule/martian.c:739:2: error: implicit > > declaration of function 'create_proc_entry' > > [-Werror=implicit-function-declaration] > > mdev->entry = create_proc_entry (name, 0400, NULL); > > ^ > > /root/martian-full-20100123/kmodule/martian.c:739:14: warning: > > assignment makes pointer from integer without a cast [enabled by > > default] > > mdev->entry = create_proc_entry (name, 0400, NULL); > > ^ > > /root/martian-full-20100123/kmodule/martian.c:751:13: error: > > dereferencing pointer to incomplete type > > mdev->entry->proc_fops = & martian_fops; > > ^ > > /root/martian-full-20100123/kmodule/martian.c:752:13: error: > > dereferencing pointer to incomplete type > > mdev->entry->data = mdev; > > ^ > > /root/martian-full-20100123/kmodule/martian.c: At top level: > > /root/martian-full-20100123/kmodule/martian.c:796:1: error: expected > > '=', ',', ';', 'asm' or '__attribute__' before > > 'martian_device_gatherinfo' > > martian_device_gatherinfo (const struct pci_dev *dev, const struct > > pci_device_id *ent, struct martian_metrics *metrics) > > ^ > > /root/martian-full-20100123/kmodule/martian.c:1001:1: error: expected > > '=', ',', ';', 'asm' or '__attribute__' before 'mars_device_probe' > > mars_device_probe (struct pci_dev *dev, const struct pci_device_id *ent) > > ^ > > /root/martian-full-20100123/kmodule/martian.c:1039:23: error: expected > > '=', ',', ';', 'asm' or '__attribute__' before 'mars_remove' > > static void __devexit mars_remove (struct pci_dev *dev) > > ^ > > In file included from /root/martian-full-20100123/kmodule/martian.c:1045:0: > > /root/martian-full-20100123/kmodule/martian_ids.c:11:15: error: > > expected '=', ',', ';', 'asm' or '__attribute__' before 'static' > > __devinitdata static struct pci_device_id martian_ids[] = { > > ^ > > /root/martian-full-20100123/kmodule/martian.c:1050:12: error: > > 'mars_device_probe' undeclared here (not in a function) > > .probe = mars_device_probe, > > ^ > > /root/martian-full-20100123/kmodule/martian.c:1051:2: error: implicit > > declaration of function '__devexit_p' > > [-Werror=implicit-function-declaration] > > .remove = __devexit_p (mars_remove), > > ^ > > /root/martian-full-20100123/kmodule/martian.c:1051:26: error: > > 'mars_remove' undeclared here (not in a function) > > .remove = __devexit_p (mars_remove), > > ^ > > /root/martian-full-20100123/kmodule/martian.c:1052:14: error: > > 'martian_ids' undeclared here (not in a function) > > .id_table = martian_ids > > ^ > > /root/martian-full-20100123/kmodule/martian.c:1065:23: error: expected > > '=', ',', ';', 'asm' or '__attribute__' before > > 'detach_from_serial_class' > > static void __devinit detach_from_serial_class (unsigned int class, > > unsigned int mask) > > ^ > > /root/martian-full-20100123/kmodule/martian.c:1086:23: error: expected > > '=', ',', ';', 'asm' or '__attribute__' before 'detach_from_serial' > > static void __devinit detach_from_serial(void) > > ^ > > /root/martian-full-20100123/kmodule/martian.c: In function 'martian_init': > > /root/martian-full-20100123/kmodule/martian.c:1107:2: error: implicit > > declaration of function 'detach_from_serial' > > [-Werror=implicit-function-declaration] > > detach_from_serial(); > > ^ > > In file included from /root/martian-full-20100123/kmodule/martian.c:35:0: > > /root/martian-full-20100123/kmodule/martian.c: At top level: > > include/linux/module.h:90:32: error: '__mod_pci_device_table' aliased > > to undefined symbol 'martian_ids' > > extern const struct gtype##_id __mod_##gtype##_table \ > > ^ > > include/linux/module.h:143:3: note: in expansion of macro 'MODULE_GENERIC_TABLE' > > MODULE_GENERIC_TABLE(type##_device,name) > > ^ > > /root/martian-full-20100123/kmodule/martian.c:1127:1: note: in > > expansion of macro 'MODULE_DEVICE_TABLE' > > MODULE_DEVICE_TABLE( pci, martian_ids ); > > ^ > > cc1: some warnings being treated as errors > > scripts/Makefile.build:308: recipe for target > > '/root/martian-full-20100123/kmodule/martian.o' failed > > make[3]: *** [/root/martian-full-20100123/kmodule/martian.o] Error 1 > > Makefile:1290: recipe for target > > '_module_/root/martian-full-20100123/kmodule' failed > > make[2]: *** [_module_/root/martian-full-20100123/kmodule] Error 2 > > make[2]: Leaving directory '/usr/src/linux-headers-3.10.25-0-grsec' > > Makefile:20: recipe for target 'modules' failed > > make[1]: *** [modules] Error 2 > > make[1]: Leaving directory '/root/martian-full-20100123/kmodule' > > Makefile:9: recipe for target 'all' failed > > make: *** [all] Error 2 > > > > From what I've dug up online, these errors seem to be indicative of > > large changes that occurred recently in the kernel. The proc interface > > itself seems to have changed significantly, for instance, PDE_DATA > > replacing PDE, and proc_create taking the place of create_proc_entry, > > while others seem to have something to do with the __devinit, > > __devinitdata and __devexit_p macros, to name some or most of the > > issues. I have created a partial patch that managed to cut the errors > > down from 21 to 13, however I seem to have stumped myself and cannot > > get past the "mdev->entry->data = mdev;" error. As it is, I would > > prefer it if my patch were looked over anyway for anything I have > > overlooked. > > > > The patch is as follows (note the old lines commented out): > > > > --- martian-full-20100123.orig/kmodule/martian.c > > +++ martian-full-20100123/kmodule/martian.c > > @@ -184,8 +184,9 @@ > > static int martian_open (struct inode *inode, struct file *filp) > > { > > // allow single open > > - struct proc_dir_entry *entry = PDE (inode); > > - struct martian *mdev = (struct martian *) entry->data; > > +// struct proc_dir_entry *entry = PDE (inode); > > +// struct martian *mdev = (struct martian *) entry->data; > > + struct martian *mdev = (struct martian *) PDE_DATA (inode); > > > > if (test_and_set_bit (MARTIAN_STATE_OPEN, &mdev->state)) { > > // already opened > > @@ -592,7 +593,7 @@ > > > > static int dev_idx = 0; > > > > -static void __devinit > > +static void //__devinit > > martian_configure_isr (struct martian *mdev) > > { > > struct martian_common *mcb = mdev->common; > > @@ -614,7 +615,7 @@ > > mcb->dp_bamil_rd7 = 0xff; > > } > > > > -static void __devinit > > +static void //__devinit > > martian_configure_params (struct martian *mdev) > > { > > mdev->params.dsp_mars = mdev->metrics.dsp_mars; > > @@ -736,7 +737,8 @@ > > // create proc entry for this device > > name[ strlen(name) - 1 ] = '0' + dev_idx; > > > > - mdev->entry = create_proc_entry (name, 0400, NULL); > > +// mdev->entry = create_proc_entry (name, 0400, NULL); > > + mdev->entry = proc_create (name, 0400, NULL, &martian_fops); > > if (! mdev->entry) { > > MERROR ("martian: failed to create /proc/%s\n", name); > > ret = -ENOMEM; > > @@ -748,8 +750,9 @@ > > // set an index > > mdev->index = dev_idx; > > > > - mdev->entry->proc_fops = & martian_fops; > > +// mdev->entry->proc_fops = & martian_fops; > > mdev->entry->data = mdev; > > + > > > > pr_info("martian: added device %x:%x " > > "BaseAddress = 0x%x, CommAddres = 0x%x, irq = %d%s\n", > > > > > > Thank you in advance, I humbly await anybody's assistance in repairing > > this problem. > > -- Matt Schultz