From nobody Sun Jun 12 18:43:38 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 702C283C679; Sun, 12 Jun 2022 18:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LLk9k2Xtfz3CwN; Sun, 12 Jun 2022 18:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655059418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HCkVNFpm1OlUxZcbwOAo1cEgV1MtCAd0woS0TXL4yao=; b=kjbCyCBvSsxoNbxozYT1GUJVvJYUJN+R+ObK2h11fIK27f7vaQEPgwI40XZKtOyVJMkYpY Wwd00/qOpmUK+MPY/s7ivLVVDAHu1YhjvCGrzBLFQe/GmAkm3RM0trUnyV9Dydbhg8TpJ/ zv7Y3Uba8Im2Ojf+JxIxgO+/TPqGhhUuP/7Yyfxz8y0iZHYqR/z0bOrUnQi2A8k94G6vhx LOvtYjyJWOQnm/mojR3LO1IV4rEeYtUG5aDnRW7872G5QTloD75870/zEKNyXpp7EVdh3b IeuN6jH+fS5X+GC25TfRl5Pen+oKgL5t1z15L9JflCmRH71wYzTLnEQoqKFnrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 371E7269A7; Sun, 12 Jun 2022 18:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25CIhcWH014634; Sun, 12 Jun 2022 18:43:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25CIhcLr014633; Sun, 12 Jun 2022 18:43:38 GMT (envelope-from git) Date: Sun, 12 Jun 2022 18:43:38 GMT Message-Id: <202206121843.25CIhcLr014633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0f7b9777f8f3 - main - rtw88: split driver up into a core and pci part List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f7b9777f8f39fbc230b3e1de2f844d9f839adea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655059418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HCkVNFpm1OlUxZcbwOAo1cEgV1MtCAd0woS0TXL4yao=; b=nSOQPWqex+IHKu3S3ko5pnx1qKUA5ljJomWgPNbsjr9eE2/7gl+fCsWhS2Fms3ZeKjhAJm 7FjnxILhPPnDgy51Guev4qH/k8+x3FT4sBYom5HkWhgrxCNyIAh+6ZMGdEmqG5uY3Js9cY XmzRo1tPnYsQNAJ9tX++jMAFHmuWtroo/FICPOT4JdmFH+6i0Pq+xZ1KqlvLZGQ2bmMX2Q 8LEODEAvbhUKuzwgUV3a4FL3shPZkCtKSBRNykQBnfbmssx16hQ75/+1s6l4zDEn2MyVbX touV7mc3kEnIQ6o80nx5dQvEiARd5dq1X7RnNwrhlJMMj0HxIRgubEBdsVgVIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655059418; a=rsa-sha256; cv=none; b=jkbgNfAX39net7jA4uXPgITvIFFfDxU7sa0mrv0fjZb+wTi11qVSPIlZ1Lq81anV2dMXje /OXIewXGLUaZruZBNHU7oW2i+Q++iT3QjeeXL0QRdKW64kpcizTMhiFBYo5/WK4Uhoc+ab Ajvim2+UIYoMMLCzGDunV0IztIGa+/pgN75zUGpFdjZ3FpHsq+zKkhf5iDEX/AXU5S+S1D 50QChKAIr5v+hE/47gRQOBljJ8q5DYXC3aOTlDHywCK3k3Ab0voD64pK6PRtZ9uwKjSuzm a/Dhp/5MgP3mjEzYid/KZsoWMr9Y8oK3DV3xFoXMXLKSAP+cMEzqwl8gExnS6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0f7b9777f8f39fbc230b3e1de2f844d9f839adea commit 0f7b9777f8f39fbc230b3e1de2f844d9f839adea Author: Bjoern A. Zeeb AuthorDate: 2022-06-12 18:35:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-12 18:35:58 +0000 rtw88: split driver up into a core and pci part Split the driver up into two modules (if_rtw88_pci.ko and rtw88_core.ko). This is in preparation for the hopefully eventually upcoming USB support using the same driver core. Note: this changes the module name to load to if_rtw88_pci.ko instead of if_rtw88.ko. If using devmatch(8) everything should stay the same as the driver name (used for net.wlan.devices) stays rtw88. If using kld_list in rc.conf or loader.conf you will need to adjust the name. Update man page for this. MFC after: 3 days --- share/man/man4/rtw88.4 | 4 ++-- sys/contrib/dev/rtw88/main.c | 8 ++++++++ sys/contrib/dev/rtw88/pci.c | 10 ++++------ sys/modules/rtw88/Makefile | 37 ++++--------------------------------- sys/modules/rtw88/Makefile.inc | 23 +++++++++++++++++++++++ sys/modules/rtw88/core/Makefile | 17 +++++++++++++++++ sys/modules/rtw88/pci/Makefile | 13 +++++++++++++ 7 files changed, 71 insertions(+), 41 deletions(-) diff --git a/share/man/man4/rtw88.4 b/share/man/man4/rtw88.4 index 0ace002e4bde..43a51405d1d5 100644 --- a/share/man/man4/rtw88.4 +++ b/share/man/man4/rtw88.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2022 +.Dd June 12, 2022 .Dt rtw88 4 .Os .Sh NAME @@ -41,7 +41,7 @@ lines in .Xr rc.conf 5 to manually load the driver as a module at boot time: .Bd -literal -offset indent -kld_list="${kld_list} if_rtw88" +kld_list="${kld_list} if_rtw88_pci" .Ed .Pp The driver should automatically load any diff --git a/sys/contrib/dev/rtw88/main.c b/sys/contrib/dev/rtw88/main.c index 2f397ace02b3..2522056c3e4b 100644 --- a/sys/contrib/dev/rtw88/main.c +++ b/sys/contrib/dev/rtw88/main.c @@ -2120,3 +2120,11 @@ EXPORT_SYMBOL(rtw_unregister_hw); MODULE_AUTHOR("Realtek Corporation"); MODULE_DESCRIPTION("Realtek 802.11ac wireless core module"); MODULE_LICENSE("Dual BSD/GPL"); +#if defined(__FreeBSD__) +MODULE_VERSION(rtw88_core, 1); +MODULE_DEPEND(rtw88_core, linuxkpi, 1, 1, 1); +MODULE_DEPEND(rtw88_core, linuxkpi_wlan, 1, 1, 1); +#ifdef CONFIG_RTW88_DEBUGFS +MODULE_DEPEND(rtw88_core, debugfs, 1, 1, 1); +#endif +#endif diff --git a/sys/contrib/dev/rtw88/pci.c b/sys/contrib/dev/rtw88/pci.c index 431d0c1c8b98..34d58b0f3db3 100644 --- a/sys/contrib/dev/rtw88/pci.c +++ b/sys/contrib/dev/rtw88/pci.c @@ -1936,10 +1936,8 @@ MODULE_AUTHOR("Realtek Corporation"); MODULE_DESCRIPTION("Realtek 802.11ac wireless PCI driver"); MODULE_LICENSE("Dual BSD/GPL"); #if defined(__FreeBSD__) -MODULE_VERSION(rtw_pci, 1); -MODULE_DEPEND(rtw_pci, linuxkpi, 1, 1, 1); -MODULE_DEPEND(rtw_pci, linuxkpi_wlan, 1, 1, 1); -#ifdef CONFIG_RTW88_DEBUGFS -MODULE_DEPEND(rtw_pci, debugfs, 1, 1, 1); -#endif +MODULE_VERSION(rtw88_pci, 1); +MODULE_DEPEND(rtw88_pci, rtw88_core, 1, 1, 1); +MODULE_DEPEND(rtw88_pci, linuxkpi, 1, 1, 1); +MODULE_DEPEND(rtw88_pci, linuxkpi_wlan, 1, 1, 1); #endif diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile index a8880256eeae..972065e7f208 100644 --- a/sys/modules/rtw88/Makefile +++ b/sys/modules/rtw88/Makefile @@ -1,36 +1,7 @@ # $FreeBSD$ -DEVRTW88DIR= ${SRCTOP}/sys/contrib/dev/rtw88 +SUBDIR= core +SUBDIR+= pci +#SUBDIR+= usb -.PATH: ${DEVRTW88DIR} - -WITH_CONFIG_PM= 0 - -KMOD= if_rtw88 - -SRCS= main.c -SRCS+= bf.c coex.c debug.c efuse.c fw.c mac.c mac80211.c -SRCS+= pci.c phy.c ps.c regd.c -SRCS+= rtw8723d.c rtw8723d_table.c rtw8723de.c # 11n -SRCS+= rtw8821c.c rtw8821c_table.c rtw8821ce.c # 11ac -SRCS+= rtw8822b.c rtw8822b_table.c rtw8822be.c # 11ac -SRCS+= rtw8822c.c rtw8822c_table.c rtw8822ce.c # 11ac -SRCS+= rx.c sar.c sec.c tx.c util.c - -.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0 -SRCR+= wow.c -CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM} -.endif - -# Other -SRCS+= ${LINUXKPI_GENSRCS} -SRCS+= opt_wlan.h opt_inet6.h opt_inet.h - -CFLAGS+= -DKBUILD_MODNAME='"rtw88"' - -CFLAGS+= -I${DEVRTW88DIR} -CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include -CFLAGS+= -DCONFIG_RTW88_DEBUG -#CFLAGS+= -DCONFIG_RTW88_DEBUGFS - -.include +.include diff --git a/sys/modules/rtw88/Makefile.inc b/sys/modules/rtw88/Makefile.inc new file mode 100644 index 000000000000..b4a682a35519 --- /dev/null +++ b/sys/modules/rtw88/Makefile.inc @@ -0,0 +1,23 @@ +# $FreeBSD$ + +# Common information shared by all submodule builds. + +DEVRTW88DIR= ${SRCTOP}/sys/contrib/dev/rtw88 + +.PATH: ${DEVRTW88DIR} + +WITH_CONFIG_PM= 0 + +# Other +SRCS+= ${LINUXKPI_GENSRCS} +SRCS+= opt_wlan.h opt_inet6.h opt_inet.h + +# Helpful after fresh imports. +CFLAGS+= -ferror-limit=0 + +CFLAGS+= -I${DEVRTW88DIR} +CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include +CFLAGS+= -DCONFIG_RTW88_DEBUG +#CFLAGS+= -DCONFIG_RTW88_DEBUGFS + +# end diff --git a/sys/modules/rtw88/core/Makefile b/sys/modules/rtw88/core/Makefile new file mode 100644 index 000000000000..e19103ce8417 --- /dev/null +++ b/sys/modules/rtw88/core/Makefile @@ -0,0 +1,17 @@ +# $FreeBSD$ + +KMOD= rtw88_core + +SRCS= main.c +SRCS+= bf.c coex.c debug.c efuse.c fw.c mac.c mac80211.c +SRCS+= phy.c ps.c regd.c +SRCS+= rx.c sar.c sec.c tx.c util.c + +.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0 +SRCR+= wow.c +CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM} +.endif + +CFLAGS+= -DKBUILD_MODNAME='"rtw88_core"' + +.include diff --git a/sys/modules/rtw88/pci/Makefile b/sys/modules/rtw88/pci/Makefile new file mode 100644 index 000000000000..070e6c8e2bc0 --- /dev/null +++ b/sys/modules/rtw88/pci/Makefile @@ -0,0 +1,13 @@ +# $FreeBSD$ + +KMOD= if_rtw88_pci + +SRCS+= pci.c +SRCS+= rtw8723d.c rtw8723d_table.c rtw8723de.c # 11n +SRCS+= rtw8821c.c rtw8821c_table.c rtw8821ce.c # 11ac +SRCS+= rtw8822b.c rtw8822b_table.c rtw8822be.c # 11ac +SRCS+= rtw8822c.c rtw8822c_table.c rtw8822ce.c # 11ac + +CFLAGS+= -DKBUILD_MODNAME='"rtw88"' + +.include