Skip to contentSkip to conversation

rtl8821au: new package

PATCH Superseded Christian Stewart 3 participants 7 messages Jul 24, 2015 – Jul 25, 2015

v7 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

PATCH v7 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.

---
 package/Config.in                                  |  1 +
 package/rtl8821au/0001-disable-default-debug.patch | 24 ++++++++++++++++++++++
 package/rtl8821au/Config.in                        | 11 ++++++++++
 package/rtl8821au/rtl8821au.hash                   |  1 +
 package/rtl8821au/rtl8821au.mk                     | 21 +++++++++++++++++++
 5 files changed, 58 insertions(+)
 create mode 100644 package/rtl8821au/0001-disable-default-debug.patch
 create mode 100644 package/rtl8821au/Config.in
 create mode 100644 package/rtl8821au/rtl8821au.hash
 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 +11 -0
new file mode 100644
index 0000000..f3aa354
@@ -0,0 +1,11 @@
+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 with various improvements and fixes
+	  including better LED handling. does not support USB3 yet.
+
+	  https://github.com/ulli-kroll/rtl8821au
package/rtl8821au/rtl8821au.hash new file +1 -0
new file mode 100644
index 0000000..d54d3c3
@@ -0,0 +1 @@
+sha256 93beaf608880ecbca03bbeb8251b91d16e17724b36158b0571d1cebb7b4e5914  rtl8821au-f58e4a7fb27551bdbb4aee9db6086dd6ad996c8d.tar.gz
package/rtl8821au/rtl8821au.mk new file +21 -0
new file mode 100644
index 0000000..42f4cdd
@@ -0,0 +1,21 @@
+################################################################################
+#
+# rtl8821au
+#
+################################################################################
+
+RTL8821AU_VERSION = f58e4a7fb27551bdbb4aee9db6086dd6ad996c8d
+RTL8821AU_SITE = $(call github,ulli-kroll,rtl8821au,$(RTL8821AU_VERSION))
+RTL8821AU_CFLAGS_ENDIAN = -DCONFIG_$(call qstrip,$(BR2_ENDIAN))_ENDIAN
+
+RTL8821AU_MODULE_MAKE_OPTS = \
+	CONFIG_RTL8812AU_8821AU=m \
+	KVER=$(LINUX_VERSION_PROBED) \
+	USER_EXTRA_CFLAGS=$(RTL8821AU_CFLAGS_ENDIAN)
+
+define RTL8821AU_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/firmware/* $(TARGET_DIR)/lib/firmware/rtlwifi/
+endef
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
Signature · 1 line
2.1.4
#1 lore raw

PATCH v7 1/1 rtl8821au: new package

Christian, All,

On 2015-07-24 15:32 -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--]

package/rtl8821au/0001-disable-default-debug.patch line 4

Quoted 8 lines

index 0000000..de6fc62

package/rtl8821au/0001-disable-default-debug.patch new file +4 -0
@@ -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]>

I see that Ulli has already accepted to change that in his tree. Great that you guys can work together on this! :-)

package/rtl8821au/rtl8821au.hash line 1

Quoted 7 lines
package/rtl8821au/rtl8821au.hash new file +1 -0
new file mode 100644
index 0000000..d54d3c3
@@ -0,0 +1 @@
+sha256 93beaf608880ecbca03bbeb8251b91d16e17724b36158b0571d1cebb7b4e5914  rtl8821au-f58e4a7fb27551bdbb4aee9db6086dd6ad996c8d.tar.gz

No hash when using a git sha1, see:
http://buildroot.net/downloads/manual/manual.html#adding-packages-hash

Note. If libfoo is from GitHub (see Section 17.17.2, "How to add a package from GitHub" for details), we can only accept a .hash file if the package is a released (e.g. uploaded by the maintainer) tarball. Otherwise, the automatically generated tarball may change over time, and thus its hashes may be different each time it is downloaded, causing a .hash mismatch for that tarball.

Quoted 13 lines
package/rtl8821au/rtl8821au.mk new file +7 -0
new file mode 100644
index 0000000..42f4cdd
@@ -0,0 +1,21 @@
+################################################################################
+#
+# rtl8821au
+#
+################################################################################
+
+RTL8821AU_VERSION = f58e4a7fb27551bdbb4aee9db6086dd6ad996c8d

package/rtl8821au/rtl8821au.mk line 17

Quoted 10 lines
package/rtl8821au/rtl8821au.mk new file +10 -0
+RTL8821AU_SITE = $(call github,ulli-kroll,rtl8821au,$(RTL8821AU_VERSION))
+RTL8821AU_CFLAGS_ENDIAN = -DCONFIG_$(call qstrip,$(BR2_ENDIAN))_ENDIAN
+
+RTL8821AU_MODULE_MAKE_OPTS = \
+	CONFIG_RTL8812AU_8821AU=m \
+	KVER=$(LINUX_VERSION_PROBED) \
+	USER_EXTRA_CFLAGS=$(RTL8821AU_CFLAGS_ENDIAN)
+
+define RTL8821AU_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/firmware/* $(TARGET_DIR)/lib/firmware/rtlwifi/

You must create the target directory first, otherwise you'd get an error like:

install: target '....lib/firmware/rtlwifi/' is not a directory: No such file or directory

Regards,
Yann E. MORIN.

Quoted 11 lines
package/rtl8821au/rtl8821au.mk new file +4 -0
+endef
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
Signature · 6 lines
2.1.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
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.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH v7 1/1 rtl8821au: new package

In reply to Christian Stewart

Christian, Luca, All,

Luca, a licensing question for you... ;-)

On 2015-07-24 15:32 -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 13 lines
package/rtl8821au/rtl8821au.hash new file +1 -0
new file mode 100644
index 0000000..d54d3c3
@@ -0,0 +1 @@
+sha256 93beaf608880ecbca03bbeb8251b91d16e17724b36158b0571d1cebb7b4e5914  rtl8821au-f58e4a7fb27551bdbb4aee9db6086dd6ad996c8d.tar.gz
package/rtl8821au/rtl8821au.mk new file +0 -0
new file mode 100644
index 0000000..42f4cdd

package/rtl8821au/rtl8821au.mk line 9

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

You forgot the licensing information:

RTL8821AU_LICENSE = GPLv2
RTL8821AU_LICENSE_FILES = COPYING

Luca:

Also, two firmware blobs are installed, and we have no licensing info for those two; usually it's a proprietary license.

I wonder if/how we can reflect this in the licensing info above.

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.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v7 1/1 rtl8821au: new package

Dear Yann,

Quoted 12 lines · Yann E. MORIN

Christian, Luca, All,

Luca, a licensing question for you... ;-)

On 2015-07-24 15:32 -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 18 lines

package/rtl8821au/rtl8821au.mk line 9

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

You forgot the licensing information:

RTL8821AU_LICENSE = GPLv2
RTL8821AU_LICENSE_FILES = COPYING

Quoted 6 lines

Luca:

Also, two firmware blobs are installed, and we have no licensing info for those two; usually it's a proprietary license.

I wonder if/how we can reflect this in the licensing info above.

I can't think of any option other than:

RTL8821AU_LICENSE = GPLv2, proprietary (firmware blobs)

Signature · 1 line
Luca
#4 lore raw

PATCH v7 1/1 rtl8821au: new package

Luca, All,

On 2015-07-25 15:22 +0200, Luca Ceresoli spake thusly:

Quoted 34 lines
Quoted 12 lines · Yann E. MORIN

Christian, Luca, All,

Luca, a licensing question for you... ;-)

On 2015-07-24 15:32 -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 20 lines

package/rtl8821au/rtl8821au.mk line 9

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

You forgot the licensing information:

RTL8821AU_LICENSE = GPLv2
RTL8821AU_LICENSE_FILES = COPYING

Luca:

Quoted 8 lines
Quoted 4 lines

Also, two firmware blobs are installed, and we have no licensing info for those two; usually it's a proprietary license.

I wonder if/how we can reflect this in the licensing info above.

I can't think of any option other than:

RTL8821AU_LICENSE = GPLv2, proprietary (firmware blobs)

OK for me. Thanks!

Christian, care to address those issues and respin, please? Thanks!

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.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH v7 1/1 rtl8821au: new package

Dear Yann,

Quoted 42 lines · Yann E. MORIN

Luca, All,

On 2015-07-25 15:22 +0200, Luca Ceresoli spake thusly:

Quoted 39 lines
Quoted 12 lines · Yann E. MORIN

Christian, Luca, All,

Luca, a licensing question for you... ;-)

On 2015-07-24 15:32 -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 24 lines

package/rtl8821au/rtl8821au.mk line 9

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

You forgot the licensing information:

RTL8821AU_LICENSE = GPLv2
RTL8821AU_LICENSE_FILES = COPYING

Luca:

Also, two firmware blobs are installed, and we have no licensing info for those two; usually it's a proprietary license.

I wonder if/how we can reflect this in the licensing info above.

Quoted 8 lines
Quoted 3 lines

I can't think of any option other than:

RTL8821AU_LICENSE = GPLv2, proprietary (firmware blobs)

OK for me. Thanks!

Christian, care to address those issues and respin, please? Thanks!

BTW, Yann, yours was a good reminder for me while respinning my patch for the rtl8188eu module the I just sent, thanks! And here's what I come up with:

RTL8188EU_LICENSE = GPLv2, proprietary (rtl8188eufw.bin firmware blob)

Signature · 1 line
Luca
#6 lore raw

PATCH v7 1/1 rtl8821au: new package

In reply to Christian Stewart

Christian, All,

On 2015-07-24 15:32 -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.

One final note:

[--SNIP--]

Quoted 21 lines
package/rtl8821au/rtl8821au.hash new file +1 -0
new file mode 100644
index 0000000..d54d3c3
@@ -0,0 +1 @@
+sha256 93beaf608880ecbca03bbeb8251b91d16e17724b36158b0571d1cebb7b4e5914  rtl8821au-f58e4a7fb27551bdbb4aee9db6086dd6ad996c8d.tar.gz
package/rtl8821au/rtl8821au.mk new file +8 -0
new file mode 100644
index 0000000..42f4cdd
@@ -0,0 +1,21 @@
+################################################################################
+#
+# rtl8821au
+#
+################################################################################
+
+RTL8821AU_VERSION = f58e4a7fb27551bdbb4aee9db6086dd6ad996c8d
+RTL8821AU_SITE = $(call github,ulli-kroll,rtl8821au,$(RTL8821AU_VERSION))

package/rtl8821au/rtl8821au.mk line 18

Quoted 10 lines
package/rtl8821au/rtl8821au.mk new file +10 -0
+RTL8821AU_CFLAGS_ENDIAN = -DCONFIG_$(call qstrip,$(BR2_ENDIAN))_ENDIAN
+
+RTL8821AU_MODULE_MAKE_OPTS = \
+	CONFIG_RTL8812AU_8821AU=m \
+	KVER=$(LINUX_VERSION_PROBED) \
+	USER_EXTRA_CFLAGS=$(RTL8821AU_CFLAGS_ENDIAN)
+
+define RTL8821AU_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/firmware/* $(TARGET_DIR)/lib/firmware/rtlwifi/
+endef

Although what you did is technically valid, I believe this should probably be done using a post-install-target hook, like Luca did or his rtl8188eu driver:

    https://patchwork.ozlabs.org/patch/499980/

The reasonning behind this is that the kernel-module infra is implemented as post-install hooks, the firmware is part of the driver, and _INSTALL_TARGET_CMDS could be interpreted as to be used for the userland part (i.e. not the kernel module).

This is only a semantic reason; technically it does work, but for consistency across all packages that provide kernel modules, I'd prefer we use one solution of the other and that we do not mix the two.

Care to fix that too before you respin, please?

Thanks! :-)

Regards,
Yann E. MORIN.

Quoted 9 lines
package/rtl8821au/rtl8821au.mk new file +2 -0
+$(eval $(kernel-module))
+$(eval $(generic-package))
Signature · 6 lines
2.1.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
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.  |
'------------------------------^-------^------------------^--------------------'