Netgear MA521 under Centos 4.2
30OC05, J.R. Buchanan
Recently I acquired a used Netgear MA521 802.11b pcmcia wireless network card for my Toshiba laptop, which is currently dual booting Windows XP and Centos 4.2 (a free version of RedHat Enterprise Linux version 4, update 2). Centos 4.x uses a 2.6.x kernel, which is needed for this driver. It is mentioned that with some hacking, a 2.4.x kernel might be used, but personally, I'd upgrade to a newer kernel first. most likely by installing a newer distribution.
Of course, the supplied drivers and utility software worked in Windows, but I wanted to use the card in Linux.
A little searching located an alpha release driver at:
http://sourceforge.net/projects/rtl8180-sa2400
This is what it took to get it working on my machine.
I'm writing this in October 2005, since the driver is still under development, these directions may become obsolete at any point. Hopefully even if they are not correct in every detail in the future, they will be of some use.
First I downloaded the driver. I got a file called rtl8180-0.21.tar.gz This is version 0.21 of the rtl8180 driver. This is for wireless cards that use the Realtek 8180 chip and and a Philips, Maxim, or GCT radio. This includes my Netgear card.
First I unpacked the file with "tar -xzf rtl8180-0.21.tar.gz" and cd'd into the resulting rtl8180-0.21 directory.
I read the INSTALL file and the README.master file.
They provided a lot of good information that helped get the card up, but did not do so in a clear step by step manner. Part of the INSTALL file was in clear step by step, but not everything was, and two important steps were left out. This is certainly forgivable and even expected in an alpha release.
Then I made the driver files by issuing a "make" command. Everything was built with no problems.
Then I ran a "sudo make install", which was left out of the directions.
Later I discovered that at this point it was time to cd into the "/lib/modules/[kernel-version]" directory and run a "sudo depmod" command. Knowing this sooner would have made writing the wlan_up script easier. This was not mentioned in the directions.
Then I played around with the commands in the INSTALL and README.master files until I had the card working. I then boiled it all down to a script that I called "/usr/sbin/wlan_up". Now when I want to enable the card, I type "sudo wlan_up".
Here is the script:
#!/bin/bash # depmod must be run in /lib/modules/[kernel-version] after modules # are installed and before this is run # why the -v if we are sending it to /dev/null? # this line taken from module documentation modprobe -v crc32 > /dev/null 2>&1 modprobe ieee80211_crypt-r8180 modprobe ieee80211_crypt_wep-r8180 modprobe ieee80211-r8180 modprobe r8180 iwconfig wlan0 essid [your-ssid] iwconfig wlan0 key [your-long-string-of-hex-key] ifconfig wlan0 broadcast 192.168.2.255 netmask 255.255.255.0 192.168.2.200 route add default gw 192.168.2.1 dev wlan0
Substitute your ssid and your wep encryption key. I read the hex for the key from my wireless router, it generated it after I entered a pass phrase.
Substitute your broadcast address, netmask, and desired IP address. Note that I am not currently using DHCP. If I start doing so, I'll update this article. Substitute your default gateway.
Running "sudo wlan_up" now brings up my wireless connection.
When I first installed the Netgear card, it was not detected at boot time. After I ran the "depmod" command, it was. Since I already had a script that brought it up, I told the system to ignore it and not do any configuration. Another route to getting the card to work might be to do the "make", "sudo make install", "sudo depmod", then allowing the system to configure the card. I didn't go down that path, so I can't help with it.
While I was testing things, there were times when i wanted to shut the card down and remove the modules. I wrote this script for that:
#!/bin/bash ifconfig wlan0 down rmmod r8180 rmmod ieee80211-r8180 rmmod ieee80211_crypt_wep-r8180 rmmod ieee80211_crypt-r8180
It doesn't get much use now that everything is working.
Note that to use sudo, you must have an entry in the /etc/sudoers file for the account that you will be working from. Something like this as the last line of the file:
jbuchana ALL=(ALL) ALL
Substitute your username for jbuchana
Also, I assume that "/usr/sbin" is in your PATH.
