Home Articles HowTo HowTo: Build & Install The Legacy r8180 Module On Hardy

HowTo: Build & Install The Legacy r8180 Module On Hardy

E-mail Print PDF

Note: The information here relates only to the old ieee80211 stack driver. If you're using Ubuntu, you will find that from Intrepid (and probably Hardy also now) there is a new driver present as standard which should work perfectly through the standard graphical network management tools.

A few days ago I posted a patch for the Realtek 8185 driver (r8180), updating it for 2.6.24 kernels. I expected at the time that somebody would fix it properly before the final release of Hardy and that any people coming here for the patch would be running the development branch, so they would probably already know what to do with it.

But I hadn't realised quite how close the Hardy release date was, and as it turns out Hardy was released without this driver completely. Consequently, quite a lot of people have ended up here looking for a solution, so this is an attempt to provide more complete instructions on what to do.

I've already written a brief guide on using this driver with wpa_supplicant, but for getting it compiled and installed in the first place, this is what you need to do...

Note: French speakers may also refer to the guide here

I'll go ahead and assume that you do have a working internet connection of some form since you've managed to get to this site, but note that you do have to compile the driver on the same machine you intend to use it on, or at least one running the exact same kernel version and architecture.

  1. Make sure you have the necessary tools installed for compiling stuff:

    sudo apt-get install build-essential linux-headers-generic patch

  2. Download the driver sources:

    wget http://willdaniels.co.uk/attachments/rtl8185.zip

  3. Extract the archive and change into the extracted folder:
    unzip rtl8185.zip
    cd rtl8185
  4. Compile the driver (don't worry about the warnings, so long as there are no fatal errors):

    ./makedrv

  5. Test that the modules load correctly using:

    sudo ./wlan0up

  6. If everything is working, copy the compiled kernel modules to a better location:

    sudo cp rtl8185/*.ko /lib/modules/`uname -r`/kernel/net/wireless
    sudo cp ieee80211/*.ko /lib/modules/`uname -r`/kernel/net/wireless

  7. Update the module dependencies file:

    sudo depmod -a

There is one final step required to ensure that the driver gets loaded on boot. If you only plan to use WEP security (or none) then probably the easiest way to achieve this is as follows:

sudo -i
echo ieee80211_crypt_rtl >> /etc/modules
echo ieee80211_crypt_wep_rtl >> /etc/modules
echo ieee80211_crypt_tkip_rtl >> /etc/modules
echo ieee80211_crypt_ccmp_rtl >> /etc/modules
echo ieee80211_rtl >> /etc/modules
echo r8180 >> /etc/modules
exit

Alternatively, if you intend to automate the configuration for WPA(2) you might as well configure /etc/network/interfaces to load and unload the modules as required instead (since WPA is not supported by the standard graphical tools for this driver anyway) in which case refer to the separate WPA article here.

Last Updated on Monday, 07 September 2009 09:02  

Comments

Untitled Comment from V. B. Cranford on Thu. May 08, 2008  reply 

Thank you very much for providing this fix. It works GREAT!

Great job from jlauio on Mon. May 12, 2008  reply 

Hi
I am JOse from Ecuador, tank you very much for you help.

GREAT!!!!!!!!!!! from Petr on Sat. May 17, 2008  reply 

WHAT A GREAT PATCH!!!! My wireless card is finaly working. Thanks for a great job (and hope, it will be fixed in next version of ubuntu by default :-)

Enter title here from kdnewton on Tue. May 20, 2008  reply 

Thanks for the easy-to-do. You know, I had the TEW-423pi working with Gutsy with the stock realtek rtl8185l drivers http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=1&PFid=1&Level=6&Conn=5&DownTypeID=3&GetDown=false&Downloads=true.

Hardy comes along and I couldn't for the life of me compile them. I don't know what you did but I'm swimming through the net with wlan0. Thanks.

Enter title here~ from kdnewton on Thu. Jun 05, 2008  reply 

Thanks again. I was regretting the purchase of this wifi card but now two kernel updates later and your patch is still working (after two subsequent recompiles). Much appreciated.

wifi at boot from kdnewton on Thu. Aug 07, 2008  reply 

Some people may have noticed that the wifi doesn't establish until the user has logged in to the desktop. That can be fixed by adding a few lines to a system startup script.

Edit /etc/rc.local or /etc/rc3.d/S99rc.local and add the following lines to the very bottom:

ifconfig wlan0 up
iwconfig wlan0 essid WhateverTheAPIsCalled
iwconfig wlan0 key WhateverTheKeyIs
dhclient

Note, wlan0 can be substituted with whatever "ifconfig" calls it.

Now whenever the PC turns on so is the wifi before logging in.

Untitled Comment from Will on Fri. Aug 08, 2008  reply 

Alternatively, if you're using Gnome with NetworkManager, you should be able to just disable the roaming mode and enter the necessary connection parameters directly in the Network administration dialog (unless you also need wpa_supplicant, in which case modify the init script as suggested here or use the new driver).

Wireless Card doesn't work from Chris on Wed. May 28, 2008  reply 

I followed your directions to the letter, but when I go to the network configuration panel my wireless card isn't detected. any idea?

Thanks!

Thank you from Ban on Wed. May 28, 2008  reply 

Thank you very much for you help.
From Thailand.

Untitled Comment from Michael on Sun. Jun 08, 2008  reply 

Great howto & patch, thanks!!

Untitled Comment from jesus on Sun. Jun 08, 2008  reply 

thanks, it works after 3 days of being trying other ways. thanks a lot you are the king of linux

Thank you! from Trevor on Sat. Jun 14, 2008  reply 

This fix works fantastically! I hope it gets included in the core soon.

Thank you, very much!!! from angeluz on Sun. Jun 15, 2008  reply 

Finally solve my problem with a card of the mark with encore rtl8185L chipset. Thanks again, and I hope that in a future release of our friends ubuntu take into account this driver ... You write a Peruvian ubuntero.

Untitled Comment from Nathan Salwen on Fri. Jun 20, 2008  reply 

Hi and thanks for the patch. I wonder whether I need to compile my own kernel to use it. When I try to run the patch, I get an error that the /lib/modules/2.6.24-1-686/build directory does not exist.

Thanks,
Nathan

Works Great from Clay M on Sat. Jun 21, 2008  reply 

I just wanted to thank you for providing this patch. it works great! Thanks!

Brilliant from Pete Martin on Sat. Jun 21, 2008  reply 

Thanks so much for the solution to this problem - it works great. I used it on a F5D7000 PCI card which isn't supported in your code but with modification to include it it works brilliantly.

:D

Strange signal and noise levels from Steve Daltrey on Sun. Jun 22, 2008  reply 

I installed your driver and it worked great... for a while. Now I get a signal level of +100dBm and noise of +8dBm. And sometimes I get a signal of -156dBm and noice of +15dBm. Before using this driver I used ndiswrapper which also worked for only a short period untill going very slow and cutting off. It´s just that these values seem very strange and I wonder if ndiswrapper is interferring with this new linux driver. I uninstalled it via synaptics but when I look under "lsmod" it´s still there. Is there something I can check to see if there is a conflict or something?

Untitled Comment from Will on Sun. Jun 22, 2008  reply 

Steve, you probably only removed the ndiswrapper userspace utilities since the kernel module itself is part of the core linux-ubuntu-modules package. I would suggest you reinstall the utilities (sudo apt-get install ndiswrapper-common) then use "ndiswrapper -l" to list the installed Windows drivers, followed by "sudo ndiswrapper -r " to remove it.

New Driver from Will on Sun. Jun 22, 2008  reply 

Note to all subscribers and new visitors: You may wish to test the new version of this driver, which was ported to use the mac80211 stack of newer kernels. Refer to post from Tim Gardner on the launchpad bug here - it's been working perfectly for me for a while now and can do WPA through nm-applet!

THANKS! from Tilden on Sat. Jul 05, 2008  reply 

Said before here, but wanted to add my thanks for this!

Problems with this driver from Greg Lewis-Paley on Wed. Jul 16, 2008  reply 

So I tried this method and it results in simply no internet connection, despite being able to get an IP address. With Ubuntu 8.04 and kernel 2.6.24-20, whenever this driver is enabled, the entire computer slows to a crawl, and most noticeably, typing lags. What would be the cleanest way to uninstall this driver?

By the way, neither ndiswrapping or the newer improved method worked at all. I'm running a Gateway MT3418 with a mini pci RTL8185L and it's always been giving me great difficulty.

Works great from Erik Owan on Sun. Jul 20, 2008  reply 

The patch works great on 8.04. Thanks for the nice work

Gentoo AMD64 User from Chris on Fri. Aug 01, 2008  reply 

Thank you for the code and bug fix.

I wanted to let you know that this code works in x86_64 Gentoo Kernel 2.6.24

Pretty much directly according to your Readme.

54 Mb/s WPA2-PSK AES using wpasupplicant-0.5.10

Actual card is "TRENDnet" Model #TEW-423PI

Your utilities, scripts, and webpage are primo examples of fine open source work.

THANK YOU!

Untitled Comment from thecham on Mon. Aug 04, 2008  reply 

Oh man! I think I'm in love with you!!

Untitled Comment from Luis on Sun. Aug 10, 2008  reply 

Thanks so much you have saved me days of troubleshooting!!!!I really aprecciate this solution. It rocks!

Help with ./makedrv from Raphael Barros on Wed. Aug 13, 2008  reply 

Do this solutions works in kernel linux-headers-2.6.24-19-generic?

I had this error:

make[1]: Entrando no diretório `/usr/src/linux-headers-2.6.24-19-generic'
make[1]: *** Sem regra para processar o alvo `de'. Pare.
make[1]: Saindo do diretório `/usr/src/linux-headers-2.6.24-19-generic'
make: ** [modules] Erro 2
rm -f *.mod.c *.mod *.o .*.cmd *.ko *~
rm -rf /home/livre/Área de Trabalho/rtl8185/rtl8185/tmp

Translation:

Sem regra para processar o alvo `de'. Pare = No rule to process target 'de'

Saindo do diretório = Leaving Directory

Entrando no diretório = Entering Directory.

Thanks for the Help!

Untitled Comment from Will on Wed. Aug 13, 2008  reply 

It seems the problem is that you have a space in the path "Área de Trabalho". Try building it in a different directory that has no spaces.

Though the make rules ought to handle this properly, they obviously don't in this source package, which is not uncommon actually. Since this source package should be redundant soon, rather than try to fix the build scripts let's just make a note of the problem here and leave it at that :D

Confirmed: Patched doesn't work if in folder with from daniel tygel on Sat. Sep 27, 2008  reply 

Will is correct!

You should put the rtl8185.zip file in a folder that doesn't have spaces in its name. Then it works flawlessly!

thanks a lot for this patch!

daniel, from Brasil

ieee80211 modules conflict in Kernel 2.6.24-22 from Flavio on Fri. Jan 09, 2009  reply 

Hi,

After some difficulties, I could finally install the driver.

Ubuntu Hardy, kernel 2.6.24-22, already has ieee80211_* modules in /lib/modules dirs (for the RTL8187 driver). By doing the steps 6 and 7 above, r8180 is depmod'ed to the wrong ieee80211_* modules, such that modprobe fails.

I managed the problem by modifying /etc/modprobe.conf and by using install/remove commands creating a fake module (which I called r8180pat) to insmod/rmmod the correct module files. After that, everything was ok.

Thanks a lot for the patch ! Since the rtl8180 module that comes with linux-backports did not work, your patch helped me a lot !

step # 4 from elmalafacha on Tue. Feb 03, 2009  reply 

I have some problems in the step #4, i dont know why, http://paste.ubuntu.com/113302/ when i do ./makedrv thats what it happens. CAn someone tell me what im doing wrong?