* [PATCH v2 1/4] rtw89: change idle mode condition during hw_scan
2022-04-01 5:50 [PATCH v2 0/4] rtw89: some fixes related to hw_scan Ping-Ke Shih
@ 2022-04-01 5:50 ` Ping-Ke Shih
2022-04-06 8:56 ` Kalle Valo
2022-04-01 5:50 ` [PATCH v2 2/4] rtw89: packet offload handler to avoid warning Ping-Ke Shih
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Ping-Ke Shih @ 2022-04-01 5:50 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, ku920601, phhuang
From: Po Hao Huang <phhuang@realtek.com>
Previously we only consider single interface's status, idle mode
behavior could be unexpected when multiple interfaces is active.
Change to enter/leave idle mode by mac80211's configuration state.
Signed-off-by: Po Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index c61061358980b..be25b9a42fc11 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -1798,9 +1798,9 @@ static void rtw89_ips_work(struct work_struct *work)
{
struct rtw89_dev *rtwdev = container_of(work, struct rtw89_dev,
ips_work);
-
mutex_lock(&rtwdev->mutex);
- rtw89_enter_ips(rtwdev);
+ if (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE)
+ rtw89_enter_ips(rtwdev);
mutex_unlock(&rtwdev->mutex);
}
@@ -2703,7 +2703,7 @@ void rtw89_core_scan_start(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,
rtwdev->scanning = true;
rtw89_leave_lps(rtwdev);
- if (hw_scan && rtwvif->net_type == RTW89_NET_TYPE_NO_LINK)
+ if (hw_scan && (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE))
rtw89_leave_ips(rtwdev);
ether_addr_copy(rtwvif->mac_addr, mac_addr);
@@ -2727,7 +2727,7 @@ void rtw89_core_scan_complete(struct rtw89_dev *rtwdev,
rtwdev->scanning = false;
rtwdev->dig.bypass_dig = true;
- if (hw_scan && rtwvif->net_type == RTW89_NET_TYPE_NO_LINK)
+ if (hw_scan && (rtwdev->hw->conf.flags & IEEE80211_CONF_IDLE))
ieee80211_queue_work(rtwdev->hw, &rtwdev->ips_work);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/4] rtw89: packet offload handler to avoid warning
2022-04-01 5:50 [PATCH v2 0/4] rtw89: some fixes related to hw_scan Ping-Ke Shih
2022-04-01 5:50 ` [PATCH v2 1/4] rtw89: change idle mode condition during hw_scan Ping-Ke Shih
@ 2022-04-01 5:50 ` Ping-Ke Shih
2022-04-01 5:50 ` [PATCH v2 3/4] rtw89: coex: Add case for scan offload Ping-Ke Shih
2022-04-01 5:50 ` [PATCH v2 4/4] rtw89: fix misconfiguration on hw_scan channel time Ping-Ke Shih
3 siblings, 0 replies; 6+ messages in thread
From: Ping-Ke Shih @ 2022-04-01 5:50 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, ku920601, phhuang
From: Po Hao Huang <phhuang@realtek.com>
Add a dummy function for packet offload to eliminate warning message
"c2h class 1 func 2 not support". This c2h is for debug purpose and
its presence itself can do the work, so further parsing won't be
required for now.
Signed-off-by: Po Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/mac.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index 0a8fd672b41f6..b4855886d1207 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -3341,12 +3341,18 @@ rtw89_mac_c2h_bcn_cnt(struct rtw89_dev *rtwdev, struct sk_buff *c2h, u32 len)
{
}
+static void
+rtw89_mac_c2h_pkt_ofld_rsp(struct rtw89_dev *rtwdev, struct sk_buff *c2h,
+ u32 len)
+{
+}
+
static
void (* const rtw89_mac_c2h_ofld_handler[])(struct rtw89_dev *rtwdev,
struct sk_buff *c2h, u32 len) = {
[RTW89_MAC_C2H_FUNC_EFUSE_DUMP] = NULL,
[RTW89_MAC_C2H_FUNC_READ_RSP] = NULL,
- [RTW89_MAC_C2H_FUNC_PKT_OFLD_RSP] = NULL,
+ [RTW89_MAC_C2H_FUNC_PKT_OFLD_RSP] = rtw89_mac_c2h_pkt_ofld_rsp,
[RTW89_MAC_C2H_FUNC_BCN_RESEND] = NULL,
[RTW89_MAC_C2H_FUNC_MACID_PAUSE] = rtw89_mac_c2h_macid_pause,
[RTW89_MAC_C2H_FUNC_SCANOFLD_RSP] = rtw89_mac_c2h_scanofld_rsp,
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/4] rtw89: coex: Add case for scan offload
2022-04-01 5:50 [PATCH v2 0/4] rtw89: some fixes related to hw_scan Ping-Ke Shih
2022-04-01 5:50 ` [PATCH v2 1/4] rtw89: change idle mode condition during hw_scan Ping-Ke Shih
2022-04-01 5:50 ` [PATCH v2 2/4] rtw89: packet offload handler to avoid warning Ping-Ke Shih
@ 2022-04-01 5:50 ` Ping-Ke Shih
2022-04-01 5:50 ` [PATCH v2 4/4] rtw89: fix misconfiguration on hw_scan channel time Ping-Ke Shih
3 siblings, 0 replies; 6+ messages in thread
From: Ping-Ke Shih @ 2022-04-01 5:50 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, ku920601, phhuang
From: Ching-Te Ku <ku920601@realtek.com>
Turn off coexistence driver control, let firmware can control the
traffic during scan. This prevents potential unexpected behavior of
the BT driver.
Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/coex.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c
index 07f26718b66fb..bf433a68c1ded 100644
--- a/drivers/net/wireless/realtek/rtw89/coex.c
+++ b/drivers/net/wireless/realtek/rtw89/coex.c
@@ -3068,7 +3068,17 @@ static void _action_wl_scan(struct rtw89_dev *rtwdev)
struct rtw89_btc_wl_info *wl = &btc->cx.wl;
struct rtw89_btc_wl_dbcc_info *wl_dinfo = &wl->dbcc_info;
- if (rtwdev->dbcc_en) {
+ if (RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD, &rtwdev->fw)) {
+ _set_ant(rtwdev, NM_EXEC, BTC_PHY_ALL, BTC_ANT_W25G);
+ if (btc->mdinfo.ant.type == BTC_ANT_SHARED)
+ _set_policy(rtwdev, BTC_CXP_OFFE_DEF,
+ BTC_RSN_NTFY_SCAN_START);
+ else
+ _set_policy(rtwdev, BTC_CXP_OFF_EQ0,
+ BTC_RSN_NTFY_SCAN_START);
+
+ rtw89_debug(rtwdev, RTW89_DBG_BTC, "[BTC], Scan offload!\n");
+ } else if (rtwdev->dbcc_en) {
if (wl_dinfo->real_band[RTW89_PHY_0] != RTW89_BAND_2G &&
wl_dinfo->real_band[RTW89_PHY_1] != RTW89_BAND_2G)
_action_wl_5g(rtwdev);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 4/4] rtw89: fix misconfiguration on hw_scan channel time
2022-04-01 5:50 [PATCH v2 0/4] rtw89: some fixes related to hw_scan Ping-Ke Shih
` (2 preceding siblings ...)
2022-04-01 5:50 ` [PATCH v2 3/4] rtw89: coex: Add case for scan offload Ping-Ke Shih
@ 2022-04-01 5:50 ` Ping-Ke Shih
3 siblings, 0 replies; 6+ messages in thread
From: Ping-Ke Shih @ 2022-04-01 5:50 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, ku920601, phhuang
From: Po Hao Huang <phhuang@realtek.com>
Without this patch, hw scan won't stay long enough on DFS/passive
channels. Found previous logic error and fix it.
Signed-off-by: Po Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/fw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c
index 4848f25e7a0af..022d52b0c2e78 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.c
+++ b/drivers/net/wireless/realtek/rtw89/fw.c
@@ -2099,7 +2099,7 @@ static void rtw89_hw_scan_add_chan(struct rtw89_dev *rtwdev, int chan_type,
ch_info->num_pkt = 0;
break;
case RTW89_CHAN_DFS:
- ch_info->period = min_t(u8, ch_info->period,
+ ch_info->period = max_t(u8, ch_info->period,
RTW89_DFS_CHAN_TIME);
ch_info->dwell_time = RTW89_DWELL_TIME;
break;
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread