From 9636177117d8a92b7befbfe291e35cb2c5eb2877 Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Wed, 29 Apr 2020 19:48:53 +0200 Subject: [PATCH] mt76: mt7615: fix ssid configuration in mt7615_mcu_hw_scan Fix SSID configuration performing hw frequency scanning Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau --- mt7615/mcu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mt7615/mcu.c b/mt7615/mcu.c index cbad854d7..f4e835f03 100644 --- a/mt7615/mcu.c +++ b/mt7615/mcu.c @@ -2719,9 +2719,9 @@ int mt7615_mcu_hw_scan(struct mt7615_phy *phy, struct ieee80211_vif *vif, { struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv; struct cfg80211_scan_request *sreq = &scan_req->req; + int n_ssids = 0, err, i, duration = MT7615_SCAN_CHANNEL_TIME; int ext_channels_num = max_t(int, sreq->n_channels - 32, 0); struct ieee80211_channel **scan_list = sreq->channels; - int err, i, duration = MT7615_SCAN_CHANNEL_TIME; struct mt7615_dev *dev = phy->dev; bool ext_phy = phy != &dev->phy; struct mt7615_mcu_scan_channel *chan; @@ -2744,16 +2744,21 @@ int mt7615_mcu_hw_scan(struct mt7615_phy *phy, struct ieee80211_vif *vif, req->seq_num = mvif->scan_seq_num | ext_phy << 7; req->bss_idx = mvif->idx; req->scan_type = 1; - req->ssid_type = 1; req->probe_req_num = 2; req->version = 1; req->channel_type = 4; for (i = 0; i < sreq->n_ssids; i++) { + if (!sreq->ssids[i].ssid_len) + continue; + req->ssids[i].ssid_len = cpu_to_le32(sreq->ssids[i].ssid_len); memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid, sreq->ssids[i].ssid_len); + n_ssids++; } + req->ssid_type = n_ssids ? BIT(2) : BIT(0); + req->ssids_num = n_ssids; req->timeout_value = cpu_to_le16(sreq->n_channels * duration); req->channel_min_dwell_time = cpu_to_le16(duration);