Skip to content

Instantly share code, notes, and snippets.

@eruff
Last active August 8, 2017 14:48
Show Gist options
  • Save eruff/7689fd3a5e72539717f0 to your computer and use it in GitHub Desktop.
Save eruff/7689fd3a5e72539717f0 to your computer and use it in GitHub Desktop.
how to install the linksys ac1200 WUSB6300 on ubuntu and odroid

Installing the driver

Ubuntu

sudo apt-get install linux-headers-$(uname -r) linux-headers-generic build-essential git
git clone https://github.com/austinmarton/rtl8812au_linux
cd rtl8812au_linux

with a linux kernel version >4.0.0 you need some patches

diff --git a/os_dep/linux/rtw_android.c b/os_dep/linux/rtw_android.c
index 4150e7c..b8a4b87 100644
--- a/os_dep/linux/rtw_android.c
+++ b/os_dep/linux/rtw_android.c
@@ -32,6 +32,9 @@
 #include <linux/wifi_tiwlan.h>
 #endif
 #endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
+#define strnicmp strncasecmp
+#endif
 
 #ifdef CONFIG_GPIO_WAKEUP
 #include <linux/interrupt.h>

and

diff --git a/hal/hal_com_phycfg.c b/hal/hal_com_phycfg.c
index 2fcf444..6fd0304 100644
--- a/hal/hal_com_phycfg.c
+++ b/hal/hal_com_phycfg.c
@@ -2575,7 +2575,7 @@ Hal_ChannelPlanToRegulation(
 #ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE
 
 extern char *rtw_phy_file_path;
-char   file_path[PATH_LENGTH_MAX];
+//char file_path[PATH_LENGTH_MAX];
 
 #define GetLineFromBuffer(buffer)       strsep(&buffer, "\n")

then you should be able to build it (its not pretty but its something)

make
sudo make install

load the driver and chekc

modinfo 8812au | egrep -i 'versi|filen|003f'
sudo modprobe -v 8812au
iwconfig
iwlist chan

to make the driver load on system startup add the line 8812au to /etc/modules using

sudoedit /etc/modules

Odroid

compile your own kernel version

in order to built the driver for odroid xu3 you need the sources of the current kernel. If you are not sure you simply can rebuild the current kernel by following this simple guide

building the driver

first we get the source and the

git clone https://github.com/austinmarton/rtl8812au_linux
cd rtl8812au_linux

the wen need to tweak the Makefile a little:

I chose to build the CONFIG_PLATFORM_I386_PC, however, to make this work we need to change the architecutre. Find the $(CONFIG_PLATFORM_I386_PC) tag (for me it was in line 759)

-SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ )
+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/  | sed -e s/armv.l/arm/)
Optional

I also changed the Module destination directory, but thats very much optional (make sure the directory exists)

-MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
+MODDESTDIR := /lib/modules/$(KVER)/kernel/updates/drivers/net/realtek/rtl8812au/

now we can build the driver

make -j8

there might be a pre installed driver with the same name, which we simply can move out of our way

sudo mv /lib/modules/`uname -r`/kernel/backports/drivers/realtek/rtl8812au/8812au.ko /lib/modules/`uname -r`/kernel/backports/drivers/realtek/rtl8812au/8812au.ko.bak

and on to the final step

sudo make install

finally we can check if the installed driver supports our wifi card

modinfo 8812au | egrep -i '003f'

the previous command should result in something similar

alias:          usb:v13B1p003Fd*dc*dsc*dp*ic*isc*ip*in*

to make the driver load on system startup add the line 8812au to /etc/modules using

sudoedit /etc/modules
Sign in to join this conversation on GitHub.