[PATCH v2 1/2] mac80211: split rtw88 configuration for each supported chip

Alexis Lothoré alexis.lothore at bootlin.com
Fri Nov 3 21:48:41 PDT 2023


From: Alexis Lothoré <alexis.lothore at bootlin.com>

Current rtw88 build configuration builds modules for all chips supported by
rtw88 driver family. This brings the following issues:
- adding a chip with a different bus is not convenient (all chips currently
  depends on PCI)
- some features requirements are not relevant for all chips in family (eg
  802.11AC is enforced but RTW88-8723DE is only a 802.11b/g/n chip)

Remove those constraints/issues by adding one module build option per
supported chip, and add intermediate options to properly cascade
dependencies.

Signed-off-by: Alexis Lothoré <alexis.lothore at bootlin.com>
---
 package/kernel/mac80211/realtek.mk | 90 +++++++++++++++++++++++++-----
 1 file changed, 75 insertions(+), 15 deletions(-)

diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk
index 9c143583265e..3cd6740e6c6e 100644
--- a/package/kernel/mac80211/realtek.mk
+++ b/package/kernel/mac80211/realtek.mk
@@ -1,7 +1,8 @@
 PKG_DRIVERS += \
 	rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common \
 	rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723bs rtl8821ae \
-	rtl8xxxu rtw88
+	rtl8xxxu rtw88 rtw88-pci rtw88-8822b rtw88-8822c rtw88-8723d \
+	rtw88-8822be rtw88-8822ce rtw88-8723de
 
 config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI
 config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI
@@ -21,8 +22,14 @@ config-y += RTL8XXXU_UNTESTED
 config-$(call config_package,rtl8723bs) += RTL8723BS
 config-y += STAGING
 
-config-$(call config_package,rtw88) += RTW88 RTW88_CORE RTW88_PCI
-config-y += RTW88_8822BE RTW88_8822CE RTW88_8723DE
+config-$(call config_package,rtw88) += RTW88 RTW88_CORE
+config-$(call config_package,rtw88-pci) += RTW88_PCI
+config-$(call config_package,rtw88-8822b) += RTW88_8822B
+config-$(call config_package,rtw88-8822be) += RTW88_8822BE
+config-$(call config_package,rtw88-8822c) += RTW88_8822C
+config-$(call config_package,rtw88-8822ce) += RTW88_8822CE
+config-$(call config_package,rtw88-8723d) += RTW88_8723D
+config-$(call config_package,rtw88-8723de) += RTW88_8723DE
 config-$(CONFIG_PACKAGE_RTW88_DEBUG) += RTW88_DEBUG
 config-$(CONFIG_PACKAGE_RTW88_DEBUGFS) += RTW88_DEBUGFS
 
@@ -168,18 +175,71 @@ endef
 
 define KernelPackage/rtw88
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8822BE/RTL8822CE/RTL8723DE
-  DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 + at DRIVER_11AC_SUPPORT
-  FILES:=\
-	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822ce.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822c.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723de.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_core.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_pci.ko
-  AUTOLOAD:=$(call AutoProbe,rtw88_8822be rtw88_8822ce rtw88_8723de)
+  TITLE:=Realtek RTW88 common part
+  DEPENDS+= @PCI_SUPPORT +kmod-mac80211
+  FILES:=	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_core.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_core)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-pci
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTW88 PCI chips support
+  DEPENDS+= @PCI_SUPPORT +kmod-rtw88
+  FILES:=	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_pci.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_pci)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-8822b
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8822B family support
+  DEPENDS+= +kmod-rtw88 + at DRIVER_11AC_SUPPORT
+  FILES:=	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8822b)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-8822c
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8822C family support
+  DEPENDS+= +kmod-rtw88 + at DRIVER_11AC_SUPPORT
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822c.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8822c)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-8723d
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8723D family support
+  DEPENDS+= +kmod-rtw88
+  FILES:=	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8723d)
+  HIDDEN:=1
+endef
+
+define KernelPackage/rtw88-8822be
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8822BE support
+  DEPENDS+= +kmod-rtw88-pci +kmod-rtw88-8822b
+  FILES:=	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8822be)
+endef
+
+define KernelPackage/rtw88-8822ce
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8822CE support
+  DEPENDS+= +kmod-rtw88-pci +kmod-rtw88-8822c
+  FILES:=	$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822ce.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8822ce)
+endef
+
+define KernelPackage/rtw88-8723de
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8723DE support
+  DEPENDS+= +kmod-rtw88-pci +kmod-rtw88-8723d
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723de.ko
+  AUTOLOAD:=$(call AutoProbe,rtw88_8723)
 endef
 
 define KernelPackage/rtl8723bs
-- 
2.42.0




More information about the openwrt-devel mailing list