User Tools

Site Tools


r8187

This is an old revision of the document!


R8187

IMPORTANT: See Realtek 8187 driver notes for current limitations of this driver.

rmmod all ieee80211*-rtl and depending modules before proceeding.

ifconfig wlan0 down	 
rmmod r8187.ko	 
rmmod ieee80211-rtl.ko	 
rmmod ieee80211_crypt_ccmp-rtl.ko	 
rmmod ieee80211_crypt_tkip-rtl.ko	 
rmmod ieee80211_crypt_wep-rtl.ko	 
rmmod ieee80211_crypt-rtl.ko

Choose ONE of the following files, they are all the same, just different mirrors:

wget ftp://202.65.194.18/cn/wlan/rtl8187_linux_26.1010.zip
wget ftp://220.228.150.22/cn/wlan/rtl8187_linux_26.1010.zip
wget ftp://61.56.86.122/cn/wlan/rtl8187_linux_26.1010.zip
unzip rtl8187_linux_26.1010.zip
cd rtl8187_linux_26.1010.0622.2006/
wget http://patches.aircrack-ng.org/rtl8187_2.6.20v3.patch
tar xzf drv.tar.gz
tar xzf stack.tar.gz
patch -Np1 -i rtl8187_2.6.20v3.patch
sh makedrvbk
sh wlan0up

The script “wlan0rmv” which comes with the base code is incorrect. It should be replaced with:

 #!/bin/bash
 
 rmmod r8187
 rmmod ieee80211_rtl
 rmmod ieee80211_crypt_ccmp_rtl
 rmmod ieee80211_crypt_tkip_rtl
 rmmod ieee80211_crypt_wep_rtl
 rmmod ieee80211_crypt_rtl

Notes

  • If “sh wlan0up” fails, make sure your ieee80211 stack is built as a module and remove all those modules. If it is integrated in the kernel, rebuild your kernel with a modular ieee80211 stack.
  • After loading the driver, just type “iwpriv wlan0 rawtx 1” or replace wlan0 with your interface. This will enable injection mode. If you use airmon-ng to put the interface into monitor mode, then it will automatically run this command for you. (Deprecated with v3 of the patch)

Troubleshooting Tips

wlan0 device does not exist message

Trying to run “sh wlan0up” gives you an error of wlan0 device not existing. lsusb indicates that the wireless card is connected.

Solution:
You sometimes get this message when another driver, which also creates an wlanX interface is loaded before the r8187 driver. Examples: acx111 or hostap. In such a case the rtl8187 device will be wlan1 or wlan2. Look at iwconfig to see if there is such an interface and use that one instead.

Module loading errors

The following errors were on Ubuntu:

insmod: error inserting 'ieee80211_crypt-rtl.ko': -1 Invalid module format\\
insmod: error inserting 'ieee80211_crypt_wep-rtl.ko': -1 Unknown symbol in module\\
insmod: error inserting 'ieee80211_crypt_tkip-rtl.ko': -1 Unknown symbol in module\\
insmod: error inserting 'ieee80211_crypt_ccmp-rtl.ko': -1 Unknown symbol in module\\
insmod: error inserting 'ieee80211-rtl.ko': -1 Unknown symbol in module\\
insmod: error inserting 'r8187.ko': -1 Unknown symbol in module\\

Solution:

cd beta-8187
rm -f Modules.symvers
ln -s ../ieee80211/Modules.symvers Modules.symvers
### NOTE versions of GCC may require this instead: ln -s ../ieee80211/Module.symvers Module.symvers
cd ..
sh makedrv

Eliminating Warnings

Messages below when compiling the RTL8187 driver on Ubuntu 6.10 with 2.6.17-11 generic (patched for Nvidia) kernel.

WARNING: "ieee80211_wx_get_name_rtl7" [/root/drivers/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187.ko] undefined!
WARNING: "free_ieee80211_rtl7" [/root/drivers/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187.ko] undefined!
WARNING: "ieee80211_wx_get_freq_rtl7" [/root/drivers/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187.ko] undefined!
WARNING: "alloc_ieee80211_rtl7" [/root/drivers/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187.ko] undefined!
#many messages suppressed...
WARNING: "ieee80211_wx_get_scan_rtl7" [/root/drivers/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187.ko] undefined!
WARNING: "ieee80211_wx_set_rate_rtl7" [/root/drivers/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187.ko] undefined!

Generally, warnings can be ignored. To eliminate the ones above, follow the instructions in the previous troubleshooting tip. IE Remake the link to Modules.symvers and then re-compile.

Missing files or directory

Compiling results in an error similar to:

make: *** /lib/modules/2.6.15-28-386/build: No such file or directory.
#Plus other references to "No such file or directory."\\

Solution:
See installing missing packages.

"Operation not permitted" error message

While loading the modules you get an “Operation not permitted” message similar to:

insmod: error inserting 'ieee80211_crypt-rtl.ko': -1 Operation not permitted
insmod: error inserting 'ieee80211_crypt_wep-rtl.ko': -1 Operation not permitted
insmod: error inserting 'ieee80211_crypt_tkip-rtl.ko': -1 Operation not permitted
insmod: error inserting 'ieee80211_crypt_ccmp-rtl.ko': -1 Operation not permitted
insmod: error inserting 'ieee80211-rtl.ko': -1 Operation not permitted
insmod: error inserting 'r8187.ko': -1 Operation not permitted
wlan0: ERROR while getting interface flags: No such device

Solution: You must be root to load the modules. You “su” to root then load the modules. On many distributions, you can also do this by using sudo plus the script name.

"linux/config.h no such file or directory..." compile error message

You receive a compile error messages similar to one or more of:

  • /usr/src/redhat/BUILD/rtl8187_linux_26.1025.0328.2007/ieee80211/ieee80211_rx.c:46:26: error: linux/config.h: No such file or directory
  • /usr/src/redhat/BUILD/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187.h:50:26: error: linux/config.h: No such file or directory
  • “linux/config.h no such file or directory…”.
  • In French: “erreur: linux/config.h : Aucun fichier ou répertoire de ce type”.

Solution: You need to create an empty file called linux/config.h in the kernel source directory. The simplest way is:

“touch /usr/src/kernels/2.6.18-1.2869.fc6-i686/include/linux/config.h”

Change “/usr/src/kernels/2.6.18-1.2869.fc6-i686” to where your kernel sources are located and the your specific kernel and directory structure. You can use “uname -r” to help determine your exact kernel.

"passed 3 arguments, but takes just 2..." compile error message

You get compile errors similar to:

/root/rtl8187_linux_26.1025.0328.2007/ieee80211/ieee80211_softmac.c:2168:78: error: macro "INIT_WORK" passed 3 arguments, but takes just 2
/root/rtl8187_linux_26.1025.0328.2007/ieee80211/ieee80211_softmac.c: In function ‘ieee80211_softmac_init’:
/root/rtl8187_linux_26.1025.0328.2007/ieee80211/ieee80211_softmac.c:2168: error: ‘INIT_WORK’ undeclared (first use in this function)

and so on…

/root/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187_core.c:1625:64: error: macro "INIT_WORK" passed 3 arguments, but takes just 2
/root/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187_core.c: In function ‘rtl8180_init’:
/root/rtl8187_linux_26.1025.0328.2007/rtl8187/r8187_core.c:1625: error: ‘INIT_WORK’ undeclared (first use in this function)

and so on…

Solution: This typically occurs after you have upgraded your kernel version. Delete the all the patch files and install a fresh version. You should now be able to compile it successfully. Also ensure that you have matching kernel header files.

Low injection rates

Many people complain that they only get injection rates of about 50 packets per second. Here are few items which are known to cause this:

  • Using VMware Workstation 5.x or earlier. Be sure to use VMware Workstation 6 or above. The root cause is that older versions (< 6.0) use the old USB standard.
  • Using VMware Players earlier then version 2. Be sure to use VMware Player 2 or above. The root cause is that older versions (< 2.0) use the old USB standard.
  • Using pre-2.0 USB standard hardware. Make sure you are using hardware with support for USB 2.0.
  • Having legacy USB support enabled in your BIOS. Try disabling this option.

Note: VMWare Workstation < 6.0 and VMWare Player < 2.0 use USB 1.1 and when injecting at high speed, injection uses all USB bandwith (so, nearly no packets are received) and you can notice a lot of packets lost in airodump-ng.

Shared Key Authentication fails

You receive one or more errors similar to:

  • Attempting to setup SKA mode: “iwconfig wlan0 mode managed key 1234567890 restricted” results in:

Error for wireless request “Set Encode” (8B2A) :

 SET failed on device wlan0 ; Operation not supported.
  • ieee80211_auth_challenge_rt17+0x2fe/0x310 [ieee80211_rtl] kernel panic

SKA is not currently supported with the RTL8187 driver. There is no known workaround.

r8187.1179675624.txt.gz · Last modified: 2007/05/20 17:40 (external edit)