error unknown field get_wireless_stats

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=3799

dtgorm

13-05-2007 19:46:56

Kernel 2.6.9-42.EL-smp-i686
Dist Centos4 (default install - no updates applied yet)
Hardware HP Pavilion a1310y (P4 w/ HT) Linksys WMP54G v4

Driver Version rt2500-cvs-2007051313 and rt2500-1.1.0-b4

The problem i keep getting is with running make

[code2460fhpz]
# make
make[1]: Entering directory `/usr/src/kernels/2.6.9-42.EL-smp-i686'
CC [M] /tmp/rt2500-cvs-2007051313/Module/rtmp_main.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/mlme.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/connect.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/sync.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/assoc.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/auth.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/auth_rsp.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/rtmp_data.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/rtmp_init.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/sanity.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/rtmp_wep.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/wpa.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/md5.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/rtmp_tkip.o
CC [M] /tmp/rt2500-cvs-2007051313/Module/rtmp_info.o
/tmp/rt2500-cvs-2007051313/Module/rtmp_info.c:603: error: unknown field `get_wireless_stats' specified in initializer
/tmp/rt2500-cvs-2007051313/Module/rtmp_info.c:603: warning: initialization from incompatible pointer type
make[2]: *** [/tmp/rt2500-cvs-2007051313/Module/rtmp_info.o] Error 1
make[1]: *** [_module_/tmp/rt2500-cvs-2007051313/Module] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.9-42.EL-smp-i686'
rt2500.ko failed to build!
make: *** [module] Error 1
[/code2460fhpz]

Im pretty lost at this point as to where to go next. I have been researching for 2 days now so here i humbly come for assistance.

dtgorm

13-05-2007 20:37:38

Also, booted to 2.6.9-42.EL and still get the same error

serialmonkey

13-05-2007 23:16:37

My guess is that we have an issue compiling against such an old kernel.

I assume you can't upgrade to something newer ?

If you can't let us know and we will look into it.

dtgorm

14-05-2007 01:26:55

I was thinking it was something with my kernel. How old is my kernel actually? What version would I want to move to?

I have never messed with the kernel so it would be something new for me. I do really wan to get wireless working so im willing to experiment.

Vern

14-05-2007 15:42:55

Hi dtgorm,

I' m confused about

"Driver Version rt2500-cvs-2007051313 and rt2500-1.1.0-b4"

Maybe Mark can help here Does 2007051313 mean 2007 May 13? What does the last 13 mean? Does this number come from us or does it come from CentOS?

Anyway, in the current CVS, the failing line has to do with a structure that sets up wireless statistics, which I believe is not correctly done in the (by now old) beta. Could you try the latest CVS?

Thanks,

Zi7

14-05-2007 16:56:49

I' m confused about
"Driver Version rt2500-cvs-2007051313 and rt2500-1.1.0-b4"
Maybe Mark can help here Does 2007051313 mean 2007 May 13?[/quote2khkfyl0]
Yes.
What does the last 13 mean?[/quote2khkfyl0]
It's the release hour stamp, as tarballs are rebuilt every hour.

Anyway, in the current CVS, the failing line has to do with a structure that sets up wireless statistics[/quote2khkfyl0]
struct iw_handler_def does not have a get_wireless_stats field in old versions of iw_handler.h

(...) which I believe is not correctly done in the (by now old) beta. Could you try the latest CVS?[/quote2khkfyl0]
Both versions do the same[code2khkfyl0]#if WIRELESS_EXT > 16
.get_wireless_stats = RT2500_get_wireless_stats,
#endif
[/code2khkfyl0]
It seems we have the WIRELESS_EXT version wrong or undefined.

Zi7

14-05-2007 19:22:38

I have never messed with the kernel so it would be something new for me. I do really wan to get wireless working so im willing to experiment.[/quote21sbwwr2]
Your linux distribution (CentOS) probably allows you to update your kernel (or your whole system) in a seamless way.
I do _not_ mean to say you should not experiment, but if you don't want to spend too much time on this that's your best option. )

How old is my kernel actually? What version would I want to move to?[/quote21sbwwr2]
If you choose the easy solution, the one your distribution will provide should be just fine.
If you choose to install and recompile your own kernel, any current snapshot you might get will probably be fine as well.

Vern

15-05-2007 01:16:00

Hi dtgorm,

As Zi7 noted, the problem isn't with the beta release.

As provided by kernel.org, he symbol WIRELESS_EXT lives in wireless.h (i.e. <path-to-your-kernel-source>/include/linux/wireless.h). If it has a value greater than 16, then you should be able to expect the structure iw_handler_def (defined in <path-to-your-kernel-source>/include/net/iw_handler.h) to have a get_wireless_stats member that returns a pointer to a iw_statistics structure.

Could you check those two files in the source as provided by Centos to see that they are present and have the indicated content?

Thanks,

caster

16-11-2007 15:14:27

Hello,

Didn't want to create another topic about the same stuff, so I'm using this old one... hope it's not a problem.

I was trying to install this driver on my machine and came across the same error dtgorm has described. Everything works just fine until the point gcc says that there's an "unknown field" named "get_wireless_stats".
I looked at the rtmp_info.c source code to see the definition of that structure, and, yep, as Zi7's already said, there's indeed a #if WIRELESS_EXT > 15. But the definition of the field get_wireless_stats is not within that #if/#endif block, there's only a commented bit of code in there...

Maybe my driver version is too old, dunno... I got a package from [url1n84awyi]http://packages.debian.org/etch/rt2500-source[/url1n84awyi]. Its name is rt2500-source(1.1.0+cvs20060620-3). Oh, by the way, I'm using Debian kernel version 2.4.27-2-386, and, unfortunately, upgrading the Kernel is not an option for a number of reasons... =/.

Is there anyway I could get the driver to work properly in this old piece of kernel?

Thanks in advance. Any help would be very, very useful, since I'm stuck at this point where I don't have any clues to what to do next...

p.s. - I'm putting the problematic bit of the code here, just in case...
[code1n84awyi]const struct iw_handler_def rt2500_iw_handler_def =
{
#define N(a) (sizeof (a) / sizeof (a[0]))
.standard = (iw_handler *) rt_handler,
.num_standard = sizeof(rt_handler) / sizeof(iw_handler),
.private = (iw_handler *) rt_priv_handlers,
.num_private = N(rt_priv_handlers),
.private_args = (struct iw_priv_args *) privtab,
.num_private_args = N(privtab),
.get_wireless_stats = RT2500_get_wireless_stats,
#if WIRELESS_EXT > 15
// .spy_offset = offsetof(struct hostap_interface, spy_data),
#endif /* WIRELESS_EXT > 15 */
};[/code1n84awyi]

Oh, and I'm a complete kernel newbie... =P

Vern

16-11-2007 17:30:27

Hi caster,

After you log off, or before you log on, click on the download tab at the top of the forum page, download the CVS tarball for the legacy rt2500 driver, and see what happens when you compile.

caster

19-11-2007 12:01:55

Hello Vern,

Well, I have downloaded the file you've told me to. When I compile the source codes I get all these strange errors concerning the kernel-2.x.x libraries... The strange fact is that when I use module-assistant's auto-install utility I don't get any error like that at all, just the one stated in my first post. Do you think it will be possible to install the driver without having to upgrade the kernel?

Thanks

Vern

19-11-2007 17:48:04

The driver compiles for me under 2.4.27 just fine. Note that if you're using gcc 4 or better to build the kernel itself, then you need to apply the linux-2.4-seg-4.patch, available from kernel.org.

"... get all these strange errors" is not helpful. Try attaching a copy of the build errors to a posting here. hint
[codencfhkq9m]make clean all 2>errs[/codencfhkq9m]
then gzip "errs" and attach it to your post. But first, make sure you have a copy of the kernel headers for the kernel version you are targeting.

caster

22-11-2007 12:03:27

Yeah, I do have the right version of the kernel libraries but they're not working with gcc, dunno why. I think I just didn't do something important in order to make them work =P, that's the problem of being a linux newbie roll
Well, when I used the [i16ll4coy] module-assistant auto-install[/i16ll4coy] command there were no errors concerning the kernel-libs at all. But when I try to include, for example, asm/atomic.h in a simple hello world program, gcc goes crazy printing errors and warnings at the screen.

Here is the gziped file with "errs", containing the errors I stumbled across while trying to make the driver.

Thanks a lot )

Vern

23-11-2007 18:40:34

Apply the patch I referred to in my previous post. Not library patch.