RTL8180 based cardbus 802.11b cards in Linux mini HOWTO

Gerd Busker

2002-08-31

Revision History
Revision 0.12002-08-31gjb
Initial release

Abstract

Some very cheap cardbus 802.11b wifi cards based on the RTL8180 have recently become available on the market. The adverts typically claim linux compatibility. My experience in setting an RTL8180 card up is documented here.


Table of Contents

Introduction
Copyright and License
Disclaimer
Feedback
The available cards
Driver and kernel compatibility
Further work

Introduction

Copyright and License

This document, RTL8180 based cardbus 802.11b cards in Linux mini HOWTO, is copyrighted (c) 2003 by Gerd Busker. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html.

Disclaimer

No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies, that could be damaging to your system. Proceed with caution, and although this is highly unlikely, the author(s) do not take any responsibility.

All copyrights are held by their by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.

Feedback

Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address : <busker@busker.org>.

The available cards

Several RTL8180 based cards are available and are usually sold as the house brand cheapest card (20-30 UKP) and identified as a "GWA-E06" (Search google ). Often these are marked as "Linux compatible". Examples:

  • DABS sells a "802.11b 11Mbps Cardbus(PCMCIA)" card (quicklinx 2MBCWS) for less than £20.
  • Or Yahoo shopping has the same card for just over $20.

Driver and kernel compatibility

The drivers can be downloaded for various linux distributions from Realtek. Unfortunately it doesn't say which kernel version they are for and the information in the Makefiles is inaccurate.

The critical driver dependent parameter is the kernel for which the proprietary object file "priv_part.o" is compiled for. This can be found with a "strings priv_part.o|grep kernel".

Table 1. Driver table

DistributionDriver versionDriverKernel version
Redhat 7.31.2rtl8180_linuxdrv_v12_rh73.zip2.4.18-3 (with Redhat patches)
Redhat 8.01.2rtl8180_linuxdrv_v12_rh80.zip2.4.18-14 (with Redhat patches)
Redhat 9.01.20rh90-8180(120).zip2.4.20-8 (with Redhat patches)
Suse 8.20.5rtl8180_24x_suse82.zip2.4.20-4GB (with Suse patches)

So, make sure your kernel source is properly installed and build your rtl8180_24x.o module (read the readme.txt file for instructions on building the driver and configuring the wlanup and wlandown scripts).

I was on kernel version 2.4.22, so I used that, but this fails to send properly formatted packets and crashes when rmmod'ed. The crash happens in "__kfree_skb(skbuff *skb)" at "dst_release(skb->dst)" in net/core/sk_buff.c. Basically "skb->dst" is supposed to be a pointer but it has been corrupted. The reason for this is that since 2.4.21 the "struct skbuff" has an additional member (real_dev) so indexing in the priv_part.o will be corrupted. Grrrrr. No wonder it wouldn't send out proper packets either.

So I tried again with 2.4.20 (stock) and that works great. Here is the log entry for card insertion:

cs: cb_alloc(bus 5): vendor 0x10ec, device 0x8180
PCI: Enabling device 05:00.0 (0000 -> 0003)
And when "wlanup" is run:
******** RTL8180 Wireless Lan Driver 2003-06-11 loaded********
PCI: Setting latency timer of device 05:00.0 to 64
RTL8180: 05:00.0: region #0 IS a PIO resource!
RTL8180: request_region(0x00004800,0x00000100) !
RTL8180: STA is NOT acting as AP!
RTL8180: LITTLE_ENDIAN memory access
RTL8180: station mode eeprom info
RTL8180: EEpromAddressSize = 8!
RTL8180: eepromID = 0x8129
RTL8180: EEPROMVersion = 0x0102
RTL8180: Tx Power Level, channel 0 = 0xa0
RTL8180: Tx Power Level, channel 1 = 0xa0
RTL8180: Tx Power Level, channel 2 = 0xa0
RTL8180: Tx Power Level, channel 3 = 0xa0
RTL8180: Tx Power Level, channel 4 = 0xa0
RTL8180: Tx Power Level, channel 5 = 0xa0
RTL8180: Tx Power Level, channel 6 = 0xa0
RTL8180: Tx Power Level, channel 7 = 0xa0
RTL8180: Tx Power Level, channel 8 = 0xa0
RTL8180: Tx Power Level, channel 9 = 0xa0
RTL8180: Tx Power Level, channel 10 = 0xa0
RTL8180: Tx Power Level, channel 11 = 0xa0
RTL8180: Tx Power Level, channel 12 = 0xa0
RTL8180: Tx Power Level, channel 13 = 0xa0
RTL8180: ChannelPlan = 0x0002
RTL8180: RFChipID = 0x0003
RTL8180: EEPROMVersion > 0x0101
RTL8180: AntennaDiversity = TRUE
RTL8180: CSThreshold = 0x000b
RTL8180: DigitalPhy = FALSE
RTL8180: DefaultAntennaB = FALSE
RTL8180: CSMethod = RCR_EnCS1
RTL8180: wlan driver loaded. ioaddr=0x4800, irq=5, MAC_addr=0:50:fc:d0:8c:e3
RTL8180: Use RTL private command [ssid2scan]
RTL8180:  ------ Enable wlan driver ------
RTL8180: Enable wlan driver version 1.2
RTL8180: wireless LAN controller RTL8180 + philips RF.
RTL8180: PHILIPS_Config() 
RTL8180: PHILIPS_Config() - Analog mode
RTL8180: ENABLE_RTL_DCST
RTL8180:  Set dot11PrivacyInvoked = 0. 
RTL8180:  encryptmode = RTL_ENC_NONE
RTL8180:  wepkeymode = WEP_MODE_OFF
RTL8180: Scan PHY channel number = 1
RTL8180: Scan PHY channel number = 2
RTL8180: Scan PHY channel number = 3
RTL8180: Scan PHY channel number = 4
RTL8180: Scan PHY channel number = 5
RTL8180: Scan PHY channel number = 6
RTL8180: Scan PHY channel number = 7
RTL8180: Scan PHY channel number = 8
RTL8180: Scan PHY channel number = 9
RTL8180: Scan PHY channel number = 10
RTL8180: Scan PHY channel number = 11
RTL8180: Select a BSS and Join it at channel 3.
RTL8180: ----------------------------------------------------------
RTL8180: wlan0 Link status:
RTL8180:    Channel number = 3
RTL8180:    beacon period = 100
RTL8180:    BSSID = 0x00:0x09:0x5b:0x69:0x37:0x98
RTL8180:    SSID = home
RTL8180:    Capability = 0x01
RTL8180:    AID = 0x01
RTL8180:    Operational rate = 0x0F <bit 0∼3 = 1∼11 Mbps>
RTL8180: ----------------------------------------------------------
And "wlandown":
RTL8180:  ------ Disable wlan driver ------
RTL8180: release_region(0x00004800,0x00000100) !
RTL8180: wlan driver removed
******** RTL8180 Wireless Lan Driver 2003-06-11 removed ********
      

Further work

  • The source to "priv_part.o" should be GPL'ed. A lot of reasons are flying round about why this type of driver shouldn't be open source. At the end of the day, this capability can be got at in other available and documented chipsets so this argument doesn't hold at all.
  • Failing that, an update to "priv_part.o" to reflect changes in 2.4.22 would be nice.
  • The current wireless tools support is minimal. Only iwpriv does anything. iwconfig returns gibberish. The RTL8180 driver should operate in the usual way with wireless tools and the existing wireless IOCTL's.
  • Expand this HOWTO to include the usual module load on card insert. Add the network configuration to the normal /etc/sysconfig/network-scripts way of things.