From a7b9153021474c486bd1c16932889677f8e73ae7 Mon Sep 17 00:00:00 2001 From: Ryder Lee Date: Thu, 1 Dec 2022 11:44:40 +0800 Subject: [PATCH] wifi: mt76: mt7915: fix scene detection flow of spatial reuse Firmware is in the driving seat while sr_scene_detect is enabled, so driver needs to skip operation to avoid mangling scene detection algorithm. Fixes: a633503 ("wifi: mt76: mt7915: add support to configure spatial reuse parameter set") Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau --- mt7915/mcu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mt7915/mcu.c b/mt7915/mcu.c index a64010e0..b2835d9c 100644 --- a/mt7915/mcu.c +++ b/mt7915/mcu.c @@ -3528,22 +3528,22 @@ int mt7915_mcu_add_obss_spr(struct mt7915_phy *phy, struct ieee80211_vif *vif, if (ret) return ret; + /* firmware dynamically adjusts PD threshold so skip manual control */ + if (sr_scene_detect && !he_obss_pd->enable) + return 0; + /* enable spatial reuse */ ret = mt7915_mcu_enable_obss_spr(phy, SPR_ENABLE, he_obss_pd->enable); if (ret) return ret; - if (!he_obss_pd->enable) + if (sr_scene_detect || !he_obss_pd->enable) return 0; ret = mt7915_mcu_enable_obss_spr(phy, SPR_ENABLE_TX, true); if (ret) return ret; - /* firmware dynamically adjusts PD threshold so skip manual control */ - if (sr_scene_detect) - return 0; - /* set SRG/non-SRG OBSS PD threshold */ ret = mt7915_mcu_set_obss_spr_pd(phy, he_obss_pd); if (ret)