Hello,

I am trying to compile a third-party A/D card driver (proven to work on 2.2.X kernels) on Debian etch 2.6.18-5-486 & 2.6.18-5-686. As directed, I have changed the makefile to point to the correct linux source header files.

And get the following compilation errors with 2.6.18-5-686:
"puma:/home/kranti/project/mpc555/linux# make
cc -D__KERNEL__ -DMODULE -I/lib/modules/2.6.18-5-686/build/include -O -Wall -c
-o mpc555.o mpc555.c
In file included from /lib/modules/2.6.18-5-686/build/include/linux/rwsem.h:24,
from /lib/modules/2.6.18-5-686/build/include/asm/semaphore.h:42
,
from /lib/modules/2.6.18-5-686/build/include/linux/sched.h:57,
from /lib/modules/2.6.18-5-686/build/include/linux/module.h:9,
from mpc555.c:10:
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h: In function ‘__down_read’:
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h:104: error: expected ‘:’ or
‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h: In function ‘__down_write_n
ested’:
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h:156: error: expected ‘:’ or
‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h: In function ‘__up_read’:
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h:198: error: expected ‘:’ or
‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h:192: warning: unused variabl
e ‘tmp’
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h: In function ‘__up_write’:
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h:224: error: expected ‘:’ or
‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h: In function ‘__downgrade_wr
ite’:
/lib/modules/2.6.18-5-686/build/include/asm/rwsem.h:249: error: expected ‘:’ or
‘)’ before ‘KBUILD_BASENAME’
In file included from /lib/modules/2.6.18-5-686/build/include/linux/sched.h:57,
from /lib/modules/2.6.18-5-686/build/include/linux/module.h:9,
from mpc555.c:10:
/lib/modules/2.6.18-5-686/build/include/asm/semaphore.h: In function ‘down’:
/lib/modules/2.6.18-5-686/build/include/asm/semaphore.h:105: error: expected ‘:’
or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-5-686/build/include/asm/semaphore.h: In function ‘down_inter
ruptible’:
/lib/modules/2.6.18-5-686/build/include/asm/semaphore.h:130: error: expected ‘:’
or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-5-686/build/include/asm/semaphore.h: In function ‘down_trylo
ck’:
/lib/modules/2.6.18-5-686/build/include/asm/semaphore.h:155: error: expected ‘:’
or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-5-686/build/include/asm/semaphore.h: In function ‘up’:
/lib/modules/2.6.18-5-686/build/include/asm/semaphore.h:179: error: expected ‘:’
or ‘)’ before ‘KBUILD_BASENAME’
In file included from /lib/modules/2.6.18-5-686/build/include/asm/smp.h:17,
from /lib/modules/2.6.18-5-686/build/include/linux/smp.h:18,
from /lib/modules/2.6.18-5-686/build/include/linux/sched.h:63,
from /lib/modules/2.6.18-5-686/build/include/linux/module.h:9,
from mpc555.c:10:
/lib/modules/2.6.18-5-686/build/include/asm/mpspec.h:6:25: error: mach_mpspec.h:
No such file or directory
In file included from /lib/modules/2.6.18-5-686/build/include/asm/smp.h:17,
from /lib/modules/2.6.18-5-686/build/include/linux/smp.h:18,
from /lib/modules/2.6.18-5-686/build/include/linux/sched.h:63,
from /lib/modules/2.6.18-5-686/build/include/linux/module.h:9,
from mpc555.c:10:
/lib/modules/2.6.18-5-686/build/include/asm/mpspec.h: At top level:
/lib/modules/2.6.18-5-686/build/include/asm/mpspec.h:8: error: ‘MAX_MP_BUSSES’ u
ndeclared here (not in a function)
/lib/modules/2.6.18-5-686/build/include/asm/mpspec.h:22: error: ‘MAX_IRQ_SOURCES
’ undeclared here (not in a function)
In file included from /lib/modules/2.6.18-5-686/build/include/linux/smp.h:18,
from /lib/modules/2.6.18-5-686/build/include/linux/sched.h:63,
from /lib/modules/2.6.18-5-686/build/include/linux/module.h:9,
from mpc555.c:10:
/lib/modules/2.6.18-5-686/build/include/asm/smp.h:76:26: error: mach_apicdef.h:
No such file or directory
In file included from /lib/modules/2.6.18-5-686/build/include/linux/smp.h:18,
from /lib/modules/2.6.18-5-686/build/include/linux/sched.h:63,
from /lib/modules/2.6.18-5-686/build/include/linux/module.h:9,
from mpc555.c:10:
/lib/modules/2.6.18-5-686/build/include/asm/smp.h: In function ‘hard_smp_process
or_id’:
/lib/modules/2.6.18-5-686/build/include/asm/smp.h:80: warning: implicit declarat
ion of function ‘GET_APIC_ID’
mpc555.c:17:26: error: linux/malloc.h: No such file or directory
mpc555.c: At top level:
mpc555.c:54: error: expected ‘)’ before string constant
mpc555.c:55: error: expected ‘)’ before string constant
mpc555.c:56: error: expected ‘)’ before string constant
mpc555.c:69: warning: initialization from incompatible pointer type
mpc555.c: In function ‘init_module’:
mpc555.c:83: warning: ‘check_region’ is deprecated (declared at /lib/modules/2.6
.18-5-686/build/include/linux/ioport.h:133)
mpc555.c:93: warning: implicit declaration of function ‘request_irq’
mpc555.c:93: error: ‘SA_INTERRUPT’ undeclared (first use in this function)
mpc555.c:93: error: (Each undeclared identifier is reported only once
mpc555.c:93: error: for each function it appears in.)
mpc555.c: In function ‘cleanup_module’:
mpc555.c:118: warning: implicit declaration of function ‘free_irq’
mpc555.c: In function ‘mpc555_irqa_handler’:
mpc555.c:128: warning: passing argument 1 of ‘__wake_up’ from incompatible point
er type
mpc555.c: In function ‘mpc555_irqb_handler’:
mpc555.c:133: warning: passing argument 1 of ‘__wake_up’ from incompatible point
er type
mpc555.c: In function ‘mpc555_ioctl’:
mpc555.c:147: error: subscripted value is neither array nor pointer
mpc555.c:150: error: subscripted value is neither array nor pointer
mpc555.c:154: error: subscripted value is neither array nor pointer
mpc555.c:158: error: subscripted value is neither array nor pointer
mpc555.c:161: error: subscripted value is neither array nor pointer
mpc555.c:165: error: subscripted value is neither array nor pointer
mpc555.c:168: error: subscripted value is neither array nor pointer
mpc555.c:173: error: subscripted value is neither array nor pointer
mpc555.c:176: error: subscripted value is neither array nor pointer
mpc555.c:180: error: subscripted value is neither array nor pointer
mpc555.c:183: error: subscripted value is neither array nor pointer
mpc555.c:187: error: subscripted value is neither array nor pointer
mpc555.c:190: error: subscripted value is neither array nor pointer
mpc555.c:194: error: subscripted value is neither array nor pointer
mpc555.c:197: error: subscripted value is neither array nor pointer
mpc555.c:144: warning: ignoring return value of ‘copy_from_user’, declared with attribute warn_unused_result
mpc555.c:152: warning: ignoring return value of ‘copy_to_user’, declared with at tribute warn_unused_result
mpc555.c:170: warning: ignoring return value of ‘copy_to_user’, declared with at tribute warn_unused_result
mpc555.c:192: warning: ignoring return value of ‘copy_to_user’, declared with at tribute warn_unused_result
mpc555.c:200: warning: ignoring return value of ‘copy_to_user’, declared with at tribute warn_unused_result
mpc555.c: In function ‘mpc555_ad_read’:
mpc555.c:293: warning: passing argument 1 of ‘interruptible_sleep_on’ from incom patible pointer type
make: *** [mpc555.o] Error 1
puma:/home/kranti/project/mpc555/linux#"

I get similar undeclared CONSTANTS errors with 2.6.18-5-486 but in irq.h, hw_irq.h etc

I tried to look for them on the internet without much success though. Am I missing a patch or some other package that needs to be present for the compilation to be successful??? Kindly help.

Thanks,
Kranti

So you're trying to compile code written for 2.2.X on 2.6.18?

Why doesn't that seem logical to me?

I have come across a similar error

error: mach_mpspec.h: No such file or directory

trying to build a driver for ubuntu 7.10 with 2.6.22. kernel.

It has previously been built for Fedora 7 with 2.6.24 kernel.

Is there another package that I need to get this to build?

thanks

dan

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.