wifi: mt76: mt7925: config the dwell time by firmware
authorMichael Lo <michael.lo@mediatek.com>
Wed, 6 Nov 2024 01:32:21 +0000 (09:32 +0800)
committerFelix Fietkau <nbd@nbd.name>
Tue, 14 Jan 2025 12:34:35 +0000 (13:34 +0100)
To optimize the scan time of mt7925, remove the dwell time
setting for the scan command and let it be controlled by
the firmware as mt7921.

Signed-off-by: Michael Lo <michael.lo@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20241106013221.18101-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index ce3d8197b026a6d0f30a300d76357840877bfc5a..9bbe046630a0ac02933c2adbc97a104b7780ee27 100644 (file)
@@ -2689,14 +2689,12 @@ int mt7925_mcu_set_dbdc(struct mt76_phy *phy, bool enable)
        return err;
 }
 
-#define MT76_CONNAC_SCAN_CHANNEL_TIME          60
-
 int mt7925_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
                       struct ieee80211_scan_request *scan_req)
 {
        struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
        struct cfg80211_scan_request *sreq = &scan_req->req;
-       int n_ssids = 0, err, i, duration;
+       int n_ssids = 0, err, i;
        struct ieee80211_channel **scan_list = sreq->channels;
        struct mt76_dev *mdev = phy->dev;
        struct mt76_connac_mcu_scan_channel *chan;
@@ -2732,14 +2730,6 @@ int mt7925_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
        req->scan_type = sreq->n_ssids ? 1 : 0;
        req->probe_req_num = sreq->n_ssids ? 2 : 0;
 
-       duration = MT76_CONNAC_SCAN_CHANNEL_TIME;
-       /* increase channel time for passive scan */
-       if (!sreq->n_ssids)
-               duration *= 2;
-       req->timeout_value = cpu_to_le16(sreq->n_channels * duration);
-       req->channel_min_dwell_time = cpu_to_le16(duration);
-       req->channel_dwell_time = cpu_to_le16(duration);
-
        tlv = mt76_connac_mcu_add_tlv(skb, UNI_SCAN_SSID, sizeof(*ssid));
        ssid = (struct scan_ssid_tlv *)tlv;
        for (i = 0; i < sreq->n_ssids; i++) {