Realtek rtl8180 in Fedora Core 4
Before I upgraded to FC4 I was using the ndiswrapper drivers for my el'cheapo Netcomm NP7032 802.11b WiFi PCMCIA card - and I felt dirty because of it.
Come FC4 I found that my ndiswrapper config got blown away by the upgrade, so I embraced the change and went hunting again for suitable, Open Source drivers.
It turns out that the folks at http://rtl8180-sa2400.sourceforge.net/ have tackled the task and done admirably. I built the modules with some assistance from the forums - there were one or two patches to make to the sources before they compiled cleanly with gcc4 on a 2.6.12 system. Unfortunately I haven't found a source of rpms for the drivers and lack the time to package it myself so a src build was the best route, although I prefer to build packages where possible. All looked good, the modules loaded, and a one-off manual config worked fine.
Ahh, well... there's the rub. Manually setting up the nic using "ifconfig wlan0 up" then "iwconfig wlan0 essid myesssid", followed by "dhclient wlan0" all worked ok, bringing it up and onto my home network. The problem was that the system's ifup scripts just wouldn't play ball. Every time I tried to bring the interface up it failed with "Determining IP information for wlan0... failed; no link present. Check cable?" *sigh*.
Working out why took a bit of work. At first I thought I had driver problems, as I was getting these in my dmesg:
"rtl8180: EE: TX buffer error, cannot TX frames"
But after those messages it goes on to find and associate with the accesspoint. Googling the message indicated that if this was the problem, I was the only sucker on earth to have it. Based on that I figured it was not the problem, we continue...
I found that the ifup scripts were using mii-tool and ethtool to try and see if the link was up, via a function in network-functions called "check_link_down".
Well of course, I have religious issues with plugging a cable into a wireless card, so I wanted to teach the system that wifi cards don't do "link stuff" as far as mii-tool and ethtool are concerned.
The options were:
- Educate ethtool or mii-tool about wifi "links"
- Educate check_link_down in network-functions about wifi
- Educate ifup-eth about the folly of running check_link_down on wifi links
No prizes for guessing the route I took :-)
My primary goal (after getting the thing working at all) was that any modification should preferably reside in a configuration file or a script in /usr/local (did you know there can be an ifup-pre-local?), so that I didn't have to worry about my fix being blatted by the next update. There was an easy cheat to hand, one that I have since seen around the place used with other cards that don't support link-reporting very well.
Crack open /etc/sysconfig/ifcfg-wlan0 and add this to it somewhere:
Effectively this replaces the check_link_down function defined in /etc/sysconfig/network-scripts/network-functions with one that just says "oh yeah, we do that". This only applies to that interface though, so my link-checking on eth0 and the like still works properly, and the hack lives in a local config file, so it shouldn't get blatted away by future updates. It's a clean(ish) hack that leaves your system in a "distro-compliant" state, which is pretty important generally as far as being able to do clean updates and avoiding dependency issues goes.
The "Real" fix would be along the lines of altering ifup-eth to not run the link-check if it's a wireless device, but I don't know if that applies equally to all wireless nics, as I didn't have this problem with the ndiswrapper driver, and I suspect that many others haven't had this problem with other drivers, so maybe it's the r8180 driver itself that is a little different. Just happy to have it working.
Now that I am fully untethered, I can walk around the house with my M300 notebook, typing at 3% efficiency and getting cramped legs juggling the thing on the lounge, yay.