Realtek USB Wireless on Linux (Fedora)

When John needed wireless for his computer at home, he bought (probably on my recommendation) a Billion 3011N – a USB wireless N device with the Realtek 8191S(U) chipset. On the box it said that it supported Linux, so I figured it was a pretty safe bet (surely that means there’s a stable driver in the mainline kernel, right?).

Turns out, no. The device has horrible support under Linux and it’s a super pain. The driver disk that came with the box does have a Linux driver, but it doesn’t always compile against the kernel and then there are configuration issues and a custom wpaconfig is required.

Gah.

So John bought another USB wireless dongle.

Anyway, so now I need a USB wireless dongle for my machine and I asked John to buy one of his spare ones from him (he has four or five). He gave me the afore mentioned Billion device. I plugged it into my Fedora 13 box, but it didn’t know much about it. So then I downloaded the open source driver from Realtek, compiled it and loaded the module. The system hard-locked – even Magic Keys couldn’t save it.

I shelved it for a while, until a bloke called Terry Polzin on the Fedora list today posted a request for help with getting a Realtek 8188S(U) working. I replied saying that I had a similar device and shared my experiences.

I told him that there is a driver in staging which supports the device, but unlike Ubuntu, Fedora only ships quality working drivers by default, so no staging drivers are included. It’s easy enough to get them though, just add the RPMFusion Free repository and install their kmod-staging package which (as the name might give away) includes the staging drivers for the current kernel.

Once you have that installed, the r8192s_usb module can be loaded, but the device still needs external (presumably proprietary) firmware to work. Fortunately, although the driver available from Realtek does not include it, it was included on the disk, and is also available in the Billion driver from their website. So, once you have put the firmware in the right place, the device just works.

Here are the steps to get it working (you will need to have RPMFusion enabled, and run these as root).

yum install kmod-staging unzip
depmod -a
wget http://au.billion.com/downloads/3011N/3011N_Linux_Driver.zip
unzip -j 3011N_Linux_Driver.zip "*rtl8192sfw.bin" -d RTL8192SU
mv RTL8192SU /lib/firmware/

Now, plug in your device and check that the module and firmware have been loaded, using dmesg. You should see something like this:

usb 1-2.3: new high speed USB device using ehci_hcd and address 16
usb 1-2.3: New USB device found, idVendor=0bda, idProduct=8172
usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2.3: SerialNumber: 00e04c000001
==>ep_num:4, in_ep_num:1, out_ep_num:3
==>RtInPipes:3
==>RtOutPipes:4 6 13
==>txqueue_to_outpipemap for BK, BE, VI, VO, HCCA, TXCMD, MGNT, HIGH, BEACON:
1 1 0 0 2 2 2 2 2
Dot11d_Init()
rtl819xU: --->FirmwareDownload92S()

usb 1-2.3: firmware: requesting RTL8192SU/rtl8192sfw.bin
rtl819xU:signature:8192, version:902b, size:30, imemsize:7408, sram size:9688

rtl819xU:--->FirmwareDownloadCode()

rtl819xU:--->FirmwareCheckReady(): LoadStaus(1),
rtl819xU:<---FirmwareCheckReady(): LoadFWStatus(1), rtStatus(0)

rtl819xU:--->FirmwareDownloadCode()

rtl819xU:--->FirmwareCheckReady(): LoadStaus(2),
rtl819xU:-->FirmwareEnableCPU()

rtl819xU:IMEM Ready after CPU has refilled.

rtl819xU:<--FirmwareEnableCPU(): rtStatus(0x0)

rtl819xU:<---FirmwareCheckReady(): LoadFWStatus(2), rtStatus(0)

rtl819xU:--->FirmwareDownloadCode()

rtl819xU:--->FirmwareCheckReady(): LoadStaus(3),
rtl819xU:DMEM code download success, CPUStatus(0x3f)

rtl819xU:Polling Load Firmware ready, CPUStatus(ff)

rtl819xU:FirmwareCheckReady(): Current RCR settings(0x157e20e)

rtl819xU:<---FirmwareCheckReady(): LoadFWStatus(3), rtStatus(0)

rtl819xU:Firmware Download Success!!

ADDRCONF(NETDEV_UP): wlan0: link is not ready
=====>rtl8192SU_link_change 1
<=====rtl8192SU_link_change 2

Now, you should have a wireless device and network interface, which you can check with iwconfig and ifconfig -a.

wlan0 802.11b/g/n Mode:Managed Frequency=2.422 GHz
Access Point: Not-Associated Bit Rate:130 Mb/s
Retry min limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=0/100 Signal level=0 dBm Noise level=0 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

And that's it. The device should now work with NetworkManager, etc.

The main downside here (apart from the obvious) is that you will be relying on RPMFusion to build an updated kmod-staging version when you get a Fedora kernel update. Sometimes this might not happen before you get your kernel, so when you reboot, you lose your wireless (because there's no driver). If so, boot to your older kernel for a while, or build the driver yourself, or create an akmod instead of kmod.

Ubuntu users should be able to just put the firmware in the right place, as their kernel ships with the unstable drivers by default.

-c

17 Responses to “Realtek USB Wireless on Linux (Fedora)”


  • Hi Chris,

    First of all thanks for blogging this, I’ve been trying to get my head around my Realtek USB device on Ubuntu all week.

    There are just a couple of things I’m unclear of (taking into consideration I’m a newbie on Ubuntu).

    You say that “Ubuntu users should be able to just put the firmware in the right place, as their kernel ships with the unstable drivers by default.”

    This may be a completely basic question but how do I put the firmware in the right place? Where is the firmware to begin with and where does it need to go. I can’t tell from the terminal print above where you’ve actioned that.

    Thanks

  • PS – my device has the Realtek 8188S(U) chipset.

  • Hi Tom,

    No worries. You should be able to just copy the firmware to /lib/firmware/ directory or perhaps under your kernel version, something like /lib/firmware/2.6.28-ubuntu-blah/.

    -c

  • Hi Chris,

    All sorted now and it’s working on reboot. Thanks again.

    TT

  • Thanks Chris this works great.
    Trendnet 649ub doggle fedora 14 64bit

  • chris i think someone dropped a php script on your site . I was directed to a google work from home scam.

  • Thanks Kev, do you have a link?

    -c

  • Thanks for the help !

  • Thanks Chris!

    Really a good work

  • This is not working for me.
    I’m running Fedora 16 64bit.

    I’m getting these first few lines when I plug the device:
    usb 1-2.3: new high speed USB device using ehci_hcd and address 16
    usb 1-2.3: New USB device found, idVendor=0bda, idProduct=8172
    usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 1-2.3: SerialNumber: 00e04c000001

    But nothing more :(

    Any Ideas?

  • Sounds like you don’t have the firmware in the right place, or the right firmware/module. Can you make sure that the kmod package installed matches your kernel?

    rpm -qa |grep kmod-staging
    uname -r

    -c

  • Great tip.. saved my day

  • Thank you so much for this!

    It worked for me using a Patriot Wireless 11n USB adapter on Ubuntu Lucid in 2012. The darn thing advertised that it works for linux but it is not easy. It seems mine shows up as Realtek 8191 (It worked very intuitively in my windowsXP in VirtualBox, Grrr).

    I noticed this ubuntu thread is similar http://ubuntuforums.org/showthread.php?t=1635577 (because it is mentioning the realtek driver) Someone on there references some Rosewill drivers. I had a look at the driver just to see if it was similar. Not only similar but it is in fact identical! LOL I was considering either the Patriot or the Rosewill on newegg. Obviously not a real choice!

    Anyway after messing around with all the broken makefiles in there and getting the freeze up like you I just cut and pasted your billion driver and the darn thing works like a charm. Thanks so much. I nearly gave up.

    I’m still a little clear on updates though. Is this going to break when my ubuntu kernel updates? Or because they put those unstable things in the kernel for ubuntu, unlike fedora, it should just keep working?

    Anyway, I suppose I’ll find out on the next update. If it breaks I guess I’ll come here and bitch about it (not that it would be in any way your fault, just to document the issue)

    Good thing I have a LAN connection on this machine too otherwise I’d be quite stuck. That is the really annoying thing with bad wifi support for linux from manufacturers. Sure, one can get it going with the help of the internet but it’s a bit of a chicken or the egg thing.

    Cheers,
    rusl

  • The firmware will be there from now on, but there needs to be a driver for each new kernel (of course you can boot an old kernel if you get an update that’s not working) – if you installed it as a part of a kernel package like kmod-staging, then so long as that package is updated along with a new kernel you should be right.

Leave a Reply