Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtw88: extract: make 8723d an individual kernel module

Make objects about 8723d functions and 8723d tables,
i.e. rtw8723d.o and rtw8723d_table.o, an individual
kernel module called rtw88_8723d.ko.

For 8723d pcie chip, i.e. 8723DE chip, add a chip
entry point module called rtw88_8723de.ko which
will depend on rtw88_8723d.ko and rtwpci.ko.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200515052327.31874-6-yhchuang@realtek.com

authored by

Zong-Zhe Yang and committed by
Kalle Valo
f56f0863 416e87fc

+60 -6
+5 -1
drivers/net/wireless/realtek/rtw88/Kconfig
··· 22 22 config RTW88_8822C 23 23 tristate 24 24 25 + config RTW88_8723D 26 + tristate 27 + 25 28 config RTW88_8822BE 26 29 tristate "Realtek 8822BE PCI wireless network adapter" 27 30 depends on PCI ··· 48 45 802.11ac PCIe wireless network adapter 49 46 50 47 config RTW88_8723DE 51 - bool "Realtek 8723DE PCI wireless network adapter" 48 + tristate "Realtek 8723DE PCI wireless network adapter" 52 49 depends on PCI 53 50 select RTW88_CORE 54 51 select RTW88_PCI 52 + select RTW88_8723D 55 53 help 56 54 Select this option will enable support for 8723DE chipset 57 55
+6 -1
drivers/net/wireless/realtek/rtw88/Makefile
··· 18 18 wow.o \ 19 19 regd.o 20 20 21 - rtw88-$(CONFIG_RTW88_8723DE) += rtw8723d.o rtw8723d_table.o 22 21 23 22 obj-$(CONFIG_RTW88_8822B) += rtw88_8822b.o 24 23 rtw88_8822b-objs := rtw8822b.o rtw8822b_table.o ··· 30 31 31 32 obj-$(CONFIG_RTW88_8822CE) += rtw88_8822ce.o 32 33 rtw88_8822ce-objs := rtw8822ce.o 34 + 35 + obj-$(CONFIG_RTW88_8723D) += rtw88_8723d.o 36 + rtw88_8723d-objs := rtw8723d.o rtw8723d_table.o 37 + 38 + obj-$(CONFIG_RTW88_8723DE) += rtw88_8723de.o 39 + rtw88_8723de-objs := rtw8723de.o 33 40 34 41 obj-$(CONFIG_RTW88_PCI) += rtwpci.o 35 42 rtwpci-objs := pci.o
-1
drivers/net/wireless/realtek/rtw88/main.h
··· 40 40 extern unsigned int rtw_fw_lps_deep_mode; 41 41 extern unsigned int rtw_debug_mask; 42 42 extern const struct ieee80211_ops rtw_ops; 43 - extern struct rtw_chip_info rtw8723d_hw_spec; 44 43 45 44 #define RTW_MAX_CHANNEL_NUM_2G 14 46 45 #define RTW_MAX_CHANNEL_NUM_5G 49
-3
drivers/net/wireless/realtek/rtw88/pci.c
··· 1594 1594 EXPORT_SYMBOL(rtw_pci_shutdown); 1595 1595 1596 1596 static const struct pci_device_id rtw_pci_id_table[] = { 1597 - #ifdef CONFIG_RTW88_8723DE 1598 - { RTK_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xD723, rtw8723d_hw_spec) }, 1599 - #endif 1600 1597 {}, 1601 1598 }; 1602 1599 MODULE_DEVICE_TABLE(pci, rtw_pci_id_table);
+5
drivers/net/wireless/realtek/rtw88/rtw8723d.c
··· 2 2 /* Copyright(c) 2018-2019 Realtek Corporation 3 3 */ 4 4 5 + #include <linux/module.h> 5 6 #include "main.h" 6 7 #include "coex.h" 7 8 #include "fw.h" ··· 2741 2740 EXPORT_SYMBOL(rtw8723d_hw_spec); 2742 2741 2743 2742 MODULE_FIRMWARE("rtw88/rtw8723d_fw.bin"); 2743 + 2744 + MODULE_AUTHOR("Realtek Corporation"); 2745 + MODULE_DESCRIPTION("Realtek 802.11n wireless 8723d driver"); 2746 + MODULE_LICENSE("Dual BSD/GPL");
+30
drivers/net/wireless/realtek/rtw88/rtw8723de.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 2 + /* Copyright(c) 2018-2019 Realtek Corporation 3 + */ 4 + 5 + #include <linux/module.h> 6 + #include <linux/pci.h> 7 + #include "rtw8723de.h" 8 + 9 + static const struct pci_device_id rtw_8723de_id_table[] = { 10 + { 11 + PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xD723), 12 + .driver_data = (kernel_ulong_t)&rtw8723d_hw_spec 13 + }, 14 + {} 15 + }; 16 + MODULE_DEVICE_TABLE(pci, rtw_8723de_id_table); 17 + 18 + static struct pci_driver rtw_8723de_driver = { 19 + .name = "rtw_8723de", 20 + .id_table = rtw_8723de_id_table, 21 + .probe = rtw_pci_probe, 22 + .remove = rtw_pci_remove, 23 + .driver.pm = &rtw_pm_ops, 24 + .shutdown = rtw_pci_shutdown, 25 + }; 26 + module_pci_driver(rtw_8723de_driver); 27 + 28 + MODULE_AUTHOR("Realtek Corporation"); 29 + MODULE_DESCRIPTION("Realtek 802.11n wireless 8723de driver"); 30 + MODULE_LICENSE("Dual BSD/GPL");
+14
drivers/net/wireless/realtek/rtw88/rtw8723de.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 + /* Copyright(c) 2018-2019 Realtek Corporation 3 + */ 4 + 5 + #ifndef __RTW_8723DE_H_ 6 + #define __RTW_8723DE_H_ 7 + 8 + extern const struct dev_pm_ops rtw_pm_ops; 9 + extern struct rtw_chip_info rtw8723d_hw_spec; 10 + int rtw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id); 11 + void rtw_pci_remove(struct pci_dev *pdev); 12 + void rtw_pci_shutdown(struct pci_dev *pdev); 13 + 14 + #endif