[vortex] RE: [3c509] Compile time error on SuSE 9 with latest netdrivers.tgz file
Kevin Martin
kevintm@ameritech.net
Thu Mar 4 18:02:01 2004
Don't know if this ever got posted but...
Oh, and I managed to make this work by replacing all of the HZ variable
instances in the .c files with 100. It then compiled and I was able to load
it with modprobe. Not the best workaround but no choice at this time.
Regards,
Kevin Martin
kevintm@ameritech.net
-----Original Message-----
From: Kevin Martin [mailto:kevintm@ameritech.net]
Sent: Thursday, January 29, 2004 4:24 PM
To: 'Donald Becker'
Cc: '3c509@scyld.com'; 'vortex@scyld.com'
Subject: RE: [3c509] Compile time error on SuSE 9 with latest
netdrivers.tgz file
Oops, I'm now guessing, based on the Makefile, that I'm using the following
param.h file:
/lib/modules/2.4.21-166-default/build/include/asm/param.h
::::::::::::::
#ifndef _ASMi386_PARAM_H
#define _ASMi386_PARAM_H
#ifdef __KERNEL__
#define DESKTOP_HZ 1000
#define USER_HZ 100 /* default (user level) HZ */
#include <linux/hz.h>
#endif /* __KERNEL__ */
#define EXEC_PAGESIZE 4096
#ifndef NGROUPS
#define NGROUPS 32
#endif
#ifndef NOGROUP
#define NOGROUP (-1)
#endif
#define MAXHOSTNAMELEN 64 /* max length of hostname */
#endif
This is obviously NOT the same as the param.h that Mr. Becker was expecting.
Is this not a valid param.h file or do I need to adjust the make somehow?
If I try to put /usr/include in the include path in the makefile I get a
bunch of other errors about using the correct include files that belong w/
the OS that I'm trying to build on.
By the way, the <linux/hz.h> file contains this:
#ifndef _LINUX_HZ_H
#define _LINUX_HZ_H
#include <linux/config.h>
#include <linux/kernel.h>
extern unsigned long __HZ;
static inline unsigned long get_hz(void)
{
#ifdef CONFIG_DEBUG_HZ
if (unlikely(!__HZ)) {
__label__ here;
printk("early HZ: %p\n", &&here);
here:
init_HZ(USER_HZ);
}
#endif /* CONFIG_DEBUG_HZ */
return __HZ;
}
#define HZ get_hz()
#define CLOCKS_PER_SEC (USER_HZ) /* like times() */
#define jiffies_to_clock_t(x) (likely((HZ) >= (USER_HZ)) ?
\
(x + ((HZ) / (USER_HZ)) - 1) / ((HZ) /
(USER_HZ
)) : \
(x) * ((USER_HZ) / (HZ)))
#define user_to_kernel_hz(x) (likely((HZ) >= (USER_HZ)) ?
\
(x) * ((HZ) / (USER_HZ)) :
\
(x + ((USER_HZ) / (HZ)) - 1) / ((USER_HZ) /
(HZ
)))
#define user_to_kernel_hz_overflow(x) ((x + USER_HZ - 1) * (HZ) /
(USER_HZ))
#endif /* _LINUX_HZ_H */
What now oh 3c59x gurus????
Thanks for the help.
Regards,
Kevin Martin
kevintm@ameritech.net
-----Original Message-----
From: Donald Becker [mailto:becker@scyld.com]
Sent: Thursday, January 29, 2004 1:24 PM
To: Kevin Martin
Cc: 3c509@scyld.com; vortex@scyld.com
Subject: Re: [3c509] Compile time error on SuSE 9 with latest netdrivers.tgz
file
On Wed, 28 Jan 2004, Kevin Martin wrote:
> To: 3c509@scyld.com
This should be sent to the vortex@scyld.com mailing list.
> Subject: [3c509] Compile time error on SuSE 9 with latest netdrivers.tgz
> file
>
> SuSE Kernel revision is 2.4.21-166-default.
>
> I'm receiving the following error when trying to build the latest
> 3c59x
> driver:
>
> make KERNVER=`uname -r`
> cc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6
> -I/lib/modules/2.4.21-166-default/build/include/ -pipe
> -fno-strength-reduce -DMODVERSIONS -c -o 3c59x.o 3c59x.c
> 3c59x.c:600: error: initializer element is not constant
> 3c59x.c:600: error: (near initialization for `media_tbl[0].wait')
Hmmm, it looks as if you are running a modified kernel.
The likely element in common here is 'HZ', which should be defined as a
constant in
/usr/include/asm/param.h
The first few lines of the file should have
#ifndef HZ
#define HZ 100
#endif
--
Donald Becker becker@scyld.com
Scyld Computing Corporation http://www.scyld.com
914 Bay Ridge Road, Suite 220 Scyld Beowulf cluster systems
Annapolis MD 21403 410-990-9993