diff mbox series

[v5,11/11] wifi: rtlwifi: Enable the new rtl8192du driver

Message ID 0fb5c4d9-d43c-4aa2-b483-c0104995fa9e@gmail.com
State Superseded
Headers show
Series [v5,01/11] wifi: rtlwifi: Add rtl8192du/table.{c,h} | expand

Commit Message

Bitterblue Smith May 8, 2024, 10:55 a.m. UTC
The RTL8192DU is an older Wifi 4 dual band chip. It comes in two
flavours: single MAC single PHY (like most Realtek Wifi 4 USB devices),
and dual MAC dual PHY.

The single MAC single PHY version is 2T2R and can work either in the
2.4 GHz band or the 5 GHz band.

The dual MAC dual PHY version has two USB interfaces and appears to the
system as two separate 1T1R Wifi devices, one working in the 2.4 GHz
band, the other in the 5 GHz band.

This was tested only with a single MAC single PHY device, mostly in
station mode. The speeds in the 2.4 GHz band with 20 MHz channel width
are similar to the out-of-tree driver: 85/51 megabits/second.

Stefan Lippers-Hollmann tested the speed in the 5 GHz band with 40 MHz
channel width: 173/99 megabits/second.

It was also tested briefly in AP mode. It's emitting beacons and my
phone can connect to it.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
v5:
 - Call it 802.11n instead of 802.11an in Kconfig.

v4:
 - No change.

v3:
 - No change.

v2:
 - Patch is new in v2, split from patch 3/3 in v1.
---
 drivers/net/wireless/realtek/rtlwifi/Kconfig        | 12 ++++++++++++
 drivers/net/wireless/realtek/rtlwifi/Makefile       |  1 +
 .../net/wireless/realtek/rtlwifi/rtl8192du/Makefile | 13 +++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 drivers/net/wireless/realtek/rtlwifi/rtl8192du/Makefile

Comments

kernel test robot May 10, 2024, 5:46 a.m. UTC | #1
Hi Bitterblue,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on next-20240509]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bitterblue-Smith/wifi-rtlwifi-Add-rtl8192du-table-c-h/20240508-185621
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/0fb5c4d9-d43c-4aa2-b483-c0104995fa9e%40gmail.com
patch subject: [PATCH v5 11/11] wifi: rtlwifi: Enable the new rtl8192du driver
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20240510/202405101334.ODz4AccN-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240510/202405101334.ODz4AccN-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405101334.ODz4AccN-lkp@intel.com/

All errors (new ones prefixed by >>):

   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/fw.o: in function `rtl92d_download_fw':
>> fw.c:(.text.rtl92d_download_fw+0x0): multiple definition of `rtl92d_download_fw'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.o:fw.c:(.text.rtl92d_download_fw+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.o: in function `rtl92de_set_check_bssid':
>> hw.c:(.text.rtl92de_set_check_bssid+0x0): multiple definition of `rtl92de_set_check_bssid'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.o:hw.c:(.text.rtl92de_set_check_bssid+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.o: in function `rtl92de_set_network_type':
>> hw.c:(.text.rtl92de_set_network_type+0x0): multiple definition of `rtl92de_set_network_type'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.o:hw.c:(.text.rtl92de_set_network_type+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.o: in function `rtl92d_linked_set_reg':
>> hw.c:(.text.rtl92d_linked_set_reg+0x0): multiple definition of `rtl92d_linked_set_reg'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.o:hw.c:(.text.rtl92d_linked_set_reg+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.o: in function `rtl92de_enable_interrupt':
>> hw.c:(.text.rtl92de_enable_interrupt+0x0): multiple definition of `rtl92de_enable_interrupt'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.o:hw.c:(.text.rtl92de_enable_interrupt+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.o: in function `rtl92de_disable_interrupt':
>> hw.c:(.text.rtl92de_disable_interrupt+0x0): multiple definition of `rtl92de_disable_interrupt'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.o:hw.c:(.text.rtl92de_disable_interrupt+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.o: in function `rtl92de_set_beacon_related_registers':
>> hw.c:(.text.rtl92de_set_beacon_related_registers+0x0): multiple definition of `rtl92de_set_beacon_related_registers'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.o:hw.c:(.text.rtl92de_set_beacon_related_registers+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.o: in function `rtl92de_set_beacon_interval':
>> hw.c:(.text.rtl92de_set_beacon_interval+0x0): multiple definition of `rtl92de_set_beacon_interval'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.o:hw.c:(.text.rtl92de_set_beacon_interval+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/hw.o: in function `rtl92de_update_interrupt_mask':
>> hw.c:(.text.rtl92de_update_interrupt_mask+0x0): multiple definition of `rtl92de_update_interrupt_mask'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.o:hw.c:(.text.rtl92de_update_interrupt_mask+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/led.o: in function `rtl92de_led_control':
>> led.c:(.text.rtl92de_led_control+0x0): multiple definition of `rtl92de_led_control'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.o:led.c:(.text.rtl92de_led_control+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_query_bb_reg':
>> phy.c:(.text.rtl92d_phy_query_bb_reg+0x0): multiple definition of `rtl92d_phy_query_bb_reg'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_query_bb_reg+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_set_bb_reg':
>> phy.c:(.text.rtl92d_phy_set_bb_reg+0x0): multiple definition of `rtl92d_phy_set_bb_reg'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_set_bb_reg+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_mac_config':
>> phy.c:(.text.rtl92d_phy_mac_config+0x0): multiple definition of `rtl92d_phy_mac_config'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_mac_config+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_bb_config':
>> phy.c:(.text.rtl92d_phy_bb_config+0x0): multiple definition of `rtl92d_phy_bb_config'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_bb_config+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_rf_config':
>> phy.c:(.text.rtl92d_phy_rf_config+0x0): multiple definition of `rtl92d_phy_rf_config'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_rf_config+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_config_rf_with_headerfile':
>> phy.c:(.text.rtl92d_phy_config_rf_with_headerfile+0x0): multiple definition of `rtl92d_phy_config_rf_with_headerfile'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_config_rf_with_headerfile+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_set_bw_mode':
>> phy.c:(.text.rtl92d_phy_set_bw_mode+0x0): multiple definition of `rtl92d_phy_set_bw_mode'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_set_bw_mode+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_iq_calibrate':
>> phy.c:(.text.rtl92d_phy_iq_calibrate+0x0): multiple definition of `rtl92d_phy_iq_calibrate'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_iq_calibrate+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_reload_iqk_setting':
>> phy.c:(.text.rtl92d_phy_reload_iqk_setting+0x0): multiple definition of `rtl92d_phy_reload_iqk_setting'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_reload_iqk_setting+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_lc_calibrate':
>> phy.c:(.text.rtl92d_phy_lc_calibrate+0x0): multiple definition of `rtl92d_phy_lc_calibrate'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_lc_calibrate+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_ap_calibrate':
   phy.c:(.text.rtl92d_phy_ap_calibrate+0x0): multiple definition of `rtl92d_phy_ap_calibrate'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_ap_calibrate+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_set_rf_power_state':
   phy.c:(.text.rtl92d_phy_set_rf_power_state+0x0): multiple definition of `rtl92d_phy_set_rf_power_state'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_set_rf_power_state+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_set_poweron':
   phy.c:(.text.rtl92d_phy_set_poweron+0x0): multiple definition of `rtl92d_phy_set_poweron'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_set_poweron+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_update_bbrf_configuration':
   phy.c:(.text.rtl92d_update_bbrf_configuration+0x0): multiple definition of `rtl92d_update_bbrf_configuration'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_update_bbrf_configuration+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_sw_chnl':
   phy.c:(.text.rtl92d_phy_sw_chnl+0x0): multiple definition of `rtl92d_phy_sw_chnl'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_sw_chnl+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.o: in function `rtl92d_phy_check_poweroff':
   phy.c:(.text.rtl92d_phy_check_poweroff+0x0): multiple definition of `rtl92d_phy_check_poweroff'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.o:phy.c:(.text.rtl92d_phy_check_poweroff+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/rf.o: in function `rtl92d_phy_enable_anotherphy':
   rf.c:(.text.rtl92d_phy_enable_anotherphy+0x0): multiple definition of `rtl92d_phy_enable_anotherphy'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/rf.o:rf.c:(.text.rtl92d_phy_enable_anotherphy+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/rf.o: in function `rtl92d_phy_powerdown_anotherphy':
   rf.c:(.text.rtl92d_phy_powerdown_anotherphy+0x0): multiple definition of `rtl92d_phy_powerdown_anotherphy'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/rf.o:rf.c:(.text.rtl92d_phy_powerdown_anotherphy+0x0): first defined here
   mips-linux-ld: drivers/net/wireless/realtek/rtlwifi/rtl8192du/rf.o: in function `rtl92d_phy_rf6052_config':
   rf.c:(.text.rtl92d_phy_rf6052_config+0x0): multiple definition of `rtl92d_phy_rf6052_config'; drivers/net/wireless/realtek/rtlwifi/rtl8192de/rf.o:rf.c:(.text.rtl92d_phy_rf6052_config+0x0): first defined here
Ping-Ke Shih May 10, 2024, 5:57 a.m. UTC | #2
Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> The RTL8192DU is an older Wifi 4 dual band chip. It comes in two
> flavours: single MAC single PHY (like most Realtek Wifi 4 USB devices),
> and dual MAC dual PHY.
> 
> The single MAC single PHY version is 2T2R and can work either in the
> 2.4 GHz band or the 5 GHz band.
> 
> The dual MAC dual PHY version has two USB interfaces and appears to the
> system as two separate 1T1R Wifi devices, one working in the 2.4 GHz
> band, the other in the 5 GHz band.
> 
> This was tested only with a single MAC single PHY device, mostly in
> station mode. The speeds in the 2.4 GHz band with 20 MHz channel width
> are similar to the out-of-tree driver: 85/51 megabits/second.
> 
> Stefan Lippers-Hollmann tested the speed in the 5 GHz band with 40 MHz
> channel width: 173/99 megabits/second.
> 
> It was also tested briefly in AP mode. It's emitting beacons and my
> phone can connect to it.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

I have reviewed v5. No big problems for me.

Kernel robot reported multiple definition because of static link (I think), so
you should change the function name prefix to 8192du or 8192d properly to
avoid the errors.
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/Kconfig b/drivers/net/wireless/realtek/rtlwifi/Kconfig
index cfe63f7b28d9..991e1025f4d8 100644
--- a/drivers/net/wireless/realtek/rtlwifi/Kconfig
+++ b/drivers/net/wireless/realtek/rtlwifi/Kconfig
@@ -119,6 +119,18 @@  config RTL8192CU
 
 	If you choose to build it as a module, it will be called rtl8192cu
 
+config RTL8192DU
+	tristate "Realtek RTL8192DU USB Wireless Network Adapter"
+	depends on USB
+	select RTLWIFI
+	select RTLWIFI_USB
+	select RTL8192D_COMMON
+	help
+	This is the driver for Realtek RTL8192DU 802.11n USB
+	wireless network adapters.
+
+	If you choose to build it as a module, it will be called rtl8192du
+
 config RTLWIFI
 	tristate
 	select FW_LOADER
diff --git a/drivers/net/wireless/realtek/rtlwifi/Makefile b/drivers/net/wireless/realtek/rtlwifi/Makefile
index 423981b148df..9cf32277c7f1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/Makefile
+++ b/drivers/net/wireless/realtek/rtlwifi/Makefile
@@ -25,6 +25,7 @@  obj-$(CONFIG_RTL8192CU)		+= rtl8192cu/
 obj-$(CONFIG_RTL8192SE)		+= rtl8192se/
 obj-$(CONFIG_RTL8192D_COMMON)	+= rtl8192d/
 obj-$(CONFIG_RTL8192DE)		+= rtl8192de/
+obj-$(CONFIG_RTL8192DU)		+= rtl8192du/
 obj-$(CONFIG_RTL8723AE)		+= rtl8723ae/
 obj-$(CONFIG_RTL8723BE)		+= rtl8723be/
 obj-$(CONFIG_RTL8188EE)		+= rtl8188ee/
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192du/Makefile b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/Makefile
new file mode 100644
index 000000000000..569bfd3d5030
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/Makefile
@@ -0,0 +1,13 @@ 
+# SPDX-License-Identifier: GPL-2.0
+rtl8192du-objs :=		\
+		dm.o		\
+		fw.o		\
+		hw.o		\
+		led.o		\
+		phy.o		\
+		rf.o		\
+		sw.o		\
+		table.o		\
+		trx.o
+
+obj-$(CONFIG_RTL8192DU) += rtl8192du.o