[Techtalk] Error installing the driver of my 10/100MB Ethernet card

Malcolm Tredinnick malcolm at commsecure.com.au
Fri Nov 8 16:56:20 EST 2002


This is really in response to your subsequent request for debugging
ideas, but I need to quote the makefile output, so I'm responding in
this thread.

I could not get to the link you posted subsequently for the source of
the driver (various errors; possibly I need  a better wet piece of
string to connect me to the 'net). So I have to guess a little bit.

On Tue, Oct 29, 2002 at 11:10:25AM -0800, Samer Yhya wrote:
> make full output:
> -----------------
> 
> [root at localhost linux-2.4.x]# touch *
> [root at localhost linux-2.4.x]# make clean
> rm -f *.o
> [root at localhost linux-2.4.x]# make
> gcc -DMODULE -D__KERNEL__  -I/usr/src/linux/include -O
> -Wall -Wstrict-prototypes   -c -o pci-scan.o
> pci-scan.c
> In file included from /usr/include/linux/fs.h:23,

First possible danger sign: if you are building a kernel module, it
should not be referring to headers outside of the kernel source tree.
Now, if this is a completely standard Red Hat install, then you are
probably fine here, since the header files in /usr/include/linux will
match those of your currently running kernel. However, that may not
always be the case. So possibly there's a small error in the Makefile,
but it's hard to say.

>                  from
> /usr/include/linux/capability.h:17,
>                  from /usr/include/linux/binfmts.h:5,
>                  from /usr/include/linux/sched.h:9,
>                  from /usr/include/linux/mm.h:4,
>                  from pci-scan.c:62:
> /usr/include/linux/string.h:8:2: warning: #warning
> Using kernel header in userland!

This is not a real warning, so don't be too woried about it. Again, you
are building a kernel module, so you are allowed to use kernel header
files, although I would have preferred to see it including
/usr/src/linuc/include/linux/string.h (see above).

> In file included from /usr/include/linux/sched.h:14,
>                  from /usr/include/linux/mm.h:4,
>                  from pci-scan.c:62:
> /usr/include/linux/timex.h:173: field `time' has
> incomplete type

This is a bug (possibly in pci-scan.c). If you look in timex.h at the
line it is complaining about, you see that it needs the timeval
structure. This is defined in <linux/time.h>, however that file is not
included by either mm.h or sched.h. So pci-scan.c needs to include
<linux/time.h> before include <linux/mm.h>.

I suspect that if you can work out what is causing this problem and then
fix it, a lot of your subsequent problems will disappear. You might try
adding

	#include <linux/time.h>

to pci-scan.c just before it does #include <linux/mm.h>, but I don't
know if that will fix it or not (since I'm debugging without any code
and don't really have much tiem to devote to this problem right now).

> In file included from /usr/include/linux/bitops.h:69,
>                  from /usr/include/asm/system.h:7,
>                  from /usr/include/linux/sched.h:16,
>                  from /usr/include/linux/mm.h:4,
>                  from pci-scan.c:62:
> /usr/include/asm/bitops.h:333:2: warning: #warning
> This includefile is not available on all
> architectures.
> /usr/include/asm/bitops.h:334:2: warning: #warning
> Using kernel headers in userspace.
> In file included from /usr/include/linux/signal.h:4,
>                  from /usr/include/linux/sched.h:25,
>                  from /usr/include/linux/mm.h:4,
>                  from pci-scan.c:62:
> /usr/include/asm/signal.h:107: parse error before
> "sigset_t"

I don't really understand what is causing these parsing errors. They are
kernel include files, so they certainly build.

Things have gone heavily off the rails by this point and all the
following errors are symptoms of the same cause. I don't know what the
problem is, but somehow the including of one file has gone awry. At that
point, the compiler sort of tries to recover, but things continue to go
screwy.

[..Lots of similar lines snipped..]
> pci-scan.c:187: `KERN_INFO' undeclared (first use in
> this function)

Yep... the wagon's gone over the cliff and flaming wheels are bouncing
everywhere. KERN_INFO is defined in kernel.h, so things are still
careering out of control. There's no problems with the pci-scan.c file
at this point. All of these errors are consequences of some earlier
problem and a failure to recover (which is hardly surprising).

The above may give you some ideas (or at least help you read similar
error messages in the future).

Cheers,
Malcolm

-- 
Depression is merely anger without enthusiasm.



More information about the Techtalk mailing list