Skip to contentSkip to conversation

package/rtl8723bs: Wi-Fi driver is now a Linux staging driver

PATCH New Michel Stempin 2 participants 2 messages Mar 17, 2018 – Mar 26, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/rtl8723bs: Wi-Fi driver is now a Linux staging driver

#1 lore raw

PATCH 1/1 package/rtl8723bs: Wi-Fi driver is now a Linux staging driver

Hello,

Thanks for your contribution!

Quoted 5 lines · Michel Stempin

From 7cb67b022d1dbdbbac2ec06dbd7f7fdf3fd09fd3 Mon Sep 17 00:00:00 2001
From: Michel Stempin <[email protected]>
Date: Sat, 17 Mar 2018 10:02:34 +0100
Subject: [PATCH 1/1] The rtl8723bs is now a Linux staging driver since kernel
4.12.

Could you send your patches with "git send-email" ? This way they would have the proper format.

Quoted 25 lines

The old git commit is used for kernel < 4.12 with patches applied, but for kernel >= 4.12, the newest commit featuring only binary firmwares is fetched and only the firmwares are installed into the target directory.

Getting the kernel version this early in the post-patch hook is only possible from the configuration, as the kernel is not yet configured and cannot be probed for the actual version.

---
 ...tl8723bs-add-debug-level-modparam.patch.conditional} |  0
 package/rtl8723bs/rtl8723bs.mk                          | 17 +++++++++++++++++
 2 files changed, 17 insertions(+)
 rename package/rtl8723bs/{0001-rtl8723bs-add-debug-level-modparam.patch => 0001-rtl8723bs-add-debug-level-modparam.patch.conditional} (100%)
package/rtl8723bs/0001-rtl8723bs-add-debug-level-modparam.patch.conditional renamed from package/rtl8723bs/0001-rtl8723bs-add-debug-level-modparam.patch +0 -0
similarity index 100%
rename from package/rtl8723bs/0001-rtl8723bs-add-debug-level-modparam.patch
rename to package/rtl8723bs/0001-rtl8723bs-add-debug-level-modparam.patch.conditional
package/rtl8723bs/rtl8723bs.mk +0 -0
index 4c6303c..bc6dd4f 100644

package/rtl8723bs/rtl8723bs.mk line 10

Quoted 7 lines
package/rtl8723bs/rtl8723bs.mk +4 -0
@@ -4,7 +4,16 @@
 #
 ################################################################################
 
+RTL8723BS_NEEDS_SOURCES=$(shell read -r MAJ MIN \
+	<<< $$(echo "$(BR2_LINUX_KERNEL_VERSION)" | \
+	sed -nr 's/[^0-9]*([0-9]+)\.([0-9]+).*/\1 \2/p') && \
+	[ "0$$MAJ" -lt 4 -o "0$$MAJ" -eq 4 -a "0$$MIN" -lt 12 ] && echo 1 ||echo 0)

Unfortunately, this doesn't work, because BR2_LINUX_KERNEL_VERSION does not necessarily have the form x.y.z. It can be a Git commit, a Git tag, etc.

It's in fact not possible to know the kernel version from the Buildroot configuration, i.e without extracting/patching the kernel.

Therefore, I believe the only solution is to add a sub-option to the rtl9723bs package to allow the user to explicitly indicate if he wants to use the version suitable for < 4.12 or the version suitable for >= 4.12.

Quoted 10 lines
package/rtl8723bs/rtl8723bs.mk +5 -0
+ifeq ($(RTL8723BS_NEEDS_SOURCES),1)
 RTL8723BS_VERSION = 11ab92d8ccd71c80f0102828366b14ef6b676fb2
+else
+RTL8723BS_VERSION = cc77e7b6092c54500058cd027b679421b9399905
+endif
+
 RTL8723BS_SITE = $(call github,hadess,rtl8723bs,$(RTL8723BS_VERSION))
 RTL8723BS_LICENSE = GPL-2.0, proprietary (*.bin firmware blobs)
 

package/rtl8723bs/rtl8723bs.mk RTL8723BS_MODULE_MAKE_OPTS = \ · line 32

Quoted 8 lines
package/rtl8723bs/rtl8723bs.mk +5 -0
@@ -16,6 +25,14 @@ RTL8723BS_MODULE_MAKE_OPTS = \
 RTL8723BS_BINS = rtl8723bs_ap_wowlan.bin rtl8723bs_wowlan.bin \
 	rtl8723bs_bt.bin rtl8723bs_nic.bin
 
+define RTL8723BS_CONDITIONAL_PATCH
+	if [ $(RTL8723BS_NEEDS_SOURCES) -eq 1 ]; then \
+		$(APPLY_PATCHES) $(@D) package/rtl8723bs 0001-rtl8723bs-add-debug-level-modparam.patch.conditional; \
+	fi;
+endef

This patch could simply go in package/rtl8723bs/11ab92d8ccd71c80f0102828366b14ef6b676fb2/, and it will automatically be applied only if the current version is 11ab92d8ccd71c80f0102828366b14ef6b676fb2.

Could you rework this according to those comments and submit an updated version ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com