Skip to contentSkip to conversation

rtl8821au: new package

PATCH Superseded Christian Stewart 2 participants 2 messages Jul 25, 2015

v8 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

PATCH v8 1/1 rtl8821au: new package

This patch adds the rtl8821au wifi driver. The driver is sourced from ulli-kroll's work on GitHub, which includes various fixes and better LED handling. Currently USB3 support is broken in this driver - it will only connect to the EHCI controller in a USB3 port.

---

[All:
- Fixed licensing information]
- Removed hash file]
- Altered firmware install to be a post-install hook]

 package/Config.in                                  |  1 +
 package/rtl8821au/0001-disable-default-debug.patch | 24 ++++++++++++++++++++
 package/rtl8821au/Config.in                        | 10 +++++++++
 package/rtl8821au/rtl8821au.mk                     | 26 ++++++++++++++++++++++
 4 files changed, 61 insertions(+)
 create mode 100644 package/rtl8821au/0001-disable-default-debug.patch
 create mode 100644 package/rtl8821au/Config.in
 create mode 100644 package/rtl8821au/rtl8821au.mk
package/Config.in +1 -0
index cfa7512..070ec6a 100644
@@ -404,6 +404,7 @@ endif
 	source "package/read-edid/Config.in"
 	source "package/rng-tools/Config.in"
 	source "package/rpi-userland/Config.in"
+	source "package/rtl8821au/Config.in"
 	source "package/sane-backends/Config.in"
 	source "package/sdparm/Config.in"
 	source "package/setserial/Config.in"
package/rtl8821au/0001-disable-default-debug.patch new file +24 -0
new file mode 100644
index 0000000..de6fc62
@@ -0,0 +1,24 @@
+Comment out the hardcoded debug defines. If extra debug is needed, we can add it
+as a define in the make flags.
+
+Signed-off-by: Christian Stewart <[email protected]>
+
+diff --git a/include/autoconf.h b/include/autoconf.h
+--- a/include/autoconf.h
++++ b/include/autoconf.h
+@@ -130,12 +130,12 @@
+ /*
+  * Debug Related Config
+  */
+-#define DBG	1
++//#define DBG	1
+ 
+-#define CONFIG_DEBUG /* DBG_871X, etc... */
++//#define CONFIG_DEBUG /* DBG_871X, etc... */
+ //#define CONFIG_DEBUG_RTL871X /* RT_TRACE, RT_PRINT_DATA, _func_enter_, _func_exit_ */
+ 
+-#define CONFIG_PROC_DEBUG
++//#define CONFIG_PROC_DEBUG
+ 
+ 
+ //#define DBG_TX
package/rtl8821au/Config.in new file +10 -0
new file mode 100644
index 0000000..9827ad5
@@ -0,0 +1,10 @@
+comment "rtl8821au needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_RTL8821AU
+	bool "rtl8821au"
+	depends on BR2_LINUX_KERNEL
+	help
+	  rtl8821au wifi driver
+
+	  https://github.com/paralin/rtl8821au
package/rtl8821au/rtl8821au.mk new file +26 -0
new file mode 100644
index 0000000..509306b
@@ -0,0 +1,26 @@
+################################################################################
+#
+# rtl8821au
+#
+################################################################################
+
+RTL8821AU_VERSION = f58e4a7fb27551bdbb4aee9db6086dd6ad996c8d
+RTL8821AU_SITE = $(call github,ulli-kroll,rtl8821au,$(RTL8821AU_VERSION))
+RTL8821AU_CFLAGS_ENDIAN = -DCONFIG_$(call qstrip,$(BR2_ENDIAN))_ENDIAN
+RTL8821AU_LICENSE = GPLv2, proprietary (rtl8821au.bin firmware)
+RTL8821AU_LICENSE_FILES = COPYING
+
+RTL8821AU_MODULE_MAKE_OPTS = \
+	CONFIG_RTL8812AU_8821AU=m \
+	KVER=$(LINUX_VERSION_PROBED) \
+	USER_EXTRA_CFLAGS=$(RTL8821AU_CFLAGS_ENDIAN)
+
+define RTL8821AU_FIRMWARE_INSTALL
+	mkdir -p $(TARGET_DIR)/lib/firmware/rtlwifi/
+	$(INSTALL) -D -m 0644 $(@D)/firmware/* $(TARGET_DIR)/lib/firmware/rtlwifi/
+endef
+
+RTL8821AU_POST_INSTALL_TARGET_HOOKS += RTL8821AU_FIRMWARE_INSTALL
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
Signature · 1 line
2.1.4
#1 lore raw

PATCH v8 1/1 rtl8821au: new package

Christian, All,

On 2015-07-25 10:15 -0700, Christian Stewart spake thusly:

Quoted 6 lines

This patch adds the rtl8821au wifi driver. The driver is sourced from ulli-kroll's work on GitHub, which includes various fixes and better LED handling. Currently USB3 support is broken in this driver - it will only connect to the EHCI controller in a USB3 port.

[--SNIP--]

Quoted 6 lines
package/rtl8821au/rtl8821au.mk new file +0 -0
new file mode 100644
index 0000000..509306b

package/rtl8821au/rtl8821au.mk line 9

Quoted 9 lines
package/rtl8821au/rtl8821au.mk new file +9 -0
@@ -0,0 +1,26 @@
+################################################################################
+#
+# rtl8821au
+#
+################################################################################
+
+RTL8821AU_VERSION = f58e4a7fb27551bdbb4aee9db6086dd6ad996c8d
+RTL8821AU_SITE = $(call github,ulli-kroll,rtl8821au,$(RTL8821AU_VERSION))
+RTL8821AU_CFLAGS_ENDIAN = -DCONFIG_$(call qstrip,$(BR2_ENDIAN))_ENDIAN

Ideally, there's no need for this inermediate variable, ...

package/rtl8821au/rtl8821au.mk line 16

Quoted 7 lines
package/rtl8821au/rtl8821au.mk new file +7 -0
+RTL8821AU_LICENSE = GPLv2, proprietary (rtl8821au.bin firmware)
+RTL8821AU_LICENSE_FILES = COPYING
+
+RTL8821AU_MODULE_MAKE_OPTS = \
+	CONFIG_RTL8812AU_8821AU=m \
+	KVER=$(LINUX_VERSION_PROBED) \
+	USER_EXTRA_CFLAGS=$(RTL8821AU_CFLAGS_ENDIAN)

... since you could directly do it here:

    USER_EXTRA_CFLAGS=-DCONFIG_$(call qstrip,$(BR2_ENDIAN))_ENDIAN

But ultimately, this should be check for directly in the code, with:

    #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
    #define CONFIG_LITTLE_ENDIAN
    #else
    #define CONFIG_BIG_ENDIAN
    #endif

(Sorry, I forgot to say so in my previous review.)

Otherwise;

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'