mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-07-01 16:27:08 +08:00
119 lines
4.2 KiB
Diff
119 lines
4.2 KiB
Diff
From 4f6dd92305f74c43f09e2ff867011e0029ee0e0d Mon Sep 17 00:00:00 2001
|
|
From: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
|
|
Date: Wed, 9 Feb 2022 19:43:39 +0530
|
|
Subject: [PATCH] ath11k: fix radar detection in 160 Mhz
|
|
|
|
Radar detection fails in the secondary 80 MHz when the
|
|
the AP's primary 80 MHz is in non-DFS region in 160 MHz.
|
|
|
|
This is due to WMI channel flag WMI_CHAN_INFO_DFS_FREQ2 is not set
|
|
properly in case of the primary 80 MHz is in non-DFS region.
|
|
HALPHY detects the radar pulses in the secondary 80 MHz only when
|
|
WMI_CHAN_INFO_DFS_FREQ2 is set.
|
|
|
|
Fix this issue by setting WMI channel flag WMI_CHAN_INFO_DFS_FREQ2
|
|
based on the radar_enabled flag from the channel context.
|
|
|
|
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
|
|
|
|
Signed-off-by: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
|
|
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
|
Link: https://lore.kernel.org/r/1644416019-820-2-git-send-email-quic_vnaralas@quicinc.com
|
|
---
|
|
drivers/net/wireless/ath/ath11k/mac.c | 25 +++++++++++++------------
|
|
1 file changed, 13 insertions(+), 12 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
|
@@ -6630,12 +6630,13 @@ static void ath11k_mac_op_remove_chanctx
|
|
|
|
static int
|
|
ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif,
|
|
- const struct cfg80211_chan_def *chandef,
|
|
+ struct ieee80211_chanctx_conf *ctx,
|
|
bool restart)
|
|
{
|
|
struct ath11k *ar = arvif->ar;
|
|
struct ath11k_base *ab = ar->ab;
|
|
struct wmi_vdev_start_req_arg arg = {};
|
|
+ const struct cfg80211_chan_def *chandef = &ctx->def;
|
|
int he_support = arvif->vif->bss_conf.he_support;
|
|
int ret = 0;
|
|
|
|
@@ -6670,8 +6671,7 @@ ath11k_mac_vdev_start_restart(struct ath
|
|
arg.channel.chan_radar =
|
|
!!(chandef->chan->flags & IEEE80211_CHAN_RADAR);
|
|
|
|
- arg.channel.freq2_radar =
|
|
- !!(chandef->chan->flags & IEEE80211_CHAN_RADAR);
|
|
+ arg.channel.freq2_radar = ctx->radar_enabled;
|
|
|
|
arg.channel.passive = arg.channel.chan_radar;
|
|
|
|
@@ -6781,15 +6781,15 @@ err:
|
|
}
|
|
|
|
static int ath11k_mac_vdev_start(struct ath11k_vif *arvif,
|
|
- const struct cfg80211_chan_def *chandef)
|
|
+ struct ieee80211_chanctx_conf *ctx)
|
|
{
|
|
- return ath11k_mac_vdev_start_restart(arvif, chandef, false);
|
|
+ return ath11k_mac_vdev_start_restart(arvif, ctx, false);
|
|
}
|
|
|
|
static int ath11k_mac_vdev_restart(struct ath11k_vif *arvif,
|
|
- const struct cfg80211_chan_def *chandef)
|
|
+ struct ieee80211_chanctx_conf *ctx)
|
|
{
|
|
- return ath11k_mac_vdev_start_restart(arvif, chandef, true);
|
|
+ return ath11k_mac_vdev_start_restart(arvif, ctx, true);
|
|
}
|
|
|
|
struct ath11k_mac_change_chanctx_arg {
|
|
@@ -6864,7 +6864,7 @@ ath11k_mac_update_vif_chan(struct ath11k
|
|
* If vdev is down then it expect vdev_stop->vdev_start.
|
|
*/
|
|
if (arvif->is_up) {
|
|
- ret = ath11k_mac_vdev_restart(arvif, &vifs[i].new_ctx->def);
|
|
+ ret = ath11k_mac_vdev_restart(arvif, vifs[i].new_ctx);
|
|
if (ret) {
|
|
ath11k_warn(ab, "failed to restart vdev %d: %d\n",
|
|
arvif->vdev_id, ret);
|
|
@@ -6878,7 +6878,7 @@ ath11k_mac_update_vif_chan(struct ath11k
|
|
continue;
|
|
}
|
|
|
|
- ret = ath11k_mac_vdev_start(arvif, &vifs[i].new_ctx->def);
|
|
+ ret = ath11k_mac_vdev_start(arvif, vifs[i].new_ctx);
|
|
if (ret)
|
|
ath11k_warn(ab, "failed to start vdev %d: %d\n",
|
|
arvif->vdev_id, ret);
|
|
@@ -6967,7 +6967,8 @@ static void ath11k_mac_op_change_chanctx
|
|
if (WARN_ON(changed & IEEE80211_CHANCTX_CHANGE_CHANNEL))
|
|
goto unlock;
|
|
|
|
- if (changed & IEEE80211_CHANCTX_CHANGE_WIDTH)
|
|
+ if (changed & IEEE80211_CHANCTX_CHANGE_WIDTH ||
|
|
+ changed & IEEE80211_CHANCTX_CHANGE_RADAR)
|
|
ath11k_mac_update_active_vif_chan(ar, ctx);
|
|
|
|
/* TODO: Recalc radar detection */
|
|
@@ -6987,7 +6988,7 @@ static int ath11k_start_vdev_delay(struc
|
|
if (WARN_ON(arvif->is_started))
|
|
return -EBUSY;
|
|
|
|
- ret = ath11k_mac_vdev_start(arvif, &arvif->chanctx.def);
|
|
+ ret = ath11k_mac_vdev_start(arvif, &arvif->chanctx);
|
|
if (ret) {
|
|
ath11k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n",
|
|
arvif->vdev_id, vif->addr,
|
|
@@ -7081,7 +7082,7 @@ ath11k_mac_op_assign_vif_chanctx(struct
|
|
goto out;
|
|
}
|
|
|
|
- ret = ath11k_mac_vdev_start(arvif, &ctx->def);
|
|
+ ret = ath11k_mac_vdev_start(arvif, ctx);
|
|
if (ret) {
|
|
ath11k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n",
|
|
arvif->vdev_id, vif->addr,
|