Tuesday, May 04, 2010

HOWTO : RealTek 8192SU USB dongle (RTL8192SU) on Ubuntu 10.04

D-Link DWA-131 Nano USB Wireless N adapter (USB dongle) is using RealTek 8192SU chip. However, it does not work on Ubuntu 10.04. This chip does work on Kernel 2.6.33. That is, this chip may work on Ubuntu 10.10 or later.

The current version of RealTek 8192SU Linux driver is 0006 which is for Kernel 2.6.18 to 2.6.31 and dated 2010-03-25. However, Ubuntu 10.04 is using Kernel 2.6.32. You may encounter compile errors under Ubuntu 10.04. Don't panic, I have the solution.

Step 1 :

RealTek 8192SU driver from official site

or download it from here.

wget http://samiux.volospin.com/rtl8192SU_usb_linux_v2.6.0006.20100226.zip

Step 2 :

sudo apt-get install unzip

unzip rtl8192SU_usb_linux_v2.6.0006.20100226.zip

cd rtl8712_8188_8191_8192SU_usb_linux_v2.6.0006.20100226/driver

tar -xvzf rtl8712_8188_8191_8192SU_usb_linux_v2.6.0006.20100226.tar.gz

cd rtl8712_8188_8191_8192SU_usb_linux_v2.6.0006.20100226

Step 3 :

cd include

nano osdep_service.h

add "#include <linux/sched.h>" to the file "osdep_service.h"

the result looks like this :

#ifndef __OSDEP_SERVICE_H_
#define __OSDEP_SERVICE_H_


#include <drv_conf.h>
#include <basic_types.h>
#include <linux/sched.h>
//#include <rtl871x_byteorder.h>
......


Step 4 :

cd ..

nano Makefile

add "nullstring :=" under "export TOPDIR := $(PWD)"

locate "ifeq ($(CONFIG_BUILT_IN), y)" and make changes to this ifeq block. The result looks like this :

ifeq ($(CONFIG_BUILT_IN), y)
include $(src)/config
else
ifeq ($(TOPDIR), $(nullstring))
include config
else
include $(TOPDIR)/config
endif
endif


The result of the first 19 lines is as the following :

EXTRA_CFLAGS += -O1 -Wno-unused-variable -Wno-unused-value -Wno-unused-label -W$
EXTRA_CFLAGS += -I$(src)/include -Wno-unused -Wno-unused-function


CONFIG_BUILT_IN = n

export TOPDIR := $(PWD)
nullstring :=


ifeq ($(CONFIG_BUILT_IN), y)
include $(src)/config
else
ifeq ($(TOPDIR), $(nullstring))
include config
else
include $(TOPDIR)/config
endif
endif


ifeq ($(CONFIG_RTL8711), y)

Step 5 :

make clean
make
sudo make install


Step 6 :
sudo modprobe 8712u
echo "8712u" | sudo tee -a /etc/modules


The dongle will work now. Be keep in mind that when the Kernel is updated, you may require to re-compile the driver at Step 5.

That's all! See you.