diff mbox series

[v2,5/5] rtw88: 8821c: Add 8821CE to Kconfig and Makefile

Message ID 20200603094218.19942-6-yhchuang@realtek.com (mailing list archive)
State Accepted
Commit f745eb9ca5bf823bc5c0f82a434cefb41c57844e
Delegated to: Kalle Valo
Headers show
Series rtw88: 8821c: the rest patches to support 8821c | expand

Commit Message

Tony Chuang June 3, 2020, 9:42 a.m. UTC
From: Tzu-En Huang <tehuang@realtek.com>

Since 8821C code is ready, we can build it.

Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/Kconfig  | 14 ++++++++++++++
 drivers/net/wireless/realtek/rtw88/Makefile |  6 ++++++
 2 files changed, 20 insertions(+)

Comments

Larry Finger June 8, 2020, 7:01 p.m. UTC | #1
On 6/3/20 4:42 AM, yhchuang@realtek.com wrote:
> From: Tzu-En Huang <tehuang@realtek.com>
> 
> Since 8821C code is ready, we can build it.
> 
> Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>

I added this code to the rtw88 GitHub repository that I maintain. I do not have 
an 8821CE card and have no way to test it; however, there is at least one user.

That user has built the driver and gets the firmware loaded, but runs into the 
following:

[   12.378158] rtw_8821ce 0000:02:00.0: Firmware version 24.5.0, H2C version 12
[   12.404834] rtw_8821ce 0000:02:00.0: rfe 2 isn't supported
[   12.404937] rtw_8821ce 0000:02:00.0: failed to setup chip efuse info
[   12.404939] rtw_8821ce 0000:02:00.0: failed to setup chip information

Any help would be appreciated.

Thanks,

Larry
Tony Chuang June 16, 2020, 11:07 a.m. UTC | #2
> On 6/3/20 4:42 AM, yhchuang@realtek.com wrote:
> > From: Tzu-En Huang <tehuang@realtek.com>
> >
> > Since 8821C code is ready, we can build it.
> >
> > Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
> > Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
> 
> I added this code to the rtw88 GitHub repository that I maintain. I do not have
> an 8821CE card and have no way to test it; however, there is at least one user.
> 
> That user has built the driver and gets the firmware loaded, but runs into the
> following:
> 
> [   12.378158] rtw_8821ce 0000:02:00.0: Firmware version 24.5.0, H2C
> version 12
> [   12.404834] rtw_8821ce 0000:02:00.0: rfe 2 isn't supported
> [   12.404937] rtw_8821ce 0000:02:00.0: failed to setup chip efuse info
> [   12.404939] rtw_8821ce 0000:02:00.0: failed to setup chip information
> 

I need to check the devices with RFE type 2. I am not sure if they are supported.
But you can try to add RFE 2 in rtw8821c.c, that can probably work.

Yen-Hsuan
Kai-Heng Feng July 2, 2020, 5:17 a.m. UTC | #3
> On Jun 16, 2020, at 19:07, Tony Chuang <yhchuang@realtek.com> wrote:
> 
>> On 6/3/20 4:42 AM, yhchuang@realtek.com wrote:
>>> From: Tzu-En Huang <tehuang@realtek.com>
>>> 
>>> Since 8821C code is ready, we can build it.
>>> 
>>> Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
>>> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
>> 
>> I added this code to the rtw88 GitHub repository that I maintain. I do not have
>> an 8821CE card and have no way to test it; however, there is at least one user.
>> 
>> That user has built the driver and gets the firmware loaded, but runs into the
>> following:
>> 
>> [   12.378158] rtw_8821ce 0000:02:00.0: Firmware version 24.5.0, H2C
>> version 12
>> [   12.404834] rtw_8821ce 0000:02:00.0: rfe 2 isn't supported
>> [   12.404937] rtw_8821ce 0000:02:00.0: failed to setup chip efuse info
>> [   12.404939] rtw_8821ce 0000:02:00.0: failed to setup chip information
>> 
> 
> I need to check the devices with RFE type 2. I am not sure if they are supported.
> But you can try to add RFE 2 in rtw8821c.c, that can probably work.

I added RFE2 to the rfe_defs table:

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
index c41c61ee2fb6..73f3b9f1ae31 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -1219,6 +1219,7 @@ static const struct rtw_intf_phy_para_table phy_para_table_8821c = {
 
 static const struct rtw_rfe_def rtw8821c_rfe_defs[] = {
        [0] = RTW_DEF_RFE(8821c, 0, 0),
+       [2] = RTW_DEF_RFE(8821c, 0, 0),
 };
 
 static struct rtw_hw_reg rtw8821c_dig[] = {

However, the driver triggers a NULL pointer dereference, because there are many rfe ops are missing for 8821c.

Kai-Heng

> 
> Yen-Hsuan
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/Kconfig b/drivers/net/wireless/realtek/rtw88/Kconfig
index ca894c4f96ac..e3d7cb6c1290 100644
--- a/drivers/net/wireless/realtek/rtw88/Kconfig
+++ b/drivers/net/wireless/realtek/rtw88/Kconfig
@@ -25,6 +25,9 @@  config RTW88_8822C
 config RTW88_8723D
 	tristate
 
+config RTW88_8821C
+	tristate
+
 config RTW88_8822BE
 	tristate "Realtek 8822BE PCI wireless network adapter"
 	depends on PCI
@@ -58,6 +61,17 @@  config RTW88_8723DE
 
 	  802.11n PCIe wireless network adapter
 
+config RTW88_8821CE
+	tristate "Realtek 8821CE PCI wireless network adapter"
+	depends on PCI
+	select RTW88_CORE
+	select RTW88_PCI
+	select RTW88_8821C
+	help
+	  Select this option will enable support for 8821CE chipset
+
+	  802.11ac PCIe wireless network adapter
+
 config RTW88_DEBUG
 	bool "Realtek rtw88 debug support"
 	depends on RTW88_CORE
diff --git a/drivers/net/wireless/realtek/rtw88/Makefile b/drivers/net/wireless/realtek/rtw88/Makefile
index f31e78a6f146..c0e4b111c8b4 100644
--- a/drivers/net/wireless/realtek/rtw88/Makefile
+++ b/drivers/net/wireless/realtek/rtw88/Makefile
@@ -37,5 +37,11 @@  rtw88_8723d-objs		:= rtw8723d.o rtw8723d_table.o
 obj-$(CONFIG_RTW88_8723DE)	+= rtw88_8723de.o
 rtw88_8723de-objs		:= rtw8723de.o
 
+obj-$(CONFIG_RTW88_8821C)	+= rtw88_8821c.o
+rtw88_8821c-objs		:= rtw8821c.o rtw8821c_table.o
+
+obj-$(CONFIG_RTW88_8821CE)	+= rtw88_8821ce.o
+rtw88_8821ce-objs		:= rtw8821ce.o
+
 obj-$(CONFIG_RTW88_PCI)		+= rtw88_pci.o
 rtw88_pci-objs			:= pci.o