error: implicit declaration of function 'pci_module_init'

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

binarybob0001

07-11-2007 08:19:23

Make gives me this error when I try to compile the driver. Here's a complete log of the make process
[code3ot4uubk]
root@Veronica:/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module# make
make -C /lib/modules/2.6.23.1/build SUBDIRS=/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module modules
make[1]: Entering directory `/usr/src/linux-2.6.23.1'
CC [M] /home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.o
/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.c: In function 'RT61_probe':
/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.c:200: error: 'struct net_device' has no member named 'wireless_handlers'
/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.c: In function 'RT61_open':
/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.c:330: warning: 'deprecated_irq_flag' is deprecated (declared at include/linux/interrupt.h:64)
/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.c:330: warning: passing argument 2 of 'request_irq' from incompatible pointer type
/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.c: In function 'rt61_init_module':
/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.c:900: error: implicit declaration of function 'pci_module_init'
make[2]: *** [/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.o] Error 1
make[1]: *** [_module_/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.23.1'
make: *** [all] Error 2
[/code3ot4uubk]
Any idea of how I can fix this?

binarybob0001

07-11-2007 08:20:22

I'm using Slackware 12.0 with custom built kernel 2.6.23.1

binarybob0001

07-11-2007 15:26:33

I got this to compile just fine on Slackware's default 2.6.23.1-smp kernel. Could the 2.6.23.1 kernel have removed something need from the source?

Starcrasher

07-11-2007 23:47:40

Is it me or are you posting here a question about the driver made by Ralink ?
For question relative to Ralink drivers, please contact Ralink.
On this forum, you will find help for drivers available on this site[/url15zifym4] only.
You could start by trying the rt61 CVS version. wink

binarybob0001

08-11-2007 01:11:16

OK, here's what happened when I tried to compile the latest tarball. Sorry, but I'm anxious to get this computer running so I can put it back in the living room. Whatever the kernel developers did, they changed something significant. Just out of curiosity (not that I'll actually be able to fix the problem) how do I figure out what change they made?

make[1] Entering directory `/usr/src/linux-2.6.23.1'
CC [M] /home/bobby/rt61-cvs-2007110718/Module/rtmp_main.o
/home/bobby/rt61-cvs-2007110718/Module/rtmp_main.c In function 'rt61_pci_probe'
/home/bobby/rt61-cvs-2007110718/Module/rtmp_main.c808 error 'struct net_device' has no member named 'wireless_handlers'
make[2] *** [/home/bobby/rt61-cvs-2007110718/Module/rtmp_main.o] Error 1
make[1] *** [_module_/home/bobby/rt61-cvs-2007110718/Module] Error 2
make[1] Leaving directory `/usr/src/linux-2.6.23.1'
rt61.ko failed to build!
make *** [module] Error 1

Spy84464

10-11-2007 10:48:42

This is weird, there should be no difference between 2.6.23.1 and 2.6.23.1-smp, or not of that kind. Is that kernel compiled with wireless extensions enabled?

binarybob0001

15-11-2007 09:25:44

I finally just gave up a and got a new wireless card.

mrkaos

19-11-2007 13:41:46

Hi there rt61 users!!!! I'm new to wireless networking but I think I might be able to help with this one. My card looks like this with a lspci

[codenbrxl1h1]03:01.0 Network controller: RaLink RT2561/RT61 rev B 802.11g[/codenbrxl1h1]

First this,

[codenbrxl1h1]/home/bobby/2007_1003_RT61_Linux_STA_v1.1.1.0/Module/rtmp_main.c:900: error: implicit declaration of function 'pci_module_init' [/codenbrxl1h1]

You will need to be in the Module directory and jump to line 900 or whatever line in rtmp_main.c troubling you (YMMV) and change the following line,

[codenbrxl1h1]return pci_module_init(&rt61_driver);[/codenbrxl1h1]

to this

[codenbrxl1h1]return pci_register_driver(&rt61_driver);[/codenbrxl1h1]

This is because (I think) pci_module_init is deprecated, but that won't be the end of it. You will have to find the following line (477 for me) in rtmp_data.c

[codenbrxl1h1]skb->mac.raw = skb->data;[/codenbrxl1h1]

and comment this line out as such (/* and */ encloses a c comment) or delete it

[codenbrxl1h1] /*skb->mac.raw = skb->data;*/[/codenbrxl1h1]

I was using the 2.6.23.1 kernel and I can't see pci_init_module coming back so one of the developers of the code will probably have to change that. I'm not real sure about the skbuff structure, I looked for a mac structure but my c coding is kinda rusty, we probably want the mac address in there somewhere.

Hope this helps out someone - YMMV - but my rt61 card ( a dlink dwl-G510) works great and am using it to submit this. D