rtw89: add Realtek 802.11ax driver
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>
Tested-by: Aaron Ma <aaron.ma@canonical.com>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211008035627.19463-1-pkshih@realtek.com
2021-10-11 14:47:27 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
|
|
|
/* Copyright(c) 2019-2020 Realtek Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __RTW89_8852A_H__
|
|
|
|
#define __RTW89_8852A_H__
|
|
|
|
|
|
|
|
#include "core.h"
|
|
|
|
|
|
|
|
#define RF_PATH_NUM_8852A 2
|
|
|
|
|
|
|
|
enum rtw8852a_pmac_mode {
|
|
|
|
NONE_TEST,
|
|
|
|
PKTS_TX,
|
|
|
|
PKTS_RX,
|
|
|
|
CONT_TX
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rtw8852au_efuse {
|
|
|
|
u8 rsvd[0x38];
|
|
|
|
u8 mac_addr[ETH_ALEN];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rtw8852ae_efuse {
|
|
|
|
u8 mac_addr[ETH_ALEN];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rtw8852a_tssi_offset {
|
|
|
|
u8 cck_tssi[TSSI_CCK_CH_GROUP_NUM];
|
|
|
|
u8 bw40_tssi[TSSI_MCS_2G_CH_GROUP_NUM];
|
|
|
|
u8 rsvd[7];
|
|
|
|
u8 bw40_1s_tssi_5g[TSSI_MCS_5G_CH_GROUP_NUM];
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct rtw8852a_efuse {
|
|
|
|
u8 rsvd[0x210];
|
|
|
|
struct rtw8852a_tssi_offset path_a_tssi;
|
|
|
|
u8 rsvd1[10];
|
|
|
|
struct rtw8852a_tssi_offset path_b_tssi;
|
|
|
|
u8 rsvd2[94];
|
|
|
|
u8 channel_plan;
|
|
|
|
u8 xtal_k;
|
|
|
|
u8 rsvd3;
|
|
|
|
u8 iqk_lck;
|
|
|
|
u8 rsvd4[5];
|
|
|
|
u8 reg_setting:2;
|
|
|
|
u8 tx_diversity:1;
|
|
|
|
u8 rx_diversity:2;
|
|
|
|
u8 ac_mode:1;
|
|
|
|
u8 module_type:2;
|
|
|
|
u8 rsvd5;
|
|
|
|
u8 shared_ant:1;
|
|
|
|
u8 coex_type:3;
|
|
|
|
u8 ant_iso:1;
|
|
|
|
u8 radio_on_off:1;
|
|
|
|
u8 rsvd6:2;
|
|
|
|
u8 eeprom_version;
|
|
|
|
u8 customer_id;
|
|
|
|
u8 tx_bb_swing_2g;
|
|
|
|
u8 tx_bb_swing_5g;
|
|
|
|
u8 tx_cali_pwr_trk_mode;
|
|
|
|
u8 trx_path_selection;
|
|
|
|
u8 rfe_type;
|
|
|
|
u8 country_code[2];
|
|
|
|
u8 rsvd7[3];
|
|
|
|
u8 path_a_therm;
|
|
|
|
u8 path_b_therm;
|
|
|
|
u8 rsvd8[46];
|
|
|
|
u8 path_a_cck_pwr_idx[6];
|
|
|
|
u8 path_a_bw40_1tx_pwr_idx[5];
|
|
|
|
u8 path_a_ofdm_1tx_pwr_idx_diff:4;
|
|
|
|
u8 path_a_bw20_1tx_pwr_idx_diff:4;
|
|
|
|
u8 path_a_bw20_2tx_pwr_idx_diff:4;
|
|
|
|
u8 path_a_bw40_2tx_pwr_idx_diff:4;
|
|
|
|
u8 path_a_cck_2tx_pwr_idx_diff:4;
|
|
|
|
u8 path_a_ofdm_2tx_pwr_idx_diff:4;
|
|
|
|
u8 rsvd9[0xf2];
|
|
|
|
union {
|
|
|
|
struct rtw8852au_efuse u;
|
|
|
|
struct rtw8852ae_efuse e;
|
|
|
|
};
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct rtw8852a_bb_pmac_info {
|
|
|
|
u8 en_pmac_tx:1;
|
|
|
|
u8 is_cck:1;
|
|
|
|
u8 mode:3;
|
|
|
|
u8 rsvd:3;
|
|
|
|
u16 tx_cnt;
|
|
|
|
u16 period;
|
|
|
|
u16 tx_time;
|
|
|
|
u8 duty_cycle;
|
|
|
|
};
|
|
|
|
|
rtw89: extract modules by chipset
We are planning to support more chipsets, e.g. 8852C. Before that, we
consider architecutre to handle multiple kinds of chipsets. Obviosuly,
based on original design, rtw89_core module will have large size even
if there is only one chipset under running. It is because all chipset
related things are put in rtw89_core now. To reduce such overhead, we
extract modules of rtw89 and adjust dependencies between modules.
The following assumes that 8852AE, 8852AU, and 8852CE are all supported,
we describe the difference before and after extraction.
[Before extraction]
-------------
|------------------------------------ | rtw89_usb |
V -------------
--------------------------------------- -------------
| rtw89_core (including 8852A, 8852C) | <--- | rtw89_pci |
--------------------------------------- -------------
The data of 8852A and 8852C are built in rtw89_core.
And rtw89_pci is the entry of 8852AE and 8852CE.
And rtw89_usb is the entry of 8852AU.
[After extraction]
------------- ----------------
|----------- | rtw89_usb | <-------- | rtw89_8852au |
| ------------- ----------------
V --------------- |
-------------- | | <---------------
| rtw89_core | <--- | rtw89_8852a |
-------------- | | <---------------
^ ^ --------------- |
| | ------------- ----------------
| | | | <-------- | rtw89_8852ae |
| |----------- | rtw89_pci | ----------------
| | | <-----------------
| ------------- |
| --------------- ----------------
|--------------- | rtw89_8852c | <------ | rtw89_8852ce |
--------------- ----------------
The data of 8852A/8852C is extracted to rtw89_8852a/rtw89_8852c.
And rtw89_pci/rtw89_usb handles only common flow of pci/usb bus.
Finally, 8852AE, 8852AU, and 8852CE have individual entry modules,
i.e. rtw89_8852ae, rtw89_8852au, and rtw89_8852ce correspondingly.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211221025828.25092-1-pkshih@realtek.com
2021-12-21 10:58:28 +08:00
|
|
|
extern const struct rtw89_chip_info rtw8852a_chip_info;
|
|
|
|
|
rtw89: add Realtek 802.11ax driver
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>
Tested-by: Aaron Ma <aaron.ma@canonical.com>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211008035627.19463-1-pkshih@realtek.com
2021-10-11 14:47:27 +03:00
|
|
|
void rtw8852a_bb_set_plcp_tx(struct rtw89_dev *rtwdev);
|
|
|
|
void rtw8852a_bb_set_pmac_tx(struct rtw89_dev *rtwdev,
|
|
|
|
struct rtw8852a_bb_pmac_info *tx_info,
|
2024-08-19 17:17:19 +08:00
|
|
|
enum rtw89_phy_idx idx, const struct rtw89_chan *chan);
|
rtw89: add Realtek 802.11ax driver
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>
Tested-by: Aaron Ma <aaron.ma@canonical.com>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211008035627.19463-1-pkshih@realtek.com
2021-10-11 14:47:27 +03:00
|
|
|
void rtw8852a_bb_set_pmac_pkt_tx(struct rtw89_dev *rtwdev, u8 enable,
|
|
|
|
u16 tx_cnt, u16 period, u16 tx_time,
|
2024-08-19 17:17:19 +08:00
|
|
|
enum rtw89_phy_idx idx, const struct rtw89_chan *chan);
|
rtw89: add Realtek 802.11ax driver
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>
Tested-by: Aaron Ma <aaron.ma@canonical.com>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211008035627.19463-1-pkshih@realtek.com
2021-10-11 14:47:27 +03:00
|
|
|
void rtw8852a_bb_set_power(struct rtw89_dev *rtwdev, s16 pwr_dbm,
|
|
|
|
enum rtw89_phy_idx idx);
|
|
|
|
void rtw8852a_bb_cfg_tx_path(struct rtw89_dev *rtwdev, u8 tx_path);
|
|
|
|
void rtw8852a_bb_tx_mode_switch(struct rtw89_dev *rtwdev,
|
|
|
|
enum rtw89_phy_idx idx, u8 mode);
|
|
|
|
|
|
|
|
#endif
|