Integrate rt2500 in kernel sources (patching)

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

Borromini

29-04-2007 04:11:41

Guys I have a possibly unusual request ).

I roll my own kernels usually, but I'd like to do it entirely scripted. I managed to integrate a wireless radio module into the kernel sources i use, so it gets compiled along (and I don't have to compile again it every single time I upgrade my kernel). Now this driver was only one file of source code, whereas rt2500 has quite some -).

I tried to integrate the rt2500 driver into my kernel sources, and the rt2500 driver shows up nicely when I run [code26ta59e7]$ make gconfig[/code26ta59e7].

However, it never gets compiled, if i check my /lib/modules/`uname -r` dir afterwards, there's no rt2500.ko to be found (.

I have done this
1. added the source code (*.{c,h}) in drivers/net/wireless/rt2500 (a subdir)
2. edited Kconfig in drivers/net/wireless, and added this
[code26ta59e7]config RT2500
tristate "Ralink RT2500 PCI/PCMCIA based wireless card"
depends on NET_RADIO && (PCI || PCMCIA)
default m[/code26ta59e7]
3. written a Makefile, based on what the Makefile in the rt2500 sources needs, and placed it in drivers/net/wireless/rt2500
[code26ta59e7]rt2500-objs := rtmp_main.o mlme.o connect.o sync.o assoc.o \
auth.o auth_rsp.o rtmp_data.o rtmp_init.o \
sanity.o rtmp_wep.o wpa.o md5.o rtmp_tkip.o \
rtmp_info.o eeprom.o

obj-$(CONFIG_RT2500) += rt2500.o[/code26ta59e7]

I have checked the prism54 subdir and based my approach on the way it seems to work (since it's the only subdir which doesn't contain a Kconfig file itself, the other wireless drivers subdirs do).

Can someone tell me what I do wrong, and help me out? 8)

Thanks a bunch ;)

Edit nevermind... I just forgot to add a reference to the Makefile in drivers/net/wireless ).

For those interested you can find the patch in attachment (should apply fairly well to recent 2.6 kernels - if not, let me know so i can take it down).

sboyce

29-04-2007 22:28:42

Applies cleanly to 2.6.21, many thanks.

Borromini

29-04-2007 22:31:58

No problem ;). You can just patch the kernel, no need to reconfigure, the driver is set to compile as a module by default.

picard12

06-05-2007 11:05:05

hello, i have tried this patch on my mandriva 2007.1 with a smp 2.6.20.7 kernel (AMD64X2), and i received this error
rt2500ERROR empty Elem in MlmeQueue..

sorry for my bad english
lol

Spy84464

06-05-2007 12:16:12

Hello,
This has been fixed in the CVS, the driver shipped above need be updated.

Regards,
Romain

picard12

06-05-2007 12:42:36

I have seen it, but i'm interested in the kernel-patch to set a personal kernel source..
Tanks
Regards
Christian (from Italy)
PS
I use your driver with my new linksys WMP54G
wink

Zi7

06-05-2007 14:00:18

You should just update the driver files in the above patch. Don't use any CVS sources older than today important fixes have been applied sooner in the morning.

Borromini

14-05-2007 15:57:55

Okay... I was about to post the new patch, but I'll wait a few days ).

For those who are in a hurry, you can get a patch here, from sources from today[/urlpax5eh8n].

Zi7

14-05-2007 16:41:25

Thanks. )

Btw, it's a good idea you wait a few days before doing so as new changes are coming soon...

Borromini

14-05-2007 17:05:57

Okay. Any idea when that will be? )

Zi7

14-05-2007 17:30:20

Vern is supposed to do it.
You'd better ask him. ;)

Vern

15-05-2007 15:49:42

Supposed to do what?

Borromini

24-05-2007 14:19:33

Ok P

ju-rek

27-05-2007 09:08:04

Would make you for but rt2400? D

Borromini

10-07-2007 17:44:27

I'll see what I can do about it, I cannot guarantee an rt2400 patch will work, since i won't be able to test it (i will not compile another kernel with that driver... requires a lot of time). Also, as you can read in my post above, it's really not that difficult to integrate the driver and diff it yourself ;).

In the meantime, here's a new patch available, against 2.6.22, from CVS sources from July 10th, 2007[/urlt6akt2vx].

sboyce

11-07-2007 01:01:27

I'll see what I can do about it, I cannot guarantee an rt2400 patch will work, since i won't be able to test it (i will not compile another kernel with that driver... requires a lot of time). Also, as you can read in my post above, it's really not that difficult to integrate the driver and diff it yourself ;).

In the meantime, here's a new patch available, against 2.6.22, from CVS sources from July 10th, 2007[/url3aly6yul].[/quote3aly6yul]
That doesn't quite do it, seems Kconfig is needed, no config options show up in make xconfig. I also tried the git sources which are for 2.6.22-rc6 for which I get a kernel oops on the rt2500pci module in 2.6.22 - haven't captured the data as serial console isn't attached. Worked with 2.6.22-rc7-git6. I also noticed that 2.6.22-git1 has the stuff in for EEPROM_93CX6 which may cause git patches to fail if added on top of the git.serialmonkey 2.6.22 when it comes out.
rt2500-cvs-2007071019 builds against 2.6.22, rt2500 module installs, no lights come on in Managed or Ad-Hoc mode.
wlan0 RT2500 Wireless ESSID""
ModeAd-Hoc Frequency=2.412 GHz Bit Rate=1 Mb/s
RTS throff Fragment throff
Encryption keyoff
Link Quality0 Signal level136 Noise level113
Rx invalid nwid0 invalid crypt0 invalid misc0
# iwlist wlan0 txpower
wlan0 no transmit-power information.

On other box
============
wlan0 IEEE 802.11b+/g+ ESSID"STAB083D5" Nickname"acx v0.3.36"
ModeAd-Hoc Frequency2.412 GHz Cell Not-Associated
Bit Rate54 Mb/s Tx-Power=15 dBm Sensitivity=1/3
Retry min limit7 RTS throff
Encryption keyoff
Power Managementoff
Link Quality0 Signal level0 Noise level0
Rx invalid nwid0 Rx invalid crypt0 Rx invalid frag0
Tx excessive retries0 Invalid misc0 Missed beacon0

Borromini

11-07-2007 21:01:29

The Kconfig can either be the main one, or the one in the subdir. Up till now I used the main one, and except for fixing it up to patch against the latest stable kernel, I didn't touch it (it worked fine before).

I'll look into it.

Edit It is not showing op in any of the cases - not with the old patch, not with the new one. I skimmed through the options, seems zd1211rw isn't there either, although it is specified in the Makefile & Kconfig in the drivers/net/wireless dir.

Very bizarre.

Borromini

12-07-2007 15:03:03

Found the culprit.

I had the patch depend on the NET_RADIO option which has been taken out of 2.6.22. So nothing wrong with the patch itself, apart from that ;).

Here is a new one with today's sources.[/url373c08to]

sboyce

13-07-2007 07:22:38

Found the culprit.

I had the patch depend on the NET_RADIO option which has been taken out of 2.6.22. So nothing wrong with the patch itself, apart from that ;).

Here is a new one with today's sources.[/url1xsar4yz][/quote1xsar4yz]
"drivers/net/wireless/Makefile" needs the line
obj-$(CONFIG_RT2500) += rt2500/

sboyce

13-07-2007 07:49:38

Is it significant that the lights do not flash with the rt2500 patch? With full sources as in git 2.6.22-rc6, the lights on the card are always lit and at intervals will flash. "iwlist scan" also reports that the "Interface doesn't support scanning". I also notice that Utilsys directory in the CVS is empty, presumably the standard wireless tools are OK as the interface is now wlan0 instead of the previous ra0.

Borromini

13-07-2007 14:36:55

My patch just integrates driver sources.

As the utility is a stand-alone app and no part of the kernel, I do not see why it should be included in the patch.

As for your lights I cannot tell. Maybe you need the old wlan stack support stuff. The driver depends on the old wlan stack, but I did not know how far to go with the 'dependencies', so I included some (hopefully sane) defaults
[code1npl85kt]+config RT2500
+ tristate "Ralink RT2500 PCI/PCMCIA based wireless card"
+ depends on (PCI || PCMCIA) && WLAN_80211
+ select WIRELESS_EXT
+ select IEEE80211[/code1npl85kt]

However, if the devs can tell me on which functions the driver relies (since that is not required to be in the Kconfig file for standalone compilation, but is for kernel-integrated compilation), I'd be most happy to hear. I am familiar enough with C code to fix up broken patches more or less, but that's about it. Analysing 'large' chunks of code is not my forte.

Found the culprit.

I had the patch depend on the NET_RADIO option which has been taken out of 2.6.22. So nothing wrong with the patch itself, apart from that ;).

Here is a new one with today's sources.[/url1npl85kt][/quote1npl85kt]
"drivers/net/wireless/Makefile" needs the line
obj-$(CONFIG_RT2500) += rt2500/[/quote1npl85kt]

This is in the patch

[code1npl85kt]diff -Naur linux-2.6.22/drivers/net/wireless/Makefile linux-2.6.22-new/drivers/net/wireless/Makefile
--- linux-2.6.22/drivers/net/wireless/Makefile 2007-07-09 01:32:17.000000000 +0200
+++ linux-2.6.22-new/drivers/net/wireless/Makefile 2007-07-12 17:00:20.000000000 +0200
@@ -44,3 +44,5 @@

obj-$(CONFIG_USB_ZD1201) += zd1201.o
obj-$(CONFIG_LIBERTAS_USB) += libertas/
+
+obj-$(CONFIG_RT2500) += rt2500/
[/code1npl85kt]

I did not change anything...

IvD

13-07-2007 14:42:59


As for your lights I cannot tell. Maybe you need the old wlan stack support stuff (the driver depends on the old wlan stack,
[/quoteeuxulg2o]

Since when?
Legacy drivers depend have an internal stack, this makes sense since the legacy drivers support 2.4 kernels and early 2.6 kernels which don't even have a wireless stack inside.

The legacy drivers depend on 2 things
- Wireless-extensions
- Support for the Device bus (PCI or USB)

And that is all, the rest it all handles inside the driver itself

Borromini

13-07-2007 14:54:42

Well, that was what I presumed ?. I did see a 2.4 dir inside the tarball but never paid attention to it... I never 'actively' ran a 2.4 kernel (never compiled one of those myself), so I had no clue ). I thought they relied on the old wireless stack, but it seems not even that was true.

Thanks for the hint, that means I can take out the IEEE80211 line. I'll add an USB one.

IvD

13-07-2007 14:58:16

Well for rt2500 the following is sufficient
depends PCI && WIRELESS_EXT

For rt2570 the following
depends USB && WIRELESS_EXT

Borromini

13-07-2007 15:01:53

Cool, thanks. The rt2500 has PCMCIA implementations too, no?

I think it makes sense to keep it (PCI || PCMCIA) && WIRELESS_EXT then.

IvD

13-07-2007 15:14:59

Nope there is absolutely no PCMCIA code within the drivers,
so there is no need to depend on it. PCMCIA can be considered as a kind of PCI which means that the PCI subsystem will take care of everything.

Borromini

13-07-2007 15:15:46

Ok. Sry for the slow chat btw P.

New patch (same source date) available here[/url2h8yfj2b].

ferix

04-12-2007 17:22:37

Hmm...

The link seems to be broken...

Can anybody fix it???

Spy84464

06-12-2007 12:43:53

Hello,
This is not provided by us, we have no way to fix this. You should try to contact the poster directly.

Regards,
Romain

Borromini

03-02-2008 20:37:31

I have posted a new patch here[/url1osua3rz], based on the 2008020310 CVS. Since I use the rt2x00 drivers that are in the kernel right now (2.6.24), I will not be maintaining this package anymore. All you need to do if you want to update it is replace the source code, that's all there's to it, and rediff against a vanilla tree to obtain a new patch.