Commit a48f4fd0 authored by Eric Huang's avatar Eric Huang Committed by Kalle Valo

wifi: rtw89: 8852b: update BSS color mapping register

BSS color mapping register is different per IC, therefore, move this
register to chip_info and update the setting function. Without this patch,
wrong BSS color causes behavior abnormal, especially DL-OFDMA.
Signed-off-by: default avatarEric Huang <echuang@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221214091803.41293-1-pkshih@realtek.com
parent e0097ac5
...@@ -2811,6 +2811,7 @@ struct rtw89_chip_info { ...@@ -2811,6 +2811,7 @@ struct rtw89_chip_info {
u8 dcfo_comp_sft; u8 dcfo_comp_sft;
const struct rtw89_imr_info *imr_info; const struct rtw89_imr_info *imr_info;
const struct rtw89_rrsr_cfgs *rrsr_cfgs; const struct rtw89_rrsr_cfgs *rrsr_cfgs;
u32 bss_clr_map_reg;
u32 dma_ch_mask; u32 dma_ch_mask;
const struct wiphy_wowlan_support *wowlan_stub; const struct wiphy_wowlan_support *wowlan_stub;
}; };
......
...@@ -4117,6 +4117,7 @@ void rtw89_phy_dm_init(struct rtw89_dev *rtwdev) ...@@ -4117,6 +4117,7 @@ void rtw89_phy_dm_init(struct rtw89_dev *rtwdev)
void rtw89_phy_set_bss_color(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif) void rtw89_phy_set_bss_color(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif)
{ {
const struct rtw89_chip_info *chip = rtwdev->chip;
enum rtw89_phy_idx phy_idx = RTW89_PHY_0; enum rtw89_phy_idx phy_idx = RTW89_PHY_0;
u8 bss_color; u8 bss_color;
...@@ -4125,11 +4126,11 @@ void rtw89_phy_set_bss_color(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif ...@@ -4125,11 +4126,11 @@ void rtw89_phy_set_bss_color(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif
bss_color = vif->bss_conf.he_bss_color.color; bss_color = vif->bss_conf.he_bss_color.color;
rtw89_phy_write32_idx(rtwdev, R_BSS_CLR_MAP, B_BSS_CLR_MAP_VLD0, 0x1, rtw89_phy_write32_idx(rtwdev, chip->bss_clr_map_reg, B_BSS_CLR_MAP_VLD0, 0x1,
phy_idx);
rtw89_phy_write32_idx(rtwdev, R_BSS_CLR_MAP, B_BSS_CLR_MAP_TGT, bss_color,
phy_idx); phy_idx);
rtw89_phy_write32_idx(rtwdev, R_BSS_CLR_MAP, B_BSS_CLR_MAP_STAID, rtw89_phy_write32_idx(rtwdev, chip->bss_clr_map_reg, B_BSS_CLR_MAP_TGT,
bss_color, phy_idx);
rtw89_phy_write32_idx(rtwdev, chip->bss_clr_map_reg, B_BSS_CLR_MAP_STAID,
vif->cfg.aid, phy_idx); vif->cfg.aid, phy_idx);
} }
......
...@@ -4108,6 +4108,7 @@ ...@@ -4108,6 +4108,7 @@
#define R_SEG0CSI_EN 0x42C4 #define R_SEG0CSI_EN 0x42C4
#define B_SEG0CSI_EN BIT(23) #define B_SEG0CSI_EN BIT(23)
#define R_BSS_CLR_MAP 0x43ac #define R_BSS_CLR_MAP 0x43ac
#define R_BSS_CLR_MAP_V1 0x43B0
#define B_BSS_CLR_MAP_VLD0 BIT(28) #define B_BSS_CLR_MAP_VLD0 BIT(28)
#define B_BSS_CLR_MAP_TGT GENMASK(27, 22) #define B_BSS_CLR_MAP_TGT GENMASK(27, 22)
#define B_BSS_CLR_MAP_STAID GENMASK(21, 11) #define B_BSS_CLR_MAP_STAID GENMASK(21, 11)
......
...@@ -2135,6 +2135,7 @@ const struct rtw89_chip_info rtw8852a_chip_info = { ...@@ -2135,6 +2135,7 @@ const struct rtw89_chip_info rtw8852a_chip_info = {
.dcfo_comp_sft = 3, .dcfo_comp_sft = 3,
.imr_info = &rtw8852a_imr_info, .imr_info = &rtw8852a_imr_info,
.rrsr_cfgs = &rtw8852a_rrsr_cfgs, .rrsr_cfgs = &rtw8852a_rrsr_cfgs,
.bss_clr_map_reg = R_BSS_CLR_MAP,
.dma_ch_mask = 0, .dma_ch_mask = 0,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.wowlan_stub = &rtw_wowlan_stub_8852a, .wowlan_stub = &rtw_wowlan_stub_8852a,
......
...@@ -2512,6 +2512,7 @@ const struct rtw89_chip_info rtw8852b_chip_info = { ...@@ -2512,6 +2512,7 @@ const struct rtw89_chip_info rtw8852b_chip_info = {
.dcfo_comp_sft = 3, .dcfo_comp_sft = 3,
.imr_info = &rtw8852b_imr_info, .imr_info = &rtw8852b_imr_info,
.rrsr_cfgs = &rtw8852b_rrsr_cfgs, .rrsr_cfgs = &rtw8852b_rrsr_cfgs,
.bss_clr_map_reg = R_BSS_CLR_MAP_V1,
.dma_ch_mask = BIT(RTW89_DMA_ACH4) | BIT(RTW89_DMA_ACH5) | .dma_ch_mask = BIT(RTW89_DMA_ACH4) | BIT(RTW89_DMA_ACH5) |
BIT(RTW89_DMA_ACH6) | BIT(RTW89_DMA_ACH7) | BIT(RTW89_DMA_ACH6) | BIT(RTW89_DMA_ACH7) |
BIT(RTW89_DMA_B1MG) | BIT(RTW89_DMA_B1HI), BIT(RTW89_DMA_B1MG) | BIT(RTW89_DMA_B1HI),
......
...@@ -2945,6 +2945,7 @@ const struct rtw89_chip_info rtw8852c_chip_info = { ...@@ -2945,6 +2945,7 @@ const struct rtw89_chip_info rtw8852c_chip_info = {
.dcfo_comp_sft = 5, .dcfo_comp_sft = 5,
.imr_info = &rtw8852c_imr_info, .imr_info = &rtw8852c_imr_info,
.rrsr_cfgs = &rtw8852c_rrsr_cfgs, .rrsr_cfgs = &rtw8852c_rrsr_cfgs,
.bss_clr_map_reg = R_BSS_CLR_MAP,
.dma_ch_mask = 0, .dma_ch_mask = 0,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.wowlan_stub = &rtw_wowlan_stub_8852c, .wowlan_stub = &rtw_wowlan_stub_8852c,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment