mbox series

[v6,00/24] rtw89: add Realtek 802.11ax driver

Message ID 20210820043538.12424-1-pkshih@realtek.com
Headers show
Series rtw89: add Realtek 802.11ax driver | expand

Message

Ping-Ke Shih Aug. 20, 2021, 4:35 a.m. UTC
This driver named rtw89, which is the next generation of rtw88, supports
Realtek 8852AE 802.11ax 2x2 chip whose new features are OFDMA, DBCC,
Spatial reuse, TWT and BSS coloring; now some of them aren't implemented
though.

The chip architecture is entirely different from the chips supported by
rtw88 like RTL8822CE 802.11ac chip. First of all, register address ranges
are totally redefined, so it's impossible to reuse register definition. To
communicate with firmware, new H2C/C2H format is proposed. In order to have
better utilization, TX DMA flow is changed to two stages DMA. To provide
rich RX status information, additional RX PPDU packets are added.

Since there are so many differences mentioned above, we decide to propose
a new driver. It has many authors, they are listed in alphabetic order:

Chin-Yen Lee <timlee@realtek.com>
Ping-Ke Shih <pkshih@realtek.com>
Po Hao Huang <phhuang@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Vincent Fann <vincent_fann@realtek.com>
Yan-Hsuan Chuang <tony0620emma@gmail.com>
Zong-Zhe Yang <kevin_yang@realtek.com>

v6:
  - improve BT coexistence performance
  - improve power save mode
  - improve OFDMA performance
  - remove some unused code
  - fix can't obtain IPv6 address
  - support device ID 10ec:a85a
  - refine PCI interrupt flow
  - firmware: rtw89: 8852a: update fw to v0.13.28.0
    https://github.com/pkshih/linux-firmware.git 
    pick the commit 344db6dca0610341599cd3e5f8b51fcb6ae06fb5

v5:
  - add OFDMA feature
  - improve BT coexistence performance
  - improve power save mode
  - support SAR
  - fine tune performance
  - firmware: rtw89: 8852a: update fw to v0.13.24.0
    https://github.com/pkshih/linux-firmware.git 
    pick the commit a5b79c4790da3eb3690e23554225ef8db464f2c6
v4:
  - add basic BT coexistence features
  - add power save mode, so an new patch (two files) is added
  - fine tune performance
  - add debugfs for debugging coex, bb, ...
v3:
  - fix "networking block comments" reported by checkpatch
  - Add MODULE_DEVICE_TABLE() generated by Thomas Backlund <tmb@mageia.org>
  - Add missed BB settings
  - error handle of RX BD and DESC length
  - reduce debug level of C2H ACKs
  - fix rekey failure due to wrong operator
v2:
  - fix compiler warnings made by W=1
    Reported-by: kernel test robot <lkp@intel.com>
  - sort header file alphabetically
  - fix "networking block comments" reported by checkpatch

Ping-Ke Shih (24):
  rtw89: add CAM files
  rtw89: add BT coexistence files
  rtw89: add core and trx files
  rtw89: add debug files
  rtw89: add efuse files
  rtw89: add files to download and communicate with firmware
  rtw89: add MAC files
  rtw89: implement mac80211 ops
  rtw89: add pci files
  rtw89: add phy files
  rtw89: define register names
  rtw89: add regulatory support
  rtw89: 8852a: add 8852a specific files
  rtw89: 8852a: add 8852a RFK files
  rtw89: 8852a: add 8852a RFK tables
  rtw89: 8852a: add 8852a tables (1 of 5)
  rtw89: 8852a: add 8852a tables (2 of 5)
  rtw89: 8852a: add 8852a tables (3 of 5)
  rtw89: 8852a: add 8852a tables (4 of 5)
  rtw89: 8852a: add 8852a tables (5 of 5)
  rtw89: add ser to recover error reported by firmware
  rtw89: add PS files
  rtw89: add SAR files
  rtw89: add Kconfig and Makefile

 drivers/net/wireless/realtek/Kconfig          |     1 +
 drivers/net/wireless/realtek/Makefile         |     1 +
 drivers/net/wireless/realtek/rtw89/Kconfig    |    50 +
 drivers/net/wireless/realtek/rtw89/Makefile   |    25 +
 drivers/net/wireless/realtek/rtw89/cam.c      |   700 +
 drivers/net/wireless/realtek/rtw89/cam.h      |   165 +
 drivers/net/wireless/realtek/rtw89/coex.c     |  5743 ++
 drivers/net/wireless/realtek/rtw89/coex.h     |   179 +
 drivers/net/wireless/realtek/rtw89/core.c     |  2428 +
 drivers/net/wireless/realtek/rtw89/core.h     |  3360 ++
 drivers/net/wireless/realtek/rtw89/debug.c    |  2404 +
 drivers/net/wireless/realtek/rtw89/debug.h    |    77 +
 drivers/net/wireless/realtek/rtw89/efuse.c    |   188 +
 drivers/net/wireless/realtek/rtw89/efuse.h    |    13 +
 drivers/net/wireless/realtek/rtw89/fw.c       |  1600 +
 drivers/net/wireless/realtek/rtw89/fw.h       |  1394 +
 drivers/net/wireless/realtek/rtw89/mac.c      |  3833 ++
 drivers/net/wireless/realtek/rtw89/mac.h      |   860 +
 drivers/net/wireless/realtek/rtw89/mac80211.c |   673 +
 drivers/net/wireless/realtek/rtw89/pci.c      |  3060 +
 drivers/net/wireless/realtek/rtw89/pci.h      |   616 +
 drivers/net/wireless/realtek/rtw89/phy.c      |  2748 +
 drivers/net/wireless/realtek/rtw89/phy.h      |   305 +
 drivers/net/wireless/realtek/rtw89/ps.c       |   154 +
 drivers/net/wireless/realtek/rtw89/ps.h       |    16 +
 drivers/net/wireless/realtek/rtw89/reg.h      |  2135 +
 drivers/net/wireless/realtek/rtw89/regd.c     |   353 +
 drivers/net/wireless/realtek/rtw89/rtw8852a.c |  2030 +
 drivers/net/wireless/realtek/rtw89/rtw8852a.h |   109 +
 .../net/wireless/realtek/rtw89/rtw8852a_rfk.c |  3801 ++
 .../net/wireless/realtek/rtw89/rtw8852a_rfk.h |    22 +
 .../realtek/rtw89/rtw8852a_rfk_table.c        |  1596 +
 .../realtek/rtw89/rtw8852a_rfk_table.h        |   132 +
 .../wireless/realtek/rtw89/rtw8852a_table.c   | 48725 ++++++++++++++++
 .../wireless/realtek/rtw89/rtw8852a_table.h   |    28 +
 drivers/net/wireless/realtek/rtw89/sar.c      |   190 +
 drivers/net/wireless/realtek/rtw89/sar.h      |    26 +
 drivers/net/wireless/realtek/rtw89/ser.c      |   491 +
 drivers/net/wireless/realtek/rtw89/ser.h      |    15 +
 drivers/net/wireless/realtek/rtw89/txrx.h     |   393 +
 drivers/net/wireless/realtek/rtw89/util.h     |    17 +
 41 files changed, 90656 insertions(+)
 create mode 100644 drivers/net/wireless/realtek/rtw89/Kconfig
 create mode 100644 drivers/net/wireless/realtek/rtw89/Makefile
 create mode 100644 drivers/net/wireless/realtek/rtw89/cam.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/cam.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/coex.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/coex.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/core.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/core.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/debug.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/debug.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/efuse.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/efuse.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/fw.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/fw.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/mac.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/mac.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/mac80211.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/pci.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/pci.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/phy.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/phy.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/ps.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/ps.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/reg.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/regd.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852a.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852a.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852a_rfk_table.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852a_rfk_table.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852a_table.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852a_table.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/sar.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/sar.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/ser.c
 create mode 100644 drivers/net/wireless/realtek/rtw89/ser.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/txrx.h
 create mode 100644 drivers/net/wireless/realtek/rtw89/util.h

Comments

Kalle Valo Oct. 1, 2021, 4:34 p.m. UTC | #1
Ping-Ke Shih <pkshih@realtek.com> writes:

> This driver named rtw89, which is the next generation of rtw88, supports

> Realtek 8852AE 802.11ax 2x2 chip whose new features are OFDMA, DBCC,

> Spatial reuse, TWT and BSS coloring; now some of them aren't implemented

> though.

>

> The chip architecture is entirely different from the chips supported by

> rtw88 like RTL8822CE 802.11ac chip. First of all, register address ranges

> are totally redefined, so it's impossible to reuse register definition. To

> communicate with firmware, new H2C/C2H format is proposed. In order to have

> better utilization, TX DMA flow is changed to two stages DMA. To provide

> rich RX status information, additional RX PPDU packets are added.

>

> Since there are so many differences mentioned above, we decide to propose

> a new driver. It has many authors, they are listed in alphabetic order:


I did a review now and this looks pretty good to me. Kconfig has a
different license and lots of static/extern variables which are not
const, otherwise I only saw smaller issues. But I do have to admit that
after mac.h (in alphabetical order) my review was more on the sloppy
side, this is a large driver.

The community has been testing this driver already, right?

I pushed the driver to the pending branch for build testing:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=c9dfa866a9f4004fcbde9fc3ad8772ad417c6ad9

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Larry Finger Oct. 1, 2021, 4:42 p.m. UTC | #2
On 10/1/21 11:34, Kalle Valo wrote:
> Ping-Ke Shih <pkshih@realtek.com> writes:

> 

>> This driver named rtw89, which is the next generation of rtw88, supports

>> Realtek 8852AE 802.11ax 2x2 chip whose new features are OFDMA, DBCC,

>> Spatial reuse, TWT and BSS coloring; now some of them aren't implemented

>> though.

>>

>> The chip architecture is entirely different from the chips supported by

>> rtw88 like RTL8822CE 802.11ac chip. First of all, register address ranges

>> are totally redefined, so it's impossible to reuse register definition. To

>> communicate with firmware, new H2C/C2H format is proposed. In order to have

>> better utilization, TX DMA flow is changed to two stages DMA. To provide

>> rich RX status information, additional RX PPDU packets are added.

>>

>> Since there are so many differences mentioned above, we decide to propose

>> a new driver. It has many authors, they are listed in alphabetic order:

> 

> I did a review now and this looks pretty good to me. Kconfig has a

> different license and lots of static/extern variables which are not

> const, otherwise I only saw smaller issues. But I do have to admit that

> after mac.h (in alphabetical order) my review was more on the sloppy

> side, this is a large driver.

> 

> The community has been testing this driver already, right?


Kalle,

As soon as Ping-Ke submitted this driver, I created a stand-alone version at 
GitHub so that people with new laptops containing this chip would have a source 
for the driver. There have been minor hiccups that we have fixed along the way. 
I am also testing it on my system.

Larry
Kalle Valo Oct. 1, 2021, 4:46 p.m. UTC | #3
Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 10/1/21 11:34, Kalle Valo wrote:

>> Ping-Ke Shih <pkshih@realtek.com> writes:

>>

>>> This driver named rtw89, which is the next generation of rtw88, supports

>>> Realtek 8852AE 802.11ax 2x2 chip whose new features are OFDMA, DBCC,

>>> Spatial reuse, TWT and BSS coloring; now some of them aren't implemented

>>> though.

>>>

>>> The chip architecture is entirely different from the chips supported by

>>> rtw88 like RTL8822CE 802.11ac chip. First of all, register address ranges

>>> are totally redefined, so it's impossible to reuse register definition. To

>>> communicate with firmware, new H2C/C2H format is proposed. In order to have

>>> better utilization, TX DMA flow is changed to two stages DMA. To provide

>>> rich RX status information, additional RX PPDU packets are added.

>>>

>>> Since there are so many differences mentioned above, we decide to propose

>>> a new driver. It has many authors, they are listed in alphabetic order:

>>

>> I did a review now and this looks pretty good to me. Kconfig has a

>> different license and lots of static/extern variables which are not

>> const, otherwise I only saw smaller issues. But I do have to admit that

>> after mac.h (in alphabetical order) my review was more on the sloppy

>> side, this is a large driver.

>>

>> The community has been testing this driver already, right?

>

> Kalle,

>

> As soon as Ping-Ke submitted this driver, I created a stand-alone

> version at GitHub so that people with new laptops containing this chip

> would have a source for the driver. There have been minor hiccups that

> we have fixed along the way. I am also testing it on my system.


Nice, so I can assume there are quite a few users for this driver
already?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Larry Finger Oct. 1, 2021, 5:18 p.m. UTC | #4
On 10/1/21 11:46, Kalle Valo wrote:
> 

> Nice, so I can assume there are quite a few users for this driver

> already?

> 


Yes. I do not know how many times the repo has been cloned or how many people 
are using it, but GitHub reports 31 forks of the driver, and 252 star ratings. 
The numbers are roughly comparable with those for my rtw88 repo.

Larry
Ping-Ke Shih Oct. 4, 2021, 6:46 a.m. UTC | #5
> -----Original Message-----

> From: kvalo=codeaurora.org@mg.codeaurora.org <kvalo=codeaurora.org@mg.codeaurora.org> On

> Behalf Of Kalle Valo

> Sent: Saturday, October 2, 2021 12:34 AM

> To: Pkshih <pkshih@realtek.com>

> Cc: linux-wireless@vger.kernel.org

> Subject: Re: [PATCH v6 00/24] rtw89: add Realtek 802.11ax driver

> 

> Ping-Ke Shih <pkshih@realtek.com> writes:

> 

> > This driver named rtw89, which is the next generation of rtw88, supports

> > Realtek 8852AE 802.11ax 2x2 chip whose new features are OFDMA, DBCC,

> > Spatial reuse, TWT and BSS coloring; now some of them aren't implemented

> > though.

> >

> > The chip architecture is entirely different from the chips supported by

> > rtw88 like RTL8822CE 802.11ac chip. First of all, register address ranges

> > are totally redefined, so it's impossible to reuse register definition. To

> > communicate with firmware, new H2C/C2H format is proposed. In order to have

> > better utilization, TX DMA flow is changed to two stages DMA. To provide

> > rich RX status information, additional RX PPDU packets are added.

> >

> > Since there are so many differences mentioned above, we decide to propose

> > a new driver. It has many authors, they are listed in alphabetic order:

> 

> I did a review now and this looks pretty good to me. Kconfig has a

> different license and lots of static/extern variables which are not

> const, otherwise I only saw smaller issues. But I do have to admit that

> after mac.h (in alphabetical order) my review was more on the sloppy

> side, this is a large driver.


Thank you.
I will revise the driver according to your comments.

> 

> The community has been testing this driver already, right?


As Larry mentioned, end users use this driver. Since bugs found in v6,
we have fixed them and driver is under QA. I plan to have that fixes in v7
released this week.

This version will also include fixes of your comments. 
Does it work to you?

> 

> I pushed the driver to the pending branch for build testing:

> 

> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=

> pending&id=c9dfa866a9f4004fcbde9fc3ad8772ad417c6ad9

> 


--
Ping-Ke
Kalle Valo Oct. 5, 2021, 5:46 a.m. UTC | #6
Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 10/1/21 11:46, Kalle Valo wrote:

>>

>> Nice, so I can assume there are quite a few users for this driver

>> already?

>>

>

> Yes. I do not know how many times the repo has been cloned or how many

> people are using it, but GitHub reports 31 forks of the driver, and

> 252 star ratings. The numbers are roughly comparable with those for my

> rtw88 repo.


Very good, plenty of testing then and most likely we are talking about
users in thousands. Too bad github doesn't provide statistics about
clones, that would be very interesting to know as well.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Kalle Valo Oct. 5, 2021, 5:52 a.m. UTC | #7
Pkshih <pkshih@realtek.com> writes:

>> The community has been testing this driver already, right?

>

> As Larry mentioned, end users use this driver. Since bugs found in v6,

> we have fixed them and driver is under QA. I plan to have that fixes in v7

> released this week.

>

> This version will also include fixes of your comments. 

> Does it work to you?


Sounds good to me. I hope the changes in v7 will be small in size,
bigger changes (especially new features) is better to do after the
driver is applied to wireless-drivers-next.

This reminds me, if anyone has any objections about taking this to
wireless-drivers-next speak up now. Otherwise I assume everyone are
happy with the driver.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Brian Norris Oct. 6, 2021, 12:10 a.m. UTC | #8
On Mon, Oct 4, 2021 at 10:52 PM Kalle Valo <kvalo@codeaurora.org> wrote:
> This reminds me, if anyone has any objections about taking this to

> wireless-drivers-next speak up now. Otherwise I assume everyone are

> happy with the driver.


I realize I never provided any formal tags to this series. I'm not
sure I can count a full Reviewed-by, but we've been playing with it
here for some time, and while not perfect, it's certainly a start:

Tested-by: Brian Norris <briannorris@chromium.org>
Ping-Ke Shih Oct. 8, 2021, 4:11 a.m. UTC | #9
> -----Original Message-----

> From: kvalo=codeaurora.org@mg.codeaurora.org <kvalo=codeaurora.org@mg.codeaurora.org> On

> Behalf Of Kalle Valo

> Sent: Tuesday, October 5, 2021 1:52 PM

> To: Pkshih <pkshih@realtek.com>

> Cc: linux-wireless@vger.kernel.org

> Subject: Re: [PATCH v6 00/24] rtw89: add Realtek 802.11ax driver

> 

> Pkshih <pkshih@realtek.com> writes:

> 

> >> The community has been testing this driver already, right?

> >

> > As Larry mentioned, end users use this driver. Since bugs found in v6,

> > we have fixed them and driver is under QA. I plan to have that fixes in v7

> > released this week.

> >

> > This version will also include fixes of your comments.

> > Does it work to you?

> 

> Sounds good to me. I hope the changes in v7 will be small in size,

> bigger changes (especially new features) is better to do after the

> driver is applied to wireless-drivers-next.

> 


I have fixed this driver according to all of your comments, so I
don't reply the comments one by one. If this doesn't work to you,
please let me know.

--
Ping-Ke
Ping-Ke Shih Oct. 8, 2021, 4:14 a.m. UTC | #10
> -----Original Message-----

> From: Brian Norris <briannorris@chromium.org>

> Sent: Wednesday, October 6, 2021 8:10 AM

> To: Kalle Valo <kvalo@codeaurora.org>

> Cc: Pkshih <pkshih@realtek.com>; linux-wireless@vger.kernel.org

> Subject: Re: [PATCH v6 00/24] rtw89: add Realtek 802.11ax driver

> 

> On Mon, Oct 4, 2021 at 10:52 PM Kalle Valo <kvalo@codeaurora.org> wrote:

> > This reminds me, if anyone has any objections about taking this to

> > wireless-drivers-next speak up now. Otherwise I assume everyone are

> > happy with the driver.

> 

> I realize I never provided any formal tags to this series. I'm not

> sure I can count a full Reviewed-by, but we've been playing with it

> here for some time, and while not perfect, it's certainly a start:

> 

> Tested-by: Brian Norris <briannorris@chromium.org>


Thank you, Brian,
I add your Tested-by to cover letter of v7. I think this would be
convenient to Kalle.

--
Ping-Ke
Kalle Valo Oct. 9, 2021, 8:28 a.m. UTC | #11
Pkshih <pkshih@realtek.com> writes:

>> -----Original Message-----

>> From: kvalo=codeaurora.org@mg.codeaurora.org <kvalo=codeaurora.org@mg.codeaurora.org> On

>> Behalf Of Kalle Valo

>> Sent: Tuesday, October 5, 2021 1:52 PM

>> To: Pkshih <pkshih@realtek.com>

>> Cc: linux-wireless@vger.kernel.org

>> Subject: Re: [PATCH v6 00/24] rtw89: add Realtek 802.11ax driver

>> 

>> Pkshih <pkshih@realtek.com> writes:

>> 

>> >> The community has been testing this driver already, right?

>> >

>> > As Larry mentioned, end users use this driver. Since bugs found in v6,

>> > we have fixed them and driver is under QA. I plan to have that fixes in v7

>> > released this week.

>> >

>> > This version will also include fixes of your comments.

>> > Does it work to you?

>> 

>> Sounds good to me. I hope the changes in v7 will be small in size,

>> bigger changes (especially new features) is better to do after the

>> driver is applied to wireless-drivers-next.

>> 

>

> I have fixed this driver according to all of your comments, so I

> don't reply the comments one by one. If this doesn't work to you,

> please let me know.


That's good, no need to reply to every comment. But please do reply to
the comments you did not agree on.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches