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

rtw88: extract: make 8822c an individual kernel module

Make objects about 8822c functions and 8822c tables,
i.e. rtw8822c.o and rtw8822c_table.o, an individual
kernel module called rtw88_8822c.ko.

For 8822c pcie chip, i.e. 8822CE chip, add a chip
entry point module called rtw88_8822ce.ko which
will depend on rtw88_8822c.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-4-yhchuang@realtek.com

authored by

Zong-Zhe Yang and committed by
Kalle Valo
ba0fbe23 72f256c2

+60 -6
+5 -1
drivers/net/wireless/realtek/rtw88/Kconfig
··· 16 16 config RTW88_PCI 17 17 tristate 18 18 19 + config RTW88_8822C 20 + tristate 21 + 19 22 config RTW88_8822BE 20 23 bool "Realtek 8822BE PCI wireless network adapter" 21 24 depends on PCI ··· 30 27 802.11ac PCIe wireless network adapter 31 28 32 29 config RTW88_8822CE 33 - bool "Realtek 8822CE PCI wireless network adapter" 30 + tristate "Realtek 8822CE PCI wireless network adapter" 34 31 depends on PCI 35 32 select RTW88_CORE 36 33 select RTW88_PCI 34 + select RTW88_8822C 37 35 help 38 36 Select this option will enable support for 8822CE chipset 39 37
+6 -1
drivers/net/wireless/realtek/rtw88/Makefile
··· 19 19 regd.o 20 20 21 21 rtw88-$(CONFIG_RTW88_8822BE) += rtw8822b.o rtw8822b_table.o 22 - rtw88-$(CONFIG_RTW88_8822CE) += rtw8822c.o rtw8822c_table.o 23 22 rtw88-$(CONFIG_RTW88_8723DE) += rtw8723d.o rtw8723d_table.o 23 + 24 + obj-$(CONFIG_RTW88_8822C) += rtw88_8822c.o 25 + rtw88_8822c-objs := rtw8822c.o rtw8822c_table.o 26 + 27 + obj-$(CONFIG_RTW88_8822CE) += rtw88_8822ce.o 28 + rtw88_8822ce-objs := rtw8822ce.o 24 29 25 30 obj-$(CONFIG_RTW88_PCI) += rtwpci.o 26 31 rtwpci-objs := pci.o
-1
drivers/net/wireless/realtek/rtw88/main.h
··· 41 41 extern unsigned int rtw_debug_mask; 42 42 extern const struct ieee80211_ops rtw_ops; 43 43 extern struct rtw_chip_info rtw8822b_hw_spec; 44 - extern struct rtw_chip_info rtw8822c_hw_spec; 45 44 extern struct rtw_chip_info rtw8723d_hw_spec; 46 45 47 46 #define RTW_MAX_CHANNEL_NUM_2G 14
-3
drivers/net/wireless/realtek/rtw88/pci.c
··· 1597 1597 #ifdef CONFIG_RTW88_8822BE 1598 1598 { RTK_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xB822, rtw8822b_hw_spec) }, 1599 1599 #endif 1600 - #ifdef CONFIG_RTW88_8822CE 1601 - { RTK_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xC822, rtw8822c_hw_spec) }, 1602 - #endif 1603 1600 #ifdef CONFIG_RTW88_8723DE 1604 1601 { RTK_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xD723, rtw8723d_hw_spec) }, 1605 1602 #endif
+5
drivers/net/wireless/realtek/rtw88/rtw8822c.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" ··· 4378 4377 4379 4378 MODULE_FIRMWARE("rtw88/rtw8822c_fw.bin"); 4380 4379 MODULE_FIRMWARE("rtw88/rtw8822c_wow_fw.bin"); 4380 + 4381 + MODULE_AUTHOR("Realtek Corporation"); 4382 + MODULE_DESCRIPTION("Realtek 802.11ac wireless 8822c driver"); 4383 + MODULE_LICENSE("Dual BSD/GPL");
+30
drivers/net/wireless/realtek/rtw88/rtw8822ce.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 "rtw8822ce.h" 8 + 9 + static const struct pci_device_id rtw_8822ce_id_table[] = { 10 + { 11 + PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0xC822), 12 + .driver_data = (kernel_ulong_t)&rtw8822c_hw_spec 13 + }, 14 + {} 15 + }; 16 + MODULE_DEVICE_TABLE(pci, rtw_8822ce_id_table); 17 + 18 + static struct pci_driver rtw_8822ce_driver = { 19 + .name = "rtw_8822ce", 20 + .id_table = rtw_8822ce_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_8822ce_driver); 27 + 28 + MODULE_AUTHOR("Realtek Corporation"); 29 + MODULE_DESCRIPTION("Realtek 802.11ac wireless 8822ce driver"); 30 + MODULE_LICENSE("Dual BSD/GPL");
+14
drivers/net/wireless/realtek/rtw88/rtw8822ce.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 + /* Copyright(c) 2018-2019 Realtek Corporation 3 + */ 4 + 5 + #ifndef __RTW_8822CE_H_ 6 + #define __RTW_8822CE_H_ 7 + 8 + extern const struct dev_pm_ops rtw_pm_ops; 9 + extern struct rtw_chip_info rtw8822c_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