A description of how I got the Realtek 8180 wireless ethernet pcmcia card to work in Linux

I bought the cheapest possible wireless network pcmcia card for $16.50 ($12 + $4.50 shipping, no tax). I found a few vendors at Pricewatch selling cards this cheap. The card came with an instruction manual (a 20 page 5" x 3" foldout) and a CD, no Linux drivers or documentation included. The card, CD, and manual had no hint of a manufacturer or brand name. I had expected a card with an ADMTek chipset because of the similarity of the name the vendor had given it with what I found on the Internet. I had downloaded and built the latest Linux driver for an ADMTek card. But the vendor had invented the name: the stuff that arrived had no name. I could not identify the card: the pcmcia utilities revealed nothing about it. (I could have discovered the manufacturer by looking up the FCC ID.)

Someone stole this computer and card. When I replaced it I got a different card. I can no longer test proposed configurations.

It fails often, perhaps most of the time. I may discard it. Until someone writes a GPL driver I recommend paying the extra $10-$15 for a card with a chipset that we know works well with Linux.
Postscript: my particularly cheap card has only one antenna. This makes it more sensitive to orientation than a card with two antennas. When placed close enough to the wireless router this card works 100%.

I use Linux kernel version 2.4.19. I get my source from Slackware. A fellow sent me a message claiming this Realtek driver fails with kernel version 2.4.22 for him but works with 2.4.20. Take this hearsay as you like - perhaps as another reason to get a card with an open-source driver. Another correspondent reported: 'I'm using a Dell Inspiron 3500 and Slackware 9.0 with kernel 2.4.21 (latest security patches from slackware) and running the precompiled binary from Realtek for kernel 2.4.20 with no problem other than warning messages about kernel versions.'



Identifying the card, finding drivers

To identify the card I booted into Microsoft's Windows® program and installed the drivers. They worked. They identified the card as a Realtek 8180. Go to Realtek's ftp site and choose the package most likely to work for you: rtl8180_linuxdrv_v15_fedora3.zip, rtl8180_linuxdrv_v15_rh90.zip, rtl8180_linuxdrv_v15_rh73.zip, or ?? ('rh' stands for RedHat). It comes with a portion already built that probably has 'priv' or 'private' in its name. Unfortunately its author has not kept up with the changes in pcmcia support in the Linux kernel so you may find that it does not work in kernel 2.6.*. Try the drivers at SourceForge instead. The package in the archives works with my generic card, kernel 2.6.14.3 (2005 December 6).

I spent a long time fiddling around getting it to work, partially because of the deficiencies of its documentation, partially because of deficiencies in the driver. Had I known what I know now it would have taken me only a few minutes more than getting any other card to work.


The card uses only private interfaces

In the first place it does not use the public interface Jean Tourrilhes' excellent wireless tools uses so one cannot use iwconfig. One must use iwpriv (also from Jean Tourrilhes) to address the card's private interface.


Unclear Success Message

Second, when one uses the private interface, with, for example, the channel command:

iwpriv wlan0 wlan_para channel=1

it returns:

RTL8180: Use RTL private command [channel]

which looks like it has told one to use a private command to the card. In fact it tells one that one has successfully used the command. If one gets it wrong (such as an invalid command, no argument, or invalid argument) it returns a more informative error message. I suspect the author, not a native English speaker, may not understand the ambiguity of the success message.


Undocumented Command to set the Network Name

Third, neither the readme nor iwpriv wlan0 wlan_para help tell one about the command to set the network name,

iwpriv wlan0 wlan_para ssid=YourNetworkNameHere

Until I used this command it did not get the network name right. I could tell only because when it does not connect it returns this error message:


RTL8180: Start an IBSS network at channel 1
IBSSJoin(): Please check out the following ...
IBSSJoin(): BSSID = 0x02:0xb9:0xad:0xb5:0x43:0x0a
IBSSJoin(): SSID = aptest2
IBSSJoin(): dot11BeaconPeriod = 100
IBSSJoin(): dot11DtimPeriod = 0
IBSSJoin(): dot11OperationalRates = 0x0f
IBSSJoin(): mCap = 0x02
RTL8180: Act_UpdateBeaconFrame......
RTL8180: TIM_setup......
RTL8180: Searching IBSS...

Whence it got 'aptest2' I don't know.


Setting the Network Type to Auto does not work

Fourth, it got the BSSID (which should be the MAC of the router) wrong, and it got it wrong differently every time I loaded the driver. And it got a number not of any card in my network. The second and third 'digits' (base 256) equaled the MAC of the card itself; the first was always 2; the last three varied wildly. This seemed to result from:

iwpriv wlan0 wlan_para networktype=auto

When I set the networktype to infra it got the BSSID correct and I was on the network. hurrah. It would seem that giving it the choice of network types allowed it to confuse its own MAC with others on the network when it tried to identify the router.


Crash on Shutdown, cardctl reset

Fifth, it crashes when I shut down or reset the pcmcia cards, as with 'cardctl reset'. I fixed this by downing the network earlier in my shutdown script (and downing before resetting). The wlandown provided contains the three steps:

ifconfig wlan0 down

to turn off the network connection,

iwpriv wlan0 disable

to disable wireless lan driver, and

rmmod rtl8180_24x

to unload the driver.

Removing the card without 'downing' it first invites a crash.


Wepdkeyid typo

Note the apparent typo on the parameter that sets the default key id used, 'wepdkeyid' instead of 'wepkeyid'. The 'd' stands for 'default'.


How to Specify a Key

It expects the key in hex, so if one wants to use 'Rumplestiltsk' one has to use:

iwpriv wlan0 wlan_para wepkey104_1=52756d706c657374696c74736b

Configuring a Card

So I configure my card with:


iwpriv wlan0 wlan_para channel=1
iwpriv wlan0 wlan_para networktype=infra
# If I use 'auto', it confuses driver about the MAC of the router
# and the driver gets the wrong BSSID, which should = router MAC
iwpriv wlan0 wlan_para ssid2scan=MyWonderfulNetwork
iwpriv wlan0 wlan_para ssid=MyWonderfulNetwork
#If I don't specify the network name with the undocumented ssid
#the driver does not find it by scanning
iwpriv wlan0 wlan_para authtype=opensystem
iwpriv wlan0 wlan_para preamble=auto
iwpriv wlan0 wlan_para encmode=wep
iwpriv wlan0 wlan_para wepmode=wep104
iwpriv wlan0 wlan_para wepdkeyid=0
iwpriv wlan0 wlan_para wepkey104_1=52756d706c657374696c74736b
iwpriv wlan0 wlan_para basicrates=0xf
iwpriv wlan0 wlan_para oprates=0xf
iwpriv wlan0 enable

What a success message looks like


RTL8180: ----------------------------------------------------------
RTL8180: wlan0 Link status:
RTL8180: Channel number = 1
RTL8180: beacon period = 100
RTL8180: BSSID = 0x00:0x19:0x3e:0xda:0xf2:0x19
RTL8180: SSID = YourNetworkNameHere
RTL8180: Capability = 0x01
RTL8180: AID = 0x02
RTL8180: Operational rate = 0x0F
RTL8180: ----------------------------------------------------------


Setting the Debug Message Level

The card has two settings for setting the debug message level.

iwpriv wlan0 msglevel 1

or any number other than zero returns:

RTL8180: Turn on RTL_DDEBUG_OUTINFO
iwpriv wlan0 msglevel 0

returns nothing. I presume it turns it off. I can find no documentation for it.


Failures

Often (most of the time?) it stops working, can't even ping a station on the local network. The ping failure rate can rise to 90%. I don't know what makes this happen. I can put in a different NIC, a generic Prism (Compex W11A+) and, without rebooting, have a perfect connection. Resetting, even removing it and reinserting it, doesn't make it work better when it starts to fail. Once I rebooted and ran Microsoft's Windows® program — it worked on that platform.

I have started to disable the card when not in use, running wlandown, cardctl eject, and removing the card. I have no experience that indicates that this makes it work better.

I get this error message sometimes:

RTL8180: Receive ICV error!

but that does not happen when the card fails.

Back to Computer Stuff page

You can find this page at: http://alumnus.caltech.edu/~rbell/Realtek8180.html.gz

© 2003, Russell Bell