Commit 19cb9427 authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

rtw89: initialize NAV control

Configure NAV function and its parameters.
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/20220325060055.58482-15-pkshih@realtek.com
parent c49154ff
...@@ -1883,6 +1883,16 @@ static int cca_ctrl_init(struct rtw89_dev *rtwdev, u8 mac_idx) ...@@ -1883,6 +1883,16 @@ static int cca_ctrl_init(struct rtw89_dev *rtwdev, u8 mac_idx)
return 0; return 0;
} }
static int nav_ctrl_init(struct rtw89_dev *rtwdev)
{
rtw89_write32_set(rtwdev, R_AX_WMAC_NAV_CTL, B_AX_WMAC_PLCP_UP_NAV_EN |
B_AX_WMAC_TF_UP_NAV_EN |
B_AX_WMAC_NAV_UPPER_EN);
rtw89_write32_mask(rtwdev, R_AX_WMAC_NAV_CTL, B_AX_WMAC_NAV_UPPER_MASK, NAV_12MS);
return 0;
}
static int spatial_reuse_init(struct rtw89_dev *rtwdev, u8 mac_idx) static int spatial_reuse_init(struct rtw89_dev *rtwdev, u8 mac_idx)
{ {
u32 reg; u32 reg;
...@@ -2098,6 +2108,13 @@ static int cmac_init(struct rtw89_dev *rtwdev, u8 mac_idx) ...@@ -2098,6 +2108,13 @@ static int cmac_init(struct rtw89_dev *rtwdev, u8 mac_idx)
return ret; return ret;
} }
ret = nav_ctrl_init(rtwdev);
if (ret) {
rtw89_err(rtwdev, "[ERR]CMAC%d NAV CTRL init %d\n", mac_idx,
ret);
return ret;
}
ret = spatial_reuse_init(rtwdev, mac_idx); ret = spatial_reuse_init(rtwdev, mac_idx);
if (ret) { if (ret) {
rtw89_err(rtwdev, "[ERR]CMAC%d Spatial Reuse init %d\n", rtw89_err(rtwdev, "[ERR]CMAC%d Spatial Reuse init %d\n",
......
...@@ -1435,6 +1435,16 @@ ...@@ -1435,6 +1435,16 @@
#define R_AX_MAC_LOOPBACK_C1 0xEC20 #define R_AX_MAC_LOOPBACK_C1 0xEC20
#define B_AX_MACLBK_EN BIT(0) #define B_AX_MACLBK_EN BIT(0)
#define R_AX_WMAC_NAV_CTL 0xCC80
#define R_AX_WMAC_NAV_CTL_C1 0xEC80
#define B_AX_WMAC_NAV_UPPER_EN BIT(26)
#define B_AX_WMAC_0P125US_TIMER_MASK GENMASK(25, 18)
#define B_AX_WMAC_PLCP_UP_NAV_EN BIT(17)
#define B_AX_WMAC_TF_UP_NAV_EN BIT(16)
#define B_AX_WMAC_NAV_UPPER_MASK GENMASK(15, 8)
#define NAV_12MS 0xBC
#define B_AX_WMAC_RTS_RST_DUR_MASK GENMASK(7, 0)
#define R_AX_RXTRIG_TEST_USER_2 0xCCB0 #define R_AX_RXTRIG_TEST_USER_2 0xCCB0
#define R_AX_RXTRIG_TEST_USER_2_C1 0xECB0 #define R_AX_RXTRIG_TEST_USER_2_C1 0xECB0
#define B_AX_RXTRIG_MACID_MASK GENMASK(31, 24) #define B_AX_RXTRIG_MACID_MASK GENMASK(31, 24)
......
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