mt7615_init_wiphy() advertises NL80211_EXT_FEATURE_SET_SCAN_DWELL, but mt76_connac_mcu_hw_scan() ignores the duration of the scan request. On mt7663 the dwell time per channel is a fixed value, whatever duration the request asks for. Pass the duration of the request, converted to ms, as the minimum and the maximum dwell time, and size the scan timeout from it. A request without a duration keeps the fixed value. The connac2 chips keep the firmware dwell time, since their firmware does not take one from the driver, see commit 9db419f0cb39 ("mt76: mt7921: fix the dwell time control"). Fixes: fcdfc29e58ee ("mt76: mt7615: introduce hw scan support") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index 56b4a0940bb1..230487da1ccf 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -1891,7 +1891,10 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif, /* increase channel time for passive scan */ if (!sreq->n_ssids) duration *= 2; - req->timeout_value = cpu_to_le16(sreq->n_channels * duration); + if (sreq->duration && !is_connac2(phy->dev)) + duration = mt76_connac_mcu_scan_dwell(sreq); + req->timeout_value = cpu_to_le16(min_t(u32, sreq->n_channels * duration, + U16_MAX)); req->channel_min_dwell_time = cpu_to_le16(duration); req->channel_dwell_time = cpu_to_le16(duration); -- 2.47.3