mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
wifi: rtw88: enable TX reports for the management queue
This is needed for AP mode. Otherwise client sees the network, but can't connect to it. REG_FWHW_TXQ_CTRL+1 is set to WLAN_TXQ_RPT_EN (0x1F) in common mac init function (__rtw8723x_mac_init), but the value was overwritten from mac table later. Tables with register values for phy parameters initialization are copied from vendor driver usually. When table will be regenerated, manual modifications to it may be lost. To avoid regressions in this case new callback mac_postinit is introduced, that is called after parameters from table are set. Tested on rtl8723cs, that reuses rtw8703b driver. Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20250711084740.3396766-1-andrej.skvortzov@gmail.com
This commit is contained in:
parent
d76a1abcf5
commit
5f93676830
|
|
@ -1409,3 +1409,13 @@ int rtw_mac_init(struct rtw_dev *rtwdev)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rtw_mac_postinit(struct rtw_dev *rtwdev)
|
||||
{
|
||||
const struct rtw_chip_info *chip = rtwdev->chip;
|
||||
|
||||
if (!chip->ops->mac_postinit)
|
||||
return 0;
|
||||
|
||||
return chip->ops->mac_postinit(rtwdev);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ void rtw_write_firmware_page(struct rtw_dev *rtwdev, u32 page,
|
|||
const u8 *data, u32 size);
|
||||
int rtw_download_firmware(struct rtw_dev *rtwdev, struct rtw_fw_state *fw);
|
||||
int rtw_mac_init(struct rtw_dev *rtwdev);
|
||||
int rtw_mac_postinit(struct rtw_dev *rtwdev);
|
||||
void rtw_mac_flush_queues(struct rtw_dev *rtwdev, u32 queues, bool drop);
|
||||
int rtw_set_trx_fifo_info(struct rtw_dev *rtwdev);
|
||||
int rtw_ddma_to_fw_fifo(struct rtw_dev *rtwdev, u32 ocp_src, u32 size);
|
||||
|
|
|
|||
|
|
@ -1412,6 +1412,12 @@ int rtw_power_on(struct rtw_dev *rtwdev)
|
|||
|
||||
chip->ops->phy_set_param(rtwdev);
|
||||
|
||||
ret = rtw_mac_postinit(rtwdev);
|
||||
if (ret) {
|
||||
rtw_err(rtwdev, "failed to configure mac in postinit\n");
|
||||
goto err_off;
|
||||
}
|
||||
|
||||
ret = rtw_hci_start(rtwdev);
|
||||
if (ret) {
|
||||
rtw_err(rtwdev, "failed to start hci\n");
|
||||
|
|
|
|||
|
|
@ -858,6 +858,7 @@ struct rtw_chip_ops {
|
|||
int (*power_on)(struct rtw_dev *rtwdev);
|
||||
void (*power_off)(struct rtw_dev *rtwdev);
|
||||
int (*mac_init)(struct rtw_dev *rtwdev);
|
||||
int (*mac_postinit)(struct rtw_dev *rtwdev);
|
||||
int (*dump_fw_crash)(struct rtw_dev *rtwdev);
|
||||
void (*shutdown)(struct rtw_dev *rtwdev);
|
||||
int (*read_efuse)(struct rtw_dev *rtwdev, u8 *map);
|
||||
|
|
|
|||
|
|
@ -1832,6 +1832,7 @@ static const struct rtw_chip_ops rtw8703b_ops = {
|
|||
.power_on = rtw_power_on,
|
||||
.power_off = rtw_power_off,
|
||||
.mac_init = rtw8723x_mac_init,
|
||||
.mac_postinit = rtw8723x_mac_postinit,
|
||||
.dump_fw_crash = NULL,
|
||||
.shutdown = NULL,
|
||||
.read_efuse = rtw8703b_read_efuse,
|
||||
|
|
|
|||
|
|
@ -1397,6 +1397,7 @@ static const struct rtw_chip_ops rtw8723d_ops = {
|
|||
.query_phy_status = query_phy_status,
|
||||
.set_channel = rtw8723d_set_channel,
|
||||
.mac_init = rtw8723x_mac_init,
|
||||
.mac_postinit = rtw8723x_mac_postinit,
|
||||
.shutdown = rtw8723d_shutdown,
|
||||
.read_rf = rtw_phy_read_rf_sipi,
|
||||
.write_rf = rtw_phy_write_rf_reg_sipi,
|
||||
|
|
|
|||
|
|
@ -353,7 +353,6 @@ static int __rtw8723x_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
|
|||
|
||||
static int __rtw8723x_mac_init(struct rtw_dev *rtwdev)
|
||||
{
|
||||
rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 1, WLAN_TXQ_RPT_EN);
|
||||
rtw_write32(rtwdev, REG_TCR, BIT_TCR_CFG);
|
||||
|
||||
rtw_write16(rtwdev, REG_RXFLTMAP0, WLAN_RX_FILTER0);
|
||||
|
|
@ -370,6 +369,13 @@ static int __rtw8723x_mac_init(struct rtw_dev *rtwdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __rtw8723x_mac_postinit(struct rtw_dev *rtwdev)
|
||||
{
|
||||
rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 1, WLAN_TXQ_RPT_EN);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __rtw8723x_cfg_ldo25(struct rtw_dev *rtwdev, bool enable)
|
||||
{
|
||||
u8 ldo_pwr;
|
||||
|
|
@ -760,6 +766,7 @@ const struct rtw8723x_common rtw8723x_common = {
|
|||
.lck = __rtw8723x_lck,
|
||||
.read_efuse = __rtw8723x_read_efuse,
|
||||
.mac_init = __rtw8723x_mac_init,
|
||||
.mac_postinit = __rtw8723x_mac_postinit,
|
||||
.cfg_ldo25 = __rtw8723x_cfg_ldo25,
|
||||
.set_tx_power_index = __rtw8723x_set_tx_power_index,
|
||||
.efuse_grant = __rtw8723x_efuse_grant,
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ struct rtw8723x_common {
|
|||
void (*lck)(struct rtw_dev *rtwdev);
|
||||
int (*read_efuse)(struct rtw_dev *rtwdev, u8 *log_map);
|
||||
int (*mac_init)(struct rtw_dev *rtwdev);
|
||||
int (*mac_postinit)(struct rtw_dev *rtwdev);
|
||||
void (*cfg_ldo25)(struct rtw_dev *rtwdev, bool enable);
|
||||
void (*set_tx_power_index)(struct rtw_dev *rtwdev);
|
||||
void (*efuse_grant)(struct rtw_dev *rtwdev, bool on);
|
||||
|
|
@ -383,6 +384,11 @@ static inline int rtw8723x_mac_init(struct rtw_dev *rtwdev)
|
|||
return rtw8723x_common.mac_init(rtwdev);
|
||||
}
|
||||
|
||||
static inline int rtw8723x_mac_postinit(struct rtw_dev *rtwdev)
|
||||
{
|
||||
return rtw8723x_common.mac_postinit(rtwdev);
|
||||
}
|
||||
|
||||
static inline void rtw8723x_cfg_ldo25(struct rtw_dev *rtwdev, bool enable)
|
||||
{
|
||||
rtw8723x_common.cfg_ldo25(rtwdev, enable);
|
||||
|
|
|
|||
|
|
@ -919,6 +919,7 @@ static const struct rtw_chip_ops rtw8812a_ops = {
|
|||
.query_phy_status = rtw8812a_query_phy_status,
|
||||
.set_channel = rtw88xxa_set_channel,
|
||||
.mac_init = NULL,
|
||||
.mac_postinit = NULL,
|
||||
.read_rf = rtw88xxa_phy_read_rf,
|
||||
.write_rf = rtw_phy_write_rf_reg_sipi,
|
||||
.set_antenna = NULL,
|
||||
|
|
|
|||
|
|
@ -2055,6 +2055,7 @@ static const struct rtw_chip_ops rtw8814a_ops = {
|
|||
.query_phy_status = rtw8814a_query_phy_status,
|
||||
.set_channel = rtw8814a_set_channel,
|
||||
.mac_init = rtw8814a_mac_init,
|
||||
.mac_postinit = NULL,
|
||||
.read_rf = rtw_phy_read_rf,
|
||||
.write_rf = rtw_phy_write_rf_reg_sipi,
|
||||
.set_tx_power_index = rtw8814a_set_tx_power_index,
|
||||
|
|
|
|||
|
|
@ -865,6 +865,7 @@ static const struct rtw_chip_ops rtw8821a_ops = {
|
|||
.query_phy_status = rtw8821a_query_phy_status,
|
||||
.set_channel = rtw88xxa_set_channel,
|
||||
.mac_init = NULL,
|
||||
.mac_postinit = NULL,
|
||||
.read_rf = rtw88xxa_phy_read_rf,
|
||||
.write_rf = rtw_phy_write_rf_reg_sipi,
|
||||
.set_antenna = NULL,
|
||||
|
|
|
|||
|
|
@ -1663,6 +1663,7 @@ static const struct rtw_chip_ops rtw8821c_ops = {
|
|||
.query_phy_status = query_phy_status,
|
||||
.set_channel = rtw8821c_set_channel,
|
||||
.mac_init = rtw8821c_mac_init,
|
||||
.mac_postinit = NULL,
|
||||
.read_rf = rtw_phy_read_rf,
|
||||
.write_rf = rtw_phy_write_rf_reg_sipi,
|
||||
.set_antenna = NULL,
|
||||
|
|
|
|||
|
|
@ -2154,6 +2154,7 @@ static const struct rtw_chip_ops rtw8822b_ops = {
|
|||
.query_phy_status = query_phy_status,
|
||||
.set_channel = rtw8822b_set_channel,
|
||||
.mac_init = rtw8822b_mac_init,
|
||||
.mac_postinit = NULL,
|
||||
.read_rf = rtw_phy_read_rf,
|
||||
.write_rf = rtw_phy_write_rf_reg_sipi,
|
||||
.set_tx_power_index = rtw8822b_set_tx_power_index,
|
||||
|
|
|
|||
|
|
@ -4964,6 +4964,7 @@ static const struct rtw_chip_ops rtw8822c_ops = {
|
|||
.query_phy_status = query_phy_status,
|
||||
.set_channel = rtw8822c_set_channel,
|
||||
.mac_init = rtw8822c_mac_init,
|
||||
.mac_postinit = NULL,
|
||||
.dump_fw_crash = rtw8822c_dump_fw_crash,
|
||||
.read_rf = rtw_phy_read_rf,
|
||||
.write_rf = rtw_phy_write_rf_reg_mix,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user